Debian Codegraph @

share/tests/draft2019-09/optional/format/relative-json-pointer.json

raw
1 [
2 {
3 "description": "validation of Relative JSON Pointers (RJP)",
4 "schema": {
5 "$schema": "https://json-schema.org/draft/2019-09/schema",
6 "format": "relative-json-pointer"
7 },
8 "tests": [
9 {
10 "description": "all string formats ignore integers",
11 "data": 12,
12 "valid": true
13 },
14 {
15 "description": "all string formats ignore floats",
16 "data": 13.7,
17 "valid": true
18 },
19 {
20 "description": "all string formats ignore objects",
21 "data": {},
22 "valid": true
23 },
24 {
25 "description": "all string formats ignore arrays",
26 "data": [],
27 "valid": true
28 },
29 {
30 "description": "all string formats ignore booleans",
31 "data": false,
32 "valid": true
33 },
34 {
35 "description": "all string formats ignore nulls",
36 "data": null,
37 "valid": true
38 },
39 {
40 "description": "a valid upwards RJP",
41 "data": "1",
42 "valid": true
43 },
44 {
45 "description": "a valid downwards RJP",
46 "data": "0/foo/bar",
47 "valid": true
48 },
49 {
50 "description": "a valid up and then down RJP, with array index",
51 "data": "2/0/baz/1/zip",
52 "valid": true
53 },
54 {
55 "description": "a valid RJP taking the member or index name",
56 "data": "0#",
57 "valid": true
58 },
59 {
60 "description": "an invalid RJP that is a valid JSON Pointer",
61 "data": "/foo/bar",
62 "valid": false
63 },
64 {
65 "description": "negative prefix",
66 "data": "-1/foo/bar",
67 "valid": false
68 },
69 {
70 "description": "explicit positive prefix",
71 "data": "+1/foo/bar",
72 "valid": false
73 },
74 {
75 "description": "non-ASCII digit in the prefix is not allowed",
76 "data": "١/foo",
77 "valid": false
78 },
79 {
80 "description": "## is not a valid json-pointer",
81 "data": "0##",
82 "valid": false
83 },
84 {
85 "description": "zero cannot be followed by other digits, plus json-pointer",
86 "data": "01/a",
87 "valid": false
88 },
89 {
90 "description": "zero cannot be followed by other digits, plus octothorpe",
91 "data": "01#",
92 "valid": false
93 },
94 {
95 "description": "empty string",
96 "data": "",
97 "valid": false
98 },
99 {
100 "description": "multi-digit integer prefix",
101 "data": "120/foo/bar",
102 "valid": true
103 },
104 {
105 "description": "multi-digit prefix with a zero followed by another digit",
106 "data": "100",
107 "valid": true
108 },
109 {
110 "description": "tilde not followed by 0 or 1 in the json-pointer part",
111 "data": "0/~2",
112 "valid": false
113 },
114 {
115 "description": "unescaped tilde at the end of the json-pointer part",
116 "data": "0/foo/bar~",
117 "valid": false
118 },
119 {
120 "description": "octothorpe followed by a json-pointer",
121 "data": "1#/foo/bar",
122 "valid": false
123 },
124 {
125 "description": "empty reference tokens in the json-pointer part",
126 "data": "0//",
127 "valid": true
128 },
129 {
130 "description": "trailing newline after the non-negative integer",
131 "data": "1\n",
132 "valid": false
133 }
134 ]
135 }
136 ]