Open turneand opened 1 year ago
Already fixed.
Just use official micronaut generator for java and kotlin by micronaut-opeanpi gradle or maven plugin from this repo: https://github.com/micronaut-projects/micronaut-openapi
Look to this guide: https://guides.micronaut.io/latest/micronaut-openapi-generator-server.html
Also, please describe problems and suggestions here: https://github.com/micronaut-projects/micronaut-openapi/issues
Bug Report Checklist
Description
When generating code using "java-micronaut-server" (or java-micronaut-client) and micronaut_serde_jackson as the serialization library, against an openapi spec that contains a component with a unique array, the generated code includes an import for "com.fasterxml.jackson.databind.annotation.JsonDeserialize" that will fail compilation (as using micronaut-serialization instead of jackson).
Note, that for non-unique lists, the code generates correctly and this additional import is NOT present.
openapi-generator version
org.openapitools#openapi-generator-maven-plugin#7.0.0
OpenAPI declaration file content or url
Generation Details
See maven pom.xml snippet below, and yaml spec file above.
Steps to reproduce
Given above yaml file, execute the following maven plugin:
This then generates the model file that includes the following import statement:
Related issues/PRs
The original work for removing jackson for Micronaut was done under https://github.com/OpenAPITools/openapi-generator/pull/14065
Suggest a fix
Not sure on this, but ... I believe this import is being added in AbstractJavaCodegen but should be removed later if unused, such as in JavaClientCodegen.java (although not sure why it has the "set".equals(..)" part.