Skip to content

Commit e1e1eec

Browse files
committed
draft-06: format "json-pointer" tests
1 parent 1e2834c commit e1e1eec

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

tests/draft6/optional/format.json

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,5 +198,41 @@
198198
"valid": false
199199
}
200200
]
201+
},
202+
{
203+
"description": "validation of JSON-pointers",
204+
"schema": {"format": "json-pointer"},
205+
"tests": [
206+
{
207+
"description": "a valid JSON-pointer",
208+
"data": "/foo/bar~0/baz~1/%a",
209+
"valid": true
210+
},
211+
{
212+
"description": "empty string is valid",
213+
"data": "",
214+
"valid": true
215+
},
216+
{
217+
"description": "/ is valid",
218+
"data": "/",
219+
"valid": true
220+
},
221+
{
222+
"description": "not a valid JSON-pointer (~ not escaped)",
223+
"data": "/foo/bar~",
224+
"valid": false
225+
},
226+
{
227+
"description": "valid JSON-pointer with empty segment",
228+
"data": "/foo//bar",
229+
"valid": true
230+
},
231+
{
232+
"description": "valid JSON-pointer with the last empty segment",
233+
"data": "/foo/bar/",
234+
"valid": true
235+
}
236+
]
201237
}
202238
]

0 commit comments

Comments
 (0)