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
  • #8157
Closed
Open
Issue created Dec 10, 2020 by Administrator@rootContributor

[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
  1. See example project README.
  2. 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.

Assignee
Assign to
Time tracking