feat(operationalParameter): Default to config headers for header params#1865
feat(operationalParameter): Default to config headers for header params#1865optikalefx wants to merge 1 commit intoferdikoomen:mainfrom
Conversation
If OpenAPI has paramaters that will be sent as headers, allow configuration to set those headers for the entire client.
|
To the maintainers, there are at least 3 ways I could think of to implement this.
At any rate, I went with the least changes necessary for now, but happy to discuss the other approaches. I could make 3 PRs to look at if you want to, but before I write a test, I wanted to check with you on approach. Thanks! |
|
Check out our (previously forked) version of this package https://github.com/hey-api/openapi-ts. We have just recently added support for setting request/response interceptors. This may fit as an alternative solution to what you are trying to accomplish. Please check it out if you'd like, and create any issues if you run into problems. |
If OpenAPI has paramaters that will be sent as headers, allow configuration to set those headers for the entire client.
This PR generates the following typescript
Which allows a user to use the library as follows
And then method calls no longer require you to pass these headers every time. This is a welcome change to verbosity.
Feedback is welcome.