Skip to content

Commit f58637d

Browse files
committed
Basic relative json pointer tests for format
These cover specific RJP syntax elements but do not cover all of the variations from the JP test suite that would also apply to RJP. More can be added later.
1 parent 1b43ffa commit f58637d

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

tests/draft7/optional/format.json

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,37 @@
465465
}
466466
]
467467
},
468+
{
469+
"description": "validation of Relative JSON Pointers (RJP)",
470+
"schema": {"format": "relative-json-pointer"},
471+
"tests": [
472+
{
473+
"description": "a valid upwards RJP",
474+
"data": "1",
475+
"valid": true
476+
},
477+
{
478+
"description": "a valid downwards RJP",
479+
"data": "foo/bar",
480+
"valid": true
481+
},
482+
{
483+
"description": "a valid up and then down RJP, with array index",
484+
"data": "2/0/baz/1/zip",
485+
"valid": true
486+
},
487+
{
488+
"description": "a valid RJP taking the member or index name",
489+
"data": "0#",
490+
"valid": true
491+
},
492+
{
493+
"description": "an invalid RJP that is a valid JSON Pointer",
494+
"data": "/foo/bar",
495+
"valid": false
496+
}
497+
]
498+
},
468499
{
469500
"description": "validation of JSON-pointers (JSON String Representation)",
470501
"schema": {"format": "json-pointer"},

0 commit comments

Comments
 (0)