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
  • #1205
Closed
Open
Issue created Oct 09, 2018 by Administrator@rootContributor

[KotlinSpring] Generated model is invalid if 'inheritance' is used

Created by: mikezx6r

Description

The Kotlin Spring generator currently generates inheritance of data classes if a schema/type uses allOf and $ref. Kotlin data classes do not support inheritance, so this is invalid code.

The generator will need to generate properties from the main object, as well as the sub-object directly.

openapi-generator version

3.2.3, 3.3.0 and 3.3.1-SNAPSHOT

OpenAPI declaration file content or url

https://gitlab.com/mikezx6r/openapi-test/blob/master/src/main/resources/api.yml

Command line used for generation

Using Gradle. kotlin-spring language. Refer to https://gitlab.com/mikezx6r/openapi-test/blob/master/build.gradle for specifics.

Steps to reproduce

./gradlew oAGenerate and view the models generated into the src/main/generated-kotlin folder

Related issues/PRs
Suggest a fix/enhancement

The data class needs to contain all the properties from itself as well as from the 'child' class directly.

Assignee
Assign to
Time tracking