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
  • #12339
Closed
Open
Issue created May 11, 2022 by Administrator@rootContributor5 of 6 checklist items completed5/6 checklist items

[BUG][Kotlin] Invalid code being generated for interface inheritance

Created by: nicolashaan

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • Have you tested with the latest master to confirm the issue still exists?
  • Have you searched for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description

The following specification https://github.com/nicolashaan/openapi-generator/blob/bc7df2bb38e3fe26dabc2ad453bafeb8c403d57b/modules/openapi-generator/src/test/resources/3_0/kotlin/kotlin_interface.yaml

generates invalid Kolin code : -> https://github.com/nicolashaan/openapi-generator/blob/bc7df2bb38e3fe26dabc2ad453bafeb8c403d57b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Video.kt

Video inherits from Media interface but the inheritance is inherited by using Media()

openapi-generator version

master

OpenAPI declaration file content or url

https://github.com/nicolashaan/openapi-generator/blob/bc7df2bb38e3fe26dabc2ad453bafeb8c403d57b/modules/openapi-generator/src/test/resources/3_0/kotlin/kotlin_interface.yaml

Generation Details
Steps to reproduce
Related issues/PRs
Suggest a fix

Here is a working fix: https://github.com/nicolashaan/openapi-generator/commit/1f68eba6d805f995af1820f36a0f018f08ecf750

What spec and sample can I use to create a non-regression test for the fix (instead of creating a whole new sample and spec)?

Assignee
Assign to
Time tracking