Skip to content

Commit 2f9d117

Browse files
authored
Merge pull request #616 from json-schema-org/gregsdennis/propertyDependencies-and-unevaluated
add tests for `unevaluatedProperties` seeing inside `propertyDependencies`
2 parents 716b95d + 4794a19 commit 2f9d117

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

tests/draft-next/unevaluatedProperties.json

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1470,5 +1470,46 @@
14701470
"valid": true
14711471
}
14721472
]
1473+
},
1474+
{
1475+
"description": "unevaluatedProperties can see inside propertyDependencies",
1476+
"schema": {
1477+
"$schema": "https://json-schema.org/draft/next/schema",
1478+
"propertyDependencies": {
1479+
"foo": {
1480+
"foo1": {
1481+
"properties": {
1482+
"bar": true
1483+
}
1484+
}
1485+
}
1486+
},
1487+
"unevaluatedProperties": false
1488+
},
1489+
"tests": [
1490+
{
1491+
"description": "allows bar if foo = foo1",
1492+
"data": {
1493+
"foo": "foo1",
1494+
"bar": 42
1495+
},
1496+
"valid": true
1497+
},
1498+
{
1499+
"description": "disallows bar if foo != foo1",
1500+
"data": {
1501+
"foo": "foo2",
1502+
"bar": 42
1503+
},
1504+
"valid": false
1505+
},
1506+
{
1507+
"description": "disallows bar if foo is absent",
1508+
"data": {
1509+
"bar": 42
1510+
},
1511+
"valid": false
1512+
}
1513+
]
14731514
}
14741515
]

0 commit comments

Comments
 (0)