[BUG][Java] duplicate @JsonTypeName annotation
Created by: cachescrubber
Bug Report Checklist
-
Have you tested with the latest master to confirm the issue still exists? - [x ] Have you searched for related issues/PRs?
Description
If a Spec uses inheritance, and a Schema is considered to be sanitised (isClassnameSanitized is true) the java generator will generate a duplicate @JsonTypeName("Model_Name")
annotation.
See Java/pojo.mustache
and Java/typeInfoAnnotation.mustache
.
openapi-generator version
5.4.0
Suggest a fix
I'm happy to provide PR with a fix, but would like to discuss prior with the core team and / or Java technical committee wether to unconditionally include @JsonTypeName or use the isClassnameSanitized condition.
{{#isClassnameSanitized}}
@JsonTypeName("{{name}}")
{{/isClassnameSanitized}}