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

Fix not handling header/cookie params #47

Closed
wants to merge 1 commit into from
Closed

Conversation

slikts
Copy link

@slikts slikts commented Dec 27, 2023

Skips header/cookie params, since they would normally be set globally instead of per-request, although I'm not sure if this is the correct approach, and it just fixes my usecase. Additionally, since the header names were not normalized, it would produce invalid syntax like this: getPet: (petId?: string, X-Example?: string).

@rametta
Copy link
Owner

rametta commented Dec 28, 2023

Hey @slikts, thanks for the PR!

The invalid syntax for headers is definitely a bug that needs fixing, I agree.

Removing the headers from the query is an interesting situation though - I don't think we can assume all headers should be set globally because there are definite use-cases where people would need to set headers per request.

I think we should opt for the most flexible approach first (per request) and then see if there's maybe a way to specify inside the yaml file if it should be included globally or not. It's not a great solution either though, I will look into alternative approaches too.

@slikts slikts marked this pull request as draft December 29, 2023 03:08
@slikts
Copy link
Author

slikts commented Dec 29, 2023

After a bit of thought, just skipping the params really isn't correct, and the solution would be to handle cookie and header params the same way as query params are handled currently and add them to the Axios request config, and then users can just use partial application to make hooks that only take query and path params.

@rametta
Copy link
Owner

rametta commented Jan 5, 2024

Very true. I will close this for now. Please open a PR or an issue in the future to track this if you're interested. If there's enough people asking for it, I'm sure we can figure out a nice solution

@rametta rametta closed this Jan 5, 2024
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