summaryrefslogtreecommitdiff
path: root/json/tests/draft2020-12/unknownKeyword.json
diff options
context:
space:
mode:
Diffstat (limited to 'json/tests/draft2020-12/unknownKeyword.json')
-rw-r--r--json/tests/draft2020-12/unknownKeyword.json57
1 files changed, 57 insertions, 0 deletions
diff --git a/json/tests/draft2020-12/unknownKeyword.json b/json/tests/draft2020-12/unknownKeyword.json
new file mode 100644
index 0000000..28b0c4c
--- /dev/null
+++ b/json/tests/draft2020-12/unknownKeyword.json
@@ -0,0 +1,57 @@
+[
+ {
+ "description": "$id inside an unknown keyword is not a real identifier",
+ "comment": "the implementation must not be confused by an $id in locations we do not know how to parse",
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "$defs": {
+ "id_in_unknown0": {
+ "not": {
+ "array_of_schemas": [
+ {
+ "$id": "https://localhost:1234/draft2020-12/unknownKeyword/my_identifier.json",
+ "type": "null"
+ }
+ ]
+ }
+ },
+ "real_id_in_schema": {
+ "$id": "https://localhost:1234/draft2020-12/unknownKeyword/my_identifier.json",
+ "type": "string"
+ },
+ "id_in_unknown1": {
+ "not": {
+ "object_of_schemas": {
+ "foo": {
+ "$id": "https://localhost:1234/draft2020-12/unknownKeyword/my_identifier.json",
+ "type": "integer"
+ }
+ }
+ }
+ }
+ },
+ "anyOf": [
+ { "$ref": "#/$defs/id_in_unknown0" },
+ { "$ref": "#/$defs/id_in_unknown1" },
+ { "$ref": "https://localhost:1234/draft2020-12/unknownKeyword/my_identifier.json" }
+ ]
+ },
+ "tests": [
+ {
+ "description": "type matches second anyOf, which has a real schema in it",
+ "data": "a string",
+ "valid": true
+ },
+ {
+ "description": "type matches non-schema in first anyOf",
+ "data": null,
+ "valid": false
+ },
+ {
+ "description": "type matches non-schema in third anyOf",
+ "data": 1,
+ "valid": false
+ }
+ ]
+ }
+]