Closed
Description
Hi,
If we have the below schema:
{
"Foo": {
"properties": {
"name": {
"type": "string"
},
"values": {
"oneOf": [
{
"format": "int32",
"type": "integer"
},
{
"type": "string"
},
{
"items": {
"oneOf": [
{
"format": "int32",
"type": "integer"
},
{
"type": "string"
}
]
},
"type": "array"
}
]
}
},
"required": [
"name",
"values"
],
"type": "object"
}
}
and receive a value like this:
{
"name": "bar",
"values": [
"2"
]
}
it breaks the library. The reason is that during the attempt to cast()
the values
field, it iterates over a set of SchemaType
s to try to cast the value, but then there are no schemas in self.items
for values
itself (since it's a oneOf
) when it matches SchemaType.ARRAY
.