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
fix: recursively check for validity of discriminator
The old implementation was only checking for a single level of validity
of a schema using the discriminator extension, without accounting for
"unions of unions". So, for example:
```json
{
"discriminator": {
"propertyName": "field"
}
"required": ["field"],
"oneOf": [
{
"oneOf": [
{
"properties": {
"field": { "const": "a" }
},
"required": ["field"]
},
{
"properties": {
"field": { "const": "b" }
},
"required": ["field"]
}
],
"required": ["field"]
},
{
"properties": {
"field": { "const": "c" }
},
"required": ["field"]
}
]
}
```
This schema would fail because the compiler would complain about the
first schema in `oneOf` not having the `field` property, which was
defined as the `discriminator`. But it *does* have that property, just
in a subschema inside another `oneOf` definition!
0 commit comments