Skip to content

Report an error when the discriminator property is not defined in 'oneOf' the schema types? #344

@senthilkumarmohan

Description

@senthilkumarmohan

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions