-
Notifications
You must be signed in to change notification settings - Fork 330
Closed
Description
Consider the following schema:
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"V": {
"type": "array",
"items": {
"oneOf": [
{
"type": "object",
"properties": {
"X": {
"type": "string"
}
},
"required": [
"X"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"A": {
"type": "string"
},
"B": {
"type": "string"
},
"C": {
"type": "string"
}
},
"anyOf": [
{
"properties": {
"origin": {
"const": "not-present"
}
},
"required": [
"A",
"C"
]
},
{
"properties": {
"origin": {
"const": "not-present-either"
}
},
"required": [
"A",
"B"
]
}
],
"additionalProperties": false,
"required": [
"A"
],
"not": {
"type": "object",
"required": [
"X"
]
}
}
]
}
}
}
}
This should match the following object:
{
"V": [
{
"A": "foo",
"B": "bar"
}
]
}
but it doesn't. The problem seems to be that the AnyOfValidator doesn't set the setMatchedNode/hasMatchedNode properties correctly.
Metadata
Metadata
Assignees
Labels
No labels