Should we report an error when the discriminator property is not defined in 'oneOf' the schema types? in the below example, pet2 doesn't have the expected discriminator property.
responses:
'200':
description: pet response
content:
application/json:
schema:
oneOf:
- "$ref": '#/components/schemas/pet1'
- "$ref": '#/components/schemas/pet2'
discriminator:
propertyName: petType
components:
schemas:
pet1:
type: object
required:
- id
properties:
id:
type: integer
format: int64
petType:
type: string
pet2:
type: object
required:
- id
properties:
id:
type: integer
format: int64