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
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: booleanbreed:
type: stringenum: [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: booleanage:
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.
The text was updated successfully, but these errors were encountered:
Wim-De-Clercq
changed the title
Unmarshalling not working propery when the root does not have type: object
Unmarshalling not working properly when the root does not have type: objectAug 29, 2022
Unmarshalling mechanism is very simple for now. It determines the type based on top level schema (no allof, anyfo, oneof are taken under consideration)
Uh oh!
There was an error while loading. Please reload this page.
Please see 3f82148 for a failing testcase.
The docs (https://swagger.io/docs/specification/data-models/oneof-anyof-allof-not/#allof) have examples like
So just a schema with
allOf
, notype: 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.The text was updated successfully, but these errors were encountered: