Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add header parsing for headers in individual routes #27

Merged
merged 4 commits into from
May 29, 2024

Conversation

m-Bilal
Copy link
Member

@m-Bilal m-Bilal commented May 29, 2024

Issue

https://hasurahq.atlassian.net/browse/EDC-30

Description

This PR introduces header parsing for every individual API route in the OpenAPI Document. The previous support for headers applied headers to all routes, and the headers had to be specified manually. While that's still supported, this new header parser can pick up headers that are defined in the path parameters and parse them

The main parser is the file header-parser.ts and the tests are in header-parser.test.ts. All other changes are accommodation changes for the header parser.

Copy link
Collaborator

@codingkarthik codingkarthik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Asked a minor question, otherwise LGTM.

@m-Bilal m-Bilal merged commit e955496 into main May 29, 2024
m-Bilal added a commit that referenced this pull request Jun 2, 2024
…al addition of headers (#28)

Follow up to #27 

## Issue
https://hasurahq.atlassian.net/browse/EDC-30

## Description
This PR adds an optional parameter called `headers` in every function in `functions.ts`. This optional `headers` parameter will accept headers that the DDN Engine will forward to this data connector. Because headers will be forwarded by the DDN Engine, manual addition of headers has been removed. Tests have been updated to reflect that.

## Commits

* parsing logic that considers both global and local headers

* documentation

* add optional headers argument in functions template

* tests updated

* removed manual addition of headers

* format

* PR link in changelog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants