Debian Codegraph @

encoding/jsonschema/testdata/external/tests/draft2020-12/optional/format/json-pointer.json

raw
1 [
2 {
3 "description": "validation of JSON-pointers (JSON String Representation)",
4 "schema": {
5 "$schema": "https://json-schema.org/draft/2020-12/schema",
6 "format": "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 JSON-pointer",
41 "data": "/foo/bar~0/baz~1/%a",
42 "valid": true
43 },
44 {
45 "description": "not a valid JSON-pointer (~ not escaped)",
46 "data": "/foo/bar~",
47 "valid": false,
48 "skip": {
49 "v3": "unexpected success",
50 "v3-roundtrip": "unexpected success"
51 }
52 },
53 {
54 "description": "valid JSON-pointer with empty segment",
55 "data": "/foo//bar",
56 "valid": true
57 },
58 {
59 "description": "valid JSON-pointer with the last empty segment",
60 "data": "/foo/bar/",
61 "valid": true
62 },
63 {
64 "description": "valid JSON-pointer as stated in RFC 6901 #1",
65 "data": "",
66 "valid": true
67 },
68 {
69 "description": "valid JSON-pointer as stated in RFC 6901 #2",
70 "data": "/foo",
71 "valid": true
72 },
73 {
74 "description": "valid JSON-pointer as stated in RFC 6901 #3",
75 "data": "/foo/0",
76 "valid": true
77 },
78 {
79 "description": "valid JSON-pointer as stated in RFC 6901 #4",
80 "data": "/",
81 "valid": true
82 },
83 {
84 "description": "valid JSON-pointer as stated in RFC 6901 #5",
85 "data": "/a~1b",
86 "valid": true
87 },
88 {
89 "description": "valid JSON-pointer as stated in RFC 6901 #6",
90 "data": "/c%d",
91 "valid": true
92 },
93 {
94 "description": "valid JSON-pointer as stated in RFC 6901 #7",
95 "data": "/e^f",
96 "valid": true
97 },
98 {
99 "description": "valid JSON-pointer as stated in RFC 6901 #8",
100 "data": "/g|h",
101 "valid": true
102 },
103 {
104 "description": "valid JSON-pointer as stated in RFC 6901 #9",
105 "data": "/i\\j",
106 "valid": true
107 },
108 {
109 "description": "valid JSON-pointer as stated in RFC 6901 #10",
110 "data": "/k\"l",
111 "valid": true
112 },
113 {
114 "description": "valid JSON-pointer as stated in RFC 6901 #11",
115 "data": "/ ",
116 "valid": true
117 },
118 {
119 "description": "valid JSON-pointer as stated in RFC 6901 #12",
120 "data": "/m~0n",
121 "valid": true
122 },
123 {
124 "description": "valid JSON-pointer used adding to the last array position",
125 "data": "/foo/-",
126 "valid": true
127 },
128 {
129 "description": "valid JSON-pointer (- used as object member name)",
130 "data": "/foo/-/bar",
131 "valid": true
132 },
133 {
134 "description": "valid JSON-pointer (multiple escaped characters)",
135 "data": "/~1~0~0~1~1",
136 "valid": true
137 },
138 {
139 "description": "valid JSON-pointer (escaped with fraction part) #1",
140 "data": "/~1.1",
141 "valid": true
142 },
143 {
144 "description": "valid JSON-pointer (escaped with fraction part) #2",
145 "data": "/~0.1",
146 "valid": true
147 },
148 {
149 "description": "not a valid JSON-pointer (URI Fragment Identifier) #1",
150 "data": "#",
151 "valid": false,
152 "skip": {
153 "v3": "unexpected success",
154 "v3-roundtrip": "unexpected success"
155 }
156 },
157 {
158 "description": "not a valid JSON-pointer (URI Fragment Identifier) #2",
159 "data": "#/",
160 "valid": false,
161 "skip": {
162 "v3": "unexpected success",
163 "v3-roundtrip": "unexpected success"
164 }
165 },
166 {
167 "description": "not a valid JSON-pointer (URI Fragment Identifier) #3",
168 "data": "#a",
169 "valid": false,
170 "skip": {
171 "v3": "unexpected success",
172 "v3-roundtrip": "unexpected success"
173 }
174 },
175 {
176 "description": "not a valid JSON-pointer (some escaped, but not all) #1",
177 "data": "/~0~",
178 "valid": false,
179 "skip": {
180 "v3": "unexpected success",
181 "v3-roundtrip": "unexpected success"
182 }
183 },
184 {
185 "description": "not a valid JSON-pointer (some escaped, but not all) #2",
186 "data": "/~0/~",
187 "valid": false,
188 "skip": {
189 "v3": "unexpected success",
190 "v3-roundtrip": "unexpected success"
191 }
192 },
193 {
194 "description": "not a valid JSON-pointer (wrong escape character) #1",
195 "data": "/~2",
196 "valid": false,
197 "skip": {
198 "v3": "unexpected success",
199 "v3-roundtrip": "unexpected success"
200 }
201 },
202 {
203 "description": "not a valid JSON-pointer (wrong escape character) #2",
204 "data": "/~-1",
205 "valid": false,
206 "skip": {
207 "v3": "unexpected success",
208 "v3-roundtrip": "unexpected success"
209 }
210 },
211 {
212 "description": "not a valid JSON-pointer (multiple characters not escaped)",
213 "data": "/~~",
214 "valid": false,
215 "skip": {
216 "v3": "unexpected success",
217 "v3-roundtrip": "unexpected success"
218 }
219 },
220 {
221 "description": "not a valid JSON-pointer (isn't empty nor starts with /) #1",
222 "data": "a",
223 "valid": false,
224 "skip": {
225 "v3": "unexpected success",
226 "v3-roundtrip": "unexpected success"
227 }
228 },
229 {
230 "description": "not a valid JSON-pointer (isn't empty nor starts with /) #2",
231 "data": "0",
232 "valid": false,
233 "skip": {
234 "v3": "unexpected success",
235 "v3-roundtrip": "unexpected success"
236 }
237 },
238 {
239 "description": "not a valid JSON-pointer (isn't empty nor starts with /) #3",
240 "data": "a/a",
241 "valid": false,
242 "skip": {
243 "v3": "unexpected success",
244 "v3-roundtrip": "unexpected success"
245 }
246 }
247 ]
248 }
249 ]