Skip to content

Commit 847e46f

Browse files
committed
[359] Add unevaluatedProperties/unevaluatedItems cousin tests
These tests address the case where they're not direct siblings to their associated properties.
1 parent ac63eb7 commit 847e46f

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed

tests/draft2019-09/unevaluatedItems.json

+20
Original file line numberDiff line numberDiff line change
@@ -413,5 +413,25 @@
413413
"valid": false
414414
}
415415
]
416+
},
417+
{
418+
"description": "unevaluatedItems can't see inside cousins",
419+
"schema": {
420+
"allOf": [
421+
{
422+
"items": [ true ]
423+
},
424+
{
425+
"unevaluatedItems": false
426+
}
427+
]
428+
},
429+
"tests": [
430+
{
431+
"description": "always fails",
432+
"data": [ 1 ],
433+
"valid": false
434+
}
435+
]
416436
}
417437
]

tests/draft2019-09/unevaluatedProperties.json

+24
Original file line numberDiff line numberDiff line change
@@ -589,5 +589,29 @@
589589
"valid": false
590590
}
591591
]
592+
},
593+
{
594+
"description": "unevaluatedProperties can't see inside cousins",
595+
"schema": {
596+
"allOf": [
597+
{
598+
"properties": {
599+
"foo": true
600+
}
601+
},
602+
{
603+
"unevaluatedProperties": false
604+
}
605+
]
606+
},
607+
"tests": [
608+
{
609+
"description": "always fails",
610+
"data": {
611+
"foo": 1
612+
},
613+
"valid": false
614+
}
615+
]
592616
}
593617
]

0 commit comments

Comments
 (0)