summaryrefslogtreecommitdiff
path: root/tests/draft2019-09/unevaluatedProperties.json
diff options
context:
space:
mode:
authorJulian Berman <Julian@GrayVines.com>2021-10-07 09:13:10 -0400
committerJulian Berman <Julian@GrayVines.com>2021-10-07 09:13:10 -0400
commitcf886386cc0996df6743b425f74675a6d8a1a9ca (patch)
tree9bdbb6a0fccd0d20fd6500c77cc0d45315ab63d3 /tests/draft2019-09/unevaluatedProperties.json
parentb5e545b0e0a3a614562293fd7755cd8d2283e8d2 (diff)
downloadjsonschema-cf886386cc0996df6743b425f74675a6d8a1a9ca.tar.gz
Squashed 'json/' changes from 20c1bb1d9..54440eab4
54440eab4 Merge pull request #516 from ChALkeR/chalker/ipv6 e7b22e1c6 Fix the sanity check by pinning. 8891d8107 Merge pull request #519 from json-schema-org/ether/custom-dialect 5f5fccda3 test the format-assertion vocabulary with a custom metaschema 3fcee3868 Merge pull request #512 from json-schema-org/ether/formats-and-non-strings b349b8797 test that format-assertions are valid with non-string types 8e5b2f10d fix needless inconsistencies in format tests between drafts 02d7cb59a Correct "ref with sibling id" tests 1649470ba More ipv6 tests to increase coverage 7334b4c7e Merge pull request #505 from ChALkeR/chalker/fix-unicode 0fb2d2787 Consolidate optional/unicode into optional/ecmascript-regex 4f8c6d7bf unevaluatedProperties: deep dynamic + refs 9103f3b6f $ref wit id does not test what it is indented to do f300dd15f Add test "same $anchor with different base uri" d128f9d7f Add test to check that $id resolved against nearest parent, not just immediate parent 72e31dd20 Merge pull request #515 from json-schema-org/ether/fix-mandatory-format-tests 0173a0835 Revert "by default, "format" only annotates, not validates" 66e813a90 Merge pull request #506 from json-schema-org/ether/formats-non-ascii 9430972bc fix unicode tests in accordance to pattern/patternProperties spec git-subtree-dir: json git-subtree-split: 54440eab4d50b80a62cc9f9c561e306cdbb19591
Diffstat (limited to 'tests/draft2019-09/unevaluatedProperties.json')
-rw-r--r--tests/draft2019-09/unevaluatedProperties.json250
1 files changed, 250 insertions, 0 deletions
diff --git a/tests/draft2019-09/unevaluatedProperties.json b/tests/draft2019-09/unevaluatedProperties.json
index 9f498d0..7cb56bd 100644
--- a/tests/draft2019-09/unevaluatedProperties.json
+++ b/tests/draft2019-09/unevaluatedProperties.json
@@ -1057,5 +1057,255 @@
"valid": true
}
]
+ },
+ {
+ "description": "unevaluatedProperties + single cyclic ref",
+ "schema": {
+ "type": "object",
+ "properties": {
+ "x": { "$ref": "#" }
+ },
+ "unevaluatedProperties": false
+ },
+ "tests": [
+ {
+ "description": "Empty is valid",
+ "data": {},
+ "valid": true
+ },
+ {
+ "description": "Single is valid",
+ "data": { "x": {} },
+ "valid": true
+ },
+ {
+ "description": "Unevaluated on 1st level is invalid",
+ "data": { "x": {}, "y": {} },
+ "valid": false
+ },
+ {
+ "description": "Nested is valid",
+ "data": { "x": { "x": {} } },
+ "valid": true
+ },
+ {
+ "description": "Unevaluated on 2nd level is invalid",
+ "data": { "x": { "x": {}, "y": {} } },
+ "valid": false
+ },
+ {
+ "description": "Deep nested is valid",
+ "data": { "x": { "x": { "x": {} } } },
+ "valid": true
+ },
+ {
+ "description": "Unevaluated on 3rd level is invalid",
+ "data": { "x": { "x": { "x": {}, "y": {} } } },
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "unevaluatedProperties + ref inside allOf / oneOf",
+ "schema": {
+ "$defs": {
+ "one": {
+ "properties": { "a": true }
+ },
+ "two": {
+ "required": ["x"],
+ "properties": { "x": true }
+ }
+ },
+ "allOf": [
+ { "$ref": "#/$defs/one" },
+ { "properties": { "b": true } },
+ {
+ "oneOf": [
+ { "$ref": "#/$defs/two" },
+ {
+ "required": ["y"],
+ "properties": { "y": true }
+ }
+ ]
+ }
+ ],
+ "unevaluatedProperties": false
+ },
+ "tests": [
+ {
+ "description": "Empty is invalid (no x or y)",
+ "data": {},
+ "valid": false
+ },
+ {
+ "description": "a and b are invalid (no x or y)",
+ "data": { "a": 1, "b": 1 },
+ "valid": false
+ },
+ {
+ "description": "x and y are invalid",
+ "data": { "x": 1, "y": 1 },
+ "valid": false
+ },
+ {
+ "description": "a and x are valid",
+ "data": { "a": 1, "x": 1 },
+ "valid": true
+ },
+ {
+ "description": "a and y are valid",
+ "data": { "a": 1, "y": 1 },
+ "valid": true
+ },
+ {
+ "description": "a and b and x are valid",
+ "data": { "a": 1, "b": 1, "x": 1 },
+ "valid": true
+ },
+ {
+ "description": "a and b and y are valid",
+ "data": { "a": 1, "b": 1, "y": 1 },
+ "valid": true
+ },
+ {
+ "description": "a and b and x and y are invalid",
+ "data": { "a": 1, "b": 1, "x": 1, "y": 1 },
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "dynamic evalation inside nested refs",
+ "schema": {
+ "$defs": {
+ "one": {
+ "oneOf": [
+ { "$ref": "#/$defs/two" },
+ { "required": ["b"], "properties": { "b": true } },
+ { "required": ["xx"], "patternProperties": { "x": true } },
+ { "required": ["all"], "unevaluatedProperties": true }
+ ]
+ },
+ "two": {
+ "oneOf": [
+ { "required": ["c"], "properties": { "c": true } },
+ { "required": ["d"], "properties": { "d": true } }
+ ]
+ }
+ },
+ "oneOf": [
+ { "$ref": "#/$defs/one" },
+ { "required": ["a"], "properties": { "a": true } }
+ ],
+ "unevaluatedProperties": false
+ },
+ "tests": [
+ {
+ "description": "Empty is invalid",
+ "data": {},
+ "valid": false
+ },
+ {
+ "description": "a is valid",
+ "data": { "a": 1 },
+ "valid": true
+ },
+ {
+ "description": "b is valid",
+ "data": { "b": 1 },
+ "valid": true
+ },
+ {
+ "description": "c is valid",
+ "data": { "c": 1 },
+ "valid": true
+ },
+ {
+ "description": "d is valid",
+ "data": { "d": 1 },
+ "valid": true
+ },
+ {
+ "description": "a + b is invalid",
+ "data": { "a": 1, "b": 1 },
+ "valid": false
+ },
+ {
+ "description": "a + c is invalid",
+ "data": { "a": 1, "c": 1 },
+ "valid": false
+ },
+ {
+ "description": "a + d is invalid",
+ "data": { "a": 1, "d": 1 },
+ "valid": false
+ },
+ {
+ "description": "b + c is invalid",
+ "data": { "b": 1, "c": 1 },
+ "valid": false
+ },
+ {
+ "description": "b + d is invalid",
+ "data": { "b": 1, "d": 1 },
+ "valid": false
+ },
+ {
+ "description": "c + d is invalid",
+ "data": { "c": 1, "d": 1 },
+ "valid": false
+ },
+ {
+ "description": "xx is valid",
+ "data": { "xx": 1 },
+ "valid": true
+ },
+ {
+ "description": "xx + foox is valid",
+ "data": { "xx": 1, "foox": 1 },
+ "valid": true
+ },
+ {
+ "description": "xx + foo is invalid",
+ "data": { "xx": 1, "foo": 1 },
+ "valid": false
+ },
+ {
+ "description": "xx + a is invalid",
+ "data": { "xx": 1, "a": 1 },
+ "valid": false
+ },
+ {
+ "description": "xx + b is invalid",
+ "data": { "xx": 1, "b": 1 },
+ "valid": false
+ },
+ {
+ "description": "xx + c is invalid",
+ "data": { "xx": 1, "c": 1 },
+ "valid": false
+ },
+ {
+ "description": "xx + d is invalid",
+ "data": { "xx": 1, "d": 1 },
+ "valid": false
+ },
+ {
+ "description": "all is valid",
+ "data": { "all": 1 },
+ "valid": true
+ },
+ {
+ "description": "all + foo is valid",
+ "data": { "all": 1, "foo": 1 },
+ "valid": true
+ },
+ {
+ "description": "all + a is invalid",
+ "data": { "all": 1, "a": 1 },
+ "valid": false
+ }
+ ]
}
]