Properties need to be combined, as per spec:
Inheritance and Polymorphism - Model Composition
In the example below the ExtendedErrorModel schema includes its own properties and properties inherited from BasicErrorModel:
components:
schemas:
BasicErrorModel:
type: object
required:
- message
- code
properties:
message:
type: string
code:
type: integer
minimum: 100
maximum: 600
ExtendedErrorModel:
allOf: # Combines the BasicErrorModel and the inline model
- $ref: '#/components/schemas/BasicErrorModel'
- type: object
required:
- rootCause
properties:
rootCause:
type: string
Note: current implementation creates a new object as listed under $ref and refers to it in the POJO.
Properties need to be combined, as per spec:
Inheritance and Polymorphism - Model Composition
In the example below the ExtendedErrorModel schema includes its own properties and properties inherited from BasicErrorModel:
Note: current implementation creates a new object as listed under $ref and refers to it in the POJO.