Forum Discussion

MarcB's avatar
MarcB
Occasional Visitor
2 years ago

Export to python flask

If I use:

 demo_package:
allOf:
- type: object
properties:
unique_id:
type: string
name:
type: string
- type: object
properties:
asset_allocation:
description: Asset Allocations
type: array
items:
$ref: '#/components/schemas/asset_allocation_entry'

 and Export python-flask I get (partial class):

class DemoPackage(Model):
"""NOTE: This class is auto generated by the swagger code generator program.

Do not edit the class manually.
"""
def __init__(self, asset_allocation: List[AssetAllocationEntry]=None):

 However, with:

 demo_package:
allOf:
- type: object
properties:
asset_allocation:
description: Asset Allocations
type: array
items:
$ref: '#/components/schemas/asset_allocation_entry'
- type: object
properties:
unique_id:
type: string
name:
type: string

 I get (again, partial):

class DemoPackage(Model):
"""NOTE: This class is auto generated by the swagger code generator program.

Do not edit the class manually.
"""
def __init__(self, unique_id: str=None, name: str=None): # noqa: E501

I can't seem to get allOf.  Please advise.

 

No RepliesBe the first to reply