Debian Codegraph @

share/tests/draft7/optional/format/relative-json-pointer.json

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