You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
senthilkumarmohan
changed the title
Should we report an error when the discriminator property is not defined in 'oneOf' the schema types?
Report an error when the discriminator property is not defined in 'oneOf' the schema types?
Nov 8, 2018
"... As such, the discriminator field MUST be a required field. There are are two ways to define the value of a discriminator for an inheriting instance."
…r-when-OneOf-schema-doesnt-have-the-discriminator-property
Fix#344
Validate `anyOf` and `oneOf` contains the property specified in the `discriminator`.
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
The text was updated successfully, but these errors were encountered: