Skip to content

[BUG][Java] duplicate @JsonTypeName annotation #11492

@cachescrubber

Description

@cachescrubber

Bug Report Checklist

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}}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions