summaryrefslogtreecommitdiff
path: root/json/tests/draft2020-12/optional/format/json-pointer.json
blob: 65c2f064f082fa0b537d2b5534e63ff59c5df8b7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
[
    {
        "description": "validation of JSON-pointers (JSON String Representation)",
        "schema": {"format": "json-pointer"},
        "tests": [
            {
                "description": "a valid JSON-pointer",
                "data": "/foo/bar~0/baz~1/%a",
                "valid": true
            },
            {
                "description": "not a valid JSON-pointer (~ not escaped)",
                "data": "/foo/bar~",
                "valid": false
            },
            {
                "description": "valid JSON-pointer with empty segment",
                "data": "/foo//bar",
                "valid": true
            },
            {
                "description": "valid JSON-pointer with the last empty segment",
                "data": "/foo/bar/",
                "valid": true
            },
            {
                "description": "valid JSON-pointer as stated in RFC 6901 #1",
                "data": "",
                "valid": true
            },
            {
                "description": "valid JSON-pointer as stated in RFC 6901 #2",
                "data": "/foo",
                "valid": true
            },
            {
                "description": "valid JSON-pointer as stated in RFC 6901 #3",
                "data": "/foo/0",
                "valid": true
            },
            {
                "description": "valid JSON-pointer as stated in RFC 6901 #4",
                "data": "/",
                "valid": true
            },
            {
                "description": "valid JSON-pointer as stated in RFC 6901 #5",
                "data": "/a~1b",
                "valid": true
            },
            {
                "description": "valid JSON-pointer as stated in RFC 6901 #6",
                "data": "/c%d",
                "valid": true
            },
            {
                "description": "valid JSON-pointer as stated in RFC 6901 #7",
                "data": "/e^f",
                "valid": true
            },
            {
                "description": "valid JSON-pointer as stated in RFC 6901 #8",
                "data": "/g|h",
                "valid": true
            },
            {
                "description": "valid JSON-pointer as stated in RFC 6901 #9",
                "data": "/i\\j",
                "valid": true
            },
            {
                "description": "valid JSON-pointer as stated in RFC 6901 #10",
                "data": "/k\"l",
                "valid": true
            },
            {
                "description": "valid JSON-pointer as stated in RFC 6901 #11",
                "data": "/ ",
                "valid": true
            },
            {
                "description": "valid JSON-pointer as stated in RFC 6901 #12",
                "data": "/m~0n",
                "valid": true
            },
            {
                "description": "valid JSON-pointer used adding to the last array position",
                "data": "/foo/-",
                "valid": true
            },
            {
                "description": "valid JSON-pointer (- used as object member name)",
                "data": "/foo/-/bar",
                "valid": true
            },
            {
                "description": "valid JSON-pointer (multiple escaped characters)",
                "data": "/~1~0~0~1~1",
                "valid": true
            },
            {
                "description": "valid JSON-pointer (escaped with fraction part) #1",
                "data": "/~1.1",
                "valid": true
            },
            {
                "description": "valid JSON-pointer (escaped with fraction part) #2",
                "data": "/~0.1",
                "valid": true
            },
            {
                "description": "not a valid JSON-pointer (URI Fragment Identifier) #1",
                "data": "#",
                "valid": false
            },
            {
                "description": "not a valid JSON-pointer (URI Fragment Identifier) #2",
                "data": "#/",
                "valid": false
            },
            {
                "description": "not a valid JSON-pointer (URI Fragment Identifier) #3",
                "data": "#a",
                "valid": false
            },
            {
                "description": "not a valid JSON-pointer (some escaped, but not all) #1",
                "data": "/~0~",
                "valid": false
            },
            {
                "description": "not a valid JSON-pointer (some escaped, but not all) #2",
                "data": "/~0/~",
                "valid": false
            },
            {
                "description": "not a valid JSON-pointer (wrong escape character) #1",
                "data": "/~2",
                "valid": false
            },
            {
                "description": "not a valid JSON-pointer (wrong escape character) #2",
                "data": "/~-1",
                "valid": false
            },
            {
                "description": "not a valid JSON-pointer (multiple characters not escaped)",
                "data": "/~~",
                "valid": false
            },
            {
                "description": "not a valid JSON-pointer (isn't empty nor starts with /) #1",
                "data": "a",
                "valid": false
            },
            {
                "description": "not a valid JSON-pointer (isn't empty nor starts with /) #2",
                "data": "0",
                "valid": false
            },
            {
                "description": "not a valid JSON-pointer (isn't empty nor starts with /) #3",
                "data": "a/a",
                "valid": false
            }
        ]
    }
]