Skip to content

Commit b9bb50b

Browse files
also test allOf schemas presented in the reverse order
Nothing in the specification says that allOf subschemas are evaluated in order; if they are evaluated in the reverse order an erroneous implementation could still pass this test.
1 parent ed0b855 commit b9bb50b

File tree

3 files changed

+75
-0
lines changed

3 files changed

+75
-0
lines changed

tests/draft-next/unevaluatedProperties.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -740,6 +740,31 @@
740740
}
741741
]
742742
},
743+
{
744+
"description": "unevaluatedProperties can't see inside cousins (reverse order)",
745+
"schema": {
746+
"$schema": "https://json-schema.org/draft/next/schema",
747+
"allOf": [
748+
{
749+
"unevaluatedProperties": false
750+
},
751+
{
752+
"properties": {
753+
"foo": true
754+
}
755+
}
756+
]
757+
},
758+
"tests": [
759+
{
760+
"description": "always fails",
761+
"data": {
762+
"foo": 1
763+
},
764+
"valid": false
765+
}
766+
]
767+
},
743768
{
744769
"description": "nested unevaluatedProperties, outer false, inner true, properties outside",
745770
"schema": {

tests/draft2019-09/unevaluatedProperties.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -740,6 +740,31 @@
740740
}
741741
]
742742
},
743+
{
744+
"description": "unevaluatedProperties can't see inside cousins (reverse order)",
745+
"schema": {
746+
"$schema": "https://json-schema.org/draft/2019-09/schema",
747+
"allOf": [
748+
{
749+
"unevaluatedProperties": false
750+
},
751+
{
752+
"properties": {
753+
"foo": true
754+
}
755+
}
756+
]
757+
},
758+
"tests": [
759+
{
760+
"description": "always fails",
761+
"data": {
762+
"foo": 1
763+
},
764+
"valid": false
765+
}
766+
]
767+
},
743768
{
744769
"description": "nested unevaluatedProperties, outer false, inner true, properties outside",
745770
"schema": {

tests/draft2020-12/unevaluatedProperties.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -740,6 +740,31 @@
740740
}
741741
]
742742
},
743+
{
744+
"description": "unevaluatedProperties can't see inside cousins (reverse order)",
745+
"schema": {
746+
"$schema": "https://json-schema.org/draft/2020-12/schema",
747+
"allOf": [
748+
{
749+
"unevaluatedProperties": false
750+
},
751+
{
752+
"properties": {
753+
"foo": true
754+
}
755+
}
756+
]
757+
},
758+
"tests": [
759+
{
760+
"description": "always fails",
761+
"data": {
762+
"foo": 1
763+
},
764+
"valid": false
765+
}
766+
]
767+
},
743768
{
744769
"description": "nested unevaluatedProperties, outer false, inner true, properties outside",
745770
"schema": {

0 commit comments

Comments
 (0)