diff options
Diffstat (limited to 'json/tests/draft2020-12/dependentSchemas.json')
-rw-r--r-- | json/tests/draft2020-12/dependentSchemas.json | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/json/tests/draft2020-12/dependentSchemas.json b/json/tests/draft2020-12/dependentSchemas.json index bf7aa53..66ac0eb 100644 --- a/json/tests/draft2020-12/dependentSchemas.json +++ b/json/tests/draft2020-12/dependentSchemas.json @@ -128,5 +128,43 @@ "valid": false } ] + }, + { + "description": "dependent subschema incompatible with root", + "schema": { + "properties": { + "foo": {} + }, + "dependentSchemas": { + "foo": { + "properties": { + "bar": {} + }, + "additionalProperties": false + } + } + }, + "tests": [ + { + "description": "matches root", + "data": {"foo": 1}, + "valid": false + }, + { + "description": "matches dependency", + "data": {"bar": 1}, + "valid": true + }, + { + "description": "matches both", + "data": {"foo": 1, "bar": 2}, + "valid": false + }, + { + "description": "no dependency", + "data": {"baz": 1}, + "valid": true + } + ] } ] |