You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 and String 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:
Add headers collection in RestMethodModel. I guess something like private final List<MethodParameterModel> headerParams; should be enough.
Add headers resolution logic into ModelCompiler.processRestMethod.
Add possibility to accept headers in 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:
Optionally add a parameter in Settings which enables headers resolution logic (in case someone would like to omit this feature for any reason).
Add annotation detection logic into SpringApplicationParser.parseControllerMethod.
The text was updated successfully, but these errors were encountered:
porunov
added a commit
to porunov/typescript-generator
that referenced
this issue
Feb 6, 2022
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: