definitions:
ObjectType:
type: string
enum:
- dog
- cat
- mouse
- snake
Animal:
type: object
discriminator: object_type
required:
- id
- object_type
properties:
id:
type: integer
format: int64
object_type:
$ref: '#/definitions/ObjectType'
Cat:
allOf:
- $ref: '#/definitions/Animal'
- type: object
discriminator: object_type
required:
- object_type
properties:
object_type:
$ref: '#/definitions/ObjectType'
name:
type: string
Dog:
allOf:
- $ref: '#/definitions/Animal'
- type: object
discriminator: object_type
required:
- object_type
properties:
object_type:
$ref: '#/definitions/ObjectType'
name:
type: string