-
-
Notifications
You must be signed in to change notification settings - Fork 136
Closed
Labels
area/unmarshallingIndicates an issue on unmarshalling area.Indicates an issue on unmarshalling area.kind/enhancement
Description
Please see 3f82148 for a failing testcase.
The docs (https://swagger.io/docs/specification/data-models/oneof-anyof-allof-not/#allof) have examples like
Dog: # "Dog" is a value for the pet_type property (the discriminator value)
allOf: # Combines the main `Pet` schema with `Dog`-specific properties
- $ref: '#/components/schemas/Pet'
- type: object
# all other properties specific to a `Dog`
properties:
bark:
type: boolean
breed:
type: string
enum: [Dingo, Husky, Retriever, Shepherd]
Cat: # "Cat" is a value for the pet_type property (the discriminator value)
allOf: # Combines the main `Pet` schema with `Cat`-specific properties
- $ref: '#/components/schemas/Pet'
- type: object
# all other properties specific to a `Cat`
properties:
hunts:
type: boolean
age:
type: integer
So just a schema with allOf
, no type: object
.
But using such a schema causes some unmarshalling to be skipped, as a date/datetime string would remain a string after spec_validate_body
instead of being parsed.
When type: object
is used, (like the comment in the yaml in the commit) then the test case succeeds.
Metadata
Metadata
Assignees
Labels
area/unmarshallingIndicates an issue on unmarshalling area.Indicates an issue on unmarshalling area.kind/enhancement