summaryrefslogtreecommitdiff
path: root/json/tests
diff options
context:
space:
mode:
Diffstat (limited to 'json/tests')
-rw-r--r--json/tests/draft-next/anchor.json21
-rw-r--r--json/tests/draft2019-09/anchor.json22
-rw-r--r--json/tests/draft2020-12/anchor.json22
3 files changed, 65 insertions, 0 deletions
diff --git a/json/tests/draft-next/anchor.json b/json/tests/draft-next/anchor.json
index 4e8987e..f0fcf02 100644
--- a/json/tests/draft-next/anchor.json
+++ b/json/tests/draft-next/anchor.json
@@ -200,5 +200,26 @@
"valid": false
}
]
+ },
+ {
+ "description": "invalid anchors",
+ "schema": { "$ref": "https://json-schema.org/draft/next/schema" },
+ "tests": [
+ {
+ "description": "MUST start with a letter (and not #)",
+ "data": { "$anchor" : "#foo" },
+ "valid": false
+ },
+ {
+ "description": "JSON pointers are not valid",
+ "data": { "$anchor" : "/a/b" },
+ "valid": false
+ },
+ {
+ "description": "invalid with valid beginning",
+ "data": { "$anchor" : "foo#something" },
+ "valid": false
+ }
+ ]
}
]
diff --git a/json/tests/draft2019-09/anchor.json b/json/tests/draft2019-09/anchor.json
index 4e8987e..4143d1f 100644
--- a/json/tests/draft2019-09/anchor.json
+++ b/json/tests/draft2019-09/anchor.json
@@ -200,5 +200,27 @@
"valid": false
}
]
+ },
+ {
+ "description": "invalid anchors",
+ "comment": "Section 8.2.3",
+ "schema": { "$ref": "https://json-schema.org/draft/2019-09/schema" },
+ "tests": [
+ {
+ "description": "MUST start with a letter (and not #)",
+ "data": { "$anchor" : "#foo" },
+ "valid": false
+ },
+ {
+ "description": "JSON pointers are not valid",
+ "data": { "$anchor" : "/a/b" },
+ "valid": false
+ },
+ {
+ "description": "invalid with valid beginning",
+ "data": { "$anchor" : "foo#something" },
+ "valid": false
+ }
+ ]
}
]
diff --git a/json/tests/draft2020-12/anchor.json b/json/tests/draft2020-12/anchor.json
index 4e8987e..17e9080 100644
--- a/json/tests/draft2020-12/anchor.json
+++ b/json/tests/draft2020-12/anchor.json
@@ -200,5 +200,27 @@
"valid": false
}
]
+ },
+ {
+ "description": "invalid anchors",
+ "comment": "Section 8.2.2",
+ "schema": { "$ref": "https://json-schema.org/draft/2020-12/schema" },
+ "tests": [
+ {
+ "description": "MUST start with a letter (and not #)",
+ "data": { "$anchor" : "#foo" },
+ "valid": false
+ },
+ {
+ "description": "JSON pointers are not valid",
+ "data": { "$anchor" : "/a/b" },
+ "valid": false
+ },
+ {
+ "description": "invalid with valid beginning",
+ "data": { "$anchor" : "foo#something" },
+ "valid": false
+ }
+ ]
}
]