Bug Report Checklist
Description
Generating a Feign-client with header-param, e.g. Authorization, causes a validation-error:
Caused by: java.lang.IllegalStateException: Body parameters cannot be used with form parameters.
at feign.Util.checkState(Util.java:130) ~[feign-core-10.4.0.jar:na]
openapi-generator version
4.2.3
OpenAPI declaration file content or url
https://gist.github.com/Chr1st0ph/bb10430c703f79dd938201c19c92fbc1
Generated code:
@RequestLine("POST /examples")
@Headers({
"Content-Type: application/json",
"Accept: application/json",
"Authorization: {authorization}"
})
void postExample(@Param("Authorization") String authorization, String body);
Mapping in Headers-annotation for Authorization does not fit to mapping in Param-annotation.
Command line used for generation
mvn spring-boot:run -Dspring-boot
Steps to reproduce
Create files ( see linked GIST ), and run the Maven-command.
Related issues/PRs
I did a swift search, but did not find an open issue for it.
Suggest a fix
I will provide a merge-request for using paramName instead of baseName in openapi-generator/modules/openapi-generator/src/main/resources/Java/libraries/feign/api.mustache
Bug Report Checklist
Description
Generating a Feign-client with header-param, e.g. Authorization, causes a validation-error:
Caused by: java.lang.IllegalStateException: Body parameters cannot be used with form parameters.
at feign.Util.checkState(Util.java:130) ~[feign-core-10.4.0.jar:na]
openapi-generator version
4.2.3
OpenAPI declaration file content or url
https://gist.github.com/Chr1st0ph/bb10430c703f79dd938201c19c92fbc1
Generated code:
Mapping in Headers-annotation for Authorization does not fit to mapping in Param-annotation.
Command line used for generation
mvn spring-boot:run -Dspring-boot
Steps to reproduce
Create files ( see linked GIST ), and run the Maven-command.
Related issues/PRs
I did a swift search, but did not find an open issue for it.
Suggest a fix
I will provide a merge-request for using paramName instead of baseName in openapi-generator/modules/openapi-generator/src/main/resources/Java/libraries/feign/api.mustache