Skip to content

[REQ] Allow control of discriminator property in Spring #5694

@cervotoc

Description

@cervotoc

Is your feature request related to a problem? Please describe.

Typescript generator does not generate the needed discriminator property correctly. Event though the discriminator field is defined in the api declaration, it is missing in the generated typescript objects.
This can be solved by declaring discriminator as own property in the api specification. In Spring this property is then generated twice, once as own property, and once as an annotation JsonTypeInfo. This means
you have to specify the discriminator every time, you create the object in Spring.

Describe the solution you'd like

Adding a flag to the generator will allow to disable generating the own property in Spring and keep only the JsonTypeInfo annotation. While still keeping the Typescript implementation correct.

Describe alternatives you've considered

see discussion in PR #5263

maybe fix #3796

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