summaryrefslogtreecommitdiff
path: root/json/tests/draft7/optional/format/relative-json-pointer.json
diff options
context:
space:
mode:
Diffstat (limited to 'json/tests/draft7/optional/format/relative-json-pointer.json')
-rw-r--r--json/tests/draft7/optional/format/relative-json-pointer.json83
1 files changed, 83 insertions, 0 deletions
diff --git a/json/tests/draft7/optional/format/relative-json-pointer.json b/json/tests/draft7/optional/format/relative-json-pointer.json
new file mode 100644
index 0000000..9309986
--- /dev/null
+++ b/json/tests/draft7/optional/format/relative-json-pointer.json
@@ -0,0 +1,83 @@
+[
+ {
+ "description": "validation of Relative JSON Pointers (RJP)",
+ "schema": { "format": "relative-json-pointer" },
+ "tests": [
+ {
+ "description": "all string formats ignore integers",
+ "data": 12,
+ "valid": true
+ },
+ {
+ "description": "all string formats ignore floats",
+ "data": 13.7,
+ "valid": true
+ },
+ {
+ "description": "all string formats ignore objects",
+ "data": {},
+ "valid": true
+ },
+ {
+ "description": "all string formats ignore arrays",
+ "data": [],
+ "valid": true
+ },
+ {
+ "description": "all string formats ignore booleans",
+ "data": false,
+ "valid": true
+ },
+ {
+ "description": "all string formats ignore nulls",
+ "data": null,
+ "valid": true
+ },
+ {
+ "description": "a valid upwards RJP",
+ "data": "1",
+ "valid": true
+ },
+ {
+ "description": "a valid downwards RJP",
+ "data": "0/foo/bar",
+ "valid": true
+ },
+ {
+ "description": "a valid up and then down RJP, with array index",
+ "data": "2/0/baz/1/zip",
+ "valid": true
+ },
+ {
+ "description": "a valid RJP taking the member or index name",
+ "data": "0#",
+ "valid": true
+ },
+ {
+ "description": "an invalid RJP that is a valid JSON Pointer",
+ "data": "/foo/bar",
+ "valid": false
+ },
+ {
+ "description": "negative prefix",
+ "data": "-1/foo/bar",
+ "valid": false
+ },
+ {
+ "description": "## is not a valid json-pointer",
+ "data": "0##",
+ "valid": false
+ },
+ {
+ "description": "zero cannot be followed by other digits, plus json-pointer",
+ "data": "01/a",
+ "valid": false
+ },
+ {
+ "description": "zero cannot be followed by other digits, plus octothorpe",
+ "data": "01#",
+ "valid": false
+ }
+ ]
+ }
+]