Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Issues
  • #5694
Closed
Open
Issue created Mar 24, 2020 by Administrator@rootContributor

[REQ] Allow control of discriminator property in Spring

Created by: 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

Assignee
Assign to
Time tracking