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

feat(gen): client request editor #1138

Closed
tdakkota opened this issue Dec 13, 2023 Discussed in #1135 · 1 comment · Fixed by #1367
Closed

feat(gen): client request editor #1138

tdakkota opened this issue Dec 13, 2023 Discussed in #1135 · 1 comment · Fixed by #1367
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@tdakkota
Copy link
Member

Discussed in #1135

Originally posted by StringNick December 12, 2023
I tried to research how i can integrate change header or add some logger as server middleware to client library in dev environments, and i researched now it's not possible, so is it possible to add something like oapi-codegen for client generated code, for editing request (for example add custom header, and etc).
Example editor for special route and call:
image
Example of global request editor for all calls:

client, clientErr := NewClient("", WithRequestEditorFn(someHeaderOrLogEditor))

It can help to add logger, to add custom debug headers that u cant specify in spec and etc.
Without this configuration its inpossible to use generator for client in my project, for server i saw solution about abstract on server interface, but for client nothing.
Thank you for attention

@tdakkota tdakkota added the enhancement New feature or request label Dec 13, 2023
@tdakkota
Copy link
Member Author

tdakkota commented Dec 13, 2023

I think per-operation RequestEditor option is fine as an opt-in feature (e.g. client/request_editors).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant