-
Notifications
You must be signed in to change notification settings - Fork 237
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 possibility to pass request headers to HttpClient #790
Comments
porunov
added a commit
to porunov/typescript-generator
that referenced
this issue
Feb 6, 2022
Fixes vojtechhabarta#790 Signed-off-by: Oleksandr Porunov <[email protected]>
porunov
added a commit
to porunov/typescript-generator
that referenced
this issue
Feb 6, 2022
Fixes vojtechhabarta#790 Signed-off-by: Oleksandr Porunov <[email protected]>
porunov
added a commit
to porunov/typescript-generator
that referenced
this issue
Jun 7, 2022
Fixes vojtechhabarta#790 Signed-off-by: Oleksandr Porunov <[email protected]>
+1 for this PR. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Right now the generated HttpClient interface looks like the next one:
The interface lacks a possibility to accept request headers which might be sometimes used to represent some incoming arguments.
For example, in Spring you would typically define the next arguments to accept headers in your controller:
Right now, both arguments
Integer argument1
andString argument2
are ignored.It would be great to add possibility to register header arguments as well and be able to pass them into
HttpClient
.I'm not that familiar with the code base right now but I guess that we should do something like the next:
RestMethodModel
. I guess something likeprivate final List<MethodParameterModel> headerParams;
should be enough.ModelCompiler.processRestMethod
.HttpClient
.If combined with #788 then this may be enough for any user to register custom headers on it's own if needed.
Without #788 the below steps might be necessary as well.
Another (optional) task might be related to detecting Spring
@RequestHeader
automatically (without using custom logic via #788). So, I would think about steps like the next:Settings
which enables headers resolution logic (in case someone would like to omit this feature for any reason).SpringApplicationParser.parseControllerMethod
.The text was updated successfully, but these errors were encountered: