[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.