[BUG] [java] [resttemplate] Generated alias models missing JsonTypeName import
Created by: mikesaurus
Description
When generating client code with openapi-generator and the generateAliasAsModel
option set to true
, model classes generated from aliases are missing an import statement for the JsonTypeName annotation and fail to compile.
openapi-generator version
5.0.0-x
OpenAPI declaration file content or url
Example swagger contract.
Generation Details
The code is being generated using the Maven plugin. See example project.
Steps to reproduce
- See example project README.
- Change the
openapi-generator-maven-plugin.version
in the POM file to any 5.0.0-x version and build.
Related issues/PRs
None.
Suggest a fix
Include the JsonTypeName import for both standard and alias model classes.