Draft 2020-12 references Relative JSON Pointer draft-bhutton-00, which permits
an optional +N or -N index-manipulation suffix after the leading
non-negative integer. jsonschema currently applies the older
draft-handrews-01 parser to Draft 2020-12 as well, so valid values such as
0+1/foo are rejected.
Minimal reproduction:
from jsonschema import Draft202012Validator, FormatChecker
schema = {"type": "string", "format": "relative-json-pointer"}
validator = Draft202012Validator(schema, format_checker=FormatChecker())
validator.validate("0+1/foo")
Actual behavior: validation raises FormatError because +1/foo is passed to
the ordinary JSON Pointer parser and does not begin with /.
Expected behavior: Draft 2020-12 accepts valid index-manipulation forms,
including 0+1, 0+1/foo, 1-2/bar, 0-0, and 0-1#. Draft 7 and Draft
2019-09 should continue rejecting the newer syntax.
Specification:
https://json-schema.org/draft/2020-12/relative-json-pointer
Reproduced against current main at
81f7a761cbaca107d3d261c1288155655b98ba08.
Draft 2020-12 references Relative JSON Pointer draft-bhutton-00, which permits
an optional
+Nor-Nindex-manipulation suffix after the leadingnon-negative integer.
jsonschemacurrently applies the olderdraft-handrews-01 parser to Draft 2020-12 as well, so valid values such as
0+1/fooare rejected.Minimal reproduction:
Actual behavior: validation raises
FormatErrorbecause+1/foois passed tothe ordinary JSON Pointer parser and does not begin with
/.Expected behavior: Draft 2020-12 accepts valid index-manipulation forms,
including
0+1,0+1/foo,1-2/bar,0-0, and0-1#. Draft 7 and Draft2019-09 should continue rejecting the newer syntax.
Specification:
https://json-schema.org/draft/2020-12/relative-json-pointer
Reproduced against current
mainat81f7a761cbaca107d3d261c1288155655b98ba08.