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
Executing the Spring generator on an Open API file having a HEAD method results in a compilation issue: the generator adds a @HeadMapping annotation which does not exist in spring.
One way to fix that would be to generate RequestMapping whenever the HEAD method is used:
Another way would be to revert this commit: 8bd2dd4
And just use @RequestMapping instead of the new PutMapping/GetMapping/etc...
The advantage with this approach imo is that the generator code remains simple.
The text was updated successfully, but these errors were encountered:
Regarding the possible solutions proposed by @gonzalad, I think the best option would be to revert the commit and improve this behaviour in future improvements.
Description
Executing the Spring generator on an Open API file having a HEAD method results in a compilation issue: the generator adds a @HeadMapping annotation which does not exist in spring.
One way to fix that would be to generate RequestMapping whenever the HEAD method is used:
The issue was introduced by this commit: 8bd2dd4
openapi-generator version
This issue affects openapi-generator from 5.0.0, 5.0.1 and 5.1.0.
OpenAPI declaration file content or url
https://gist.github.com/gonzalad/50a657c2ffbafeb85d955672d192e9d2
Generation Details
Just use spring on the previous openapi file.
Steps to reproduce
See https://github.com/gonzalad/openapi-headmapping-issue
mvn clean compile
And look at the PetsApi.java class that was generated, we see HeadMapping annotation
which does not exist in Spring:
Before the 5.0.0, the generated code was
Related issues/PRs
None known
Suggest a fix
And just use @RequestMapping instead of the new PutMapping/GetMapping/etc...
The advantage with this approach imo is that the generator code remains simple.
The text was updated successfully, but these errors were encountered: