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
  • #623
Closed
Open
Issue created Jul 23, 2018 by Administrator@rootContributor

[Python] Inheritance doesn't work

Created by: emreakca

Description

The generated Python SubClass doesn't inherited from the BaseClass, when allOf is used.

SubClass:
  allOf:
    - $ref: '#/components/schemas/BaseClass'

The generated class shows

class SubClass(object):

instead of

class SubClass(BaseClass):

This issue was already posted (#453 (closed)), but it's not solved nor answered.

openapi-generator version

3.1.1

Command line used for generation
java -jar ~/openapi-generator-cli-3.1.1.jar generate -g python -i openapi.json -o generated/python-client
Suggestion

Either do the inheritance correctly (as shown at the beginning), with the right constructors (__init__) or add the Properties of the BaseClass to the SubClass, as in swagger 2.

Assignee
Assign to
Time tracking