Skip to content

[Python] Inheritance doesn't work  #623

@emreakca

Description

@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), 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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions