Skip to content

Commit

Permalink
Only allow non-zero index adjustmetns
Browse files Browse the repository at this point in the history
The current draft allows for an index adjustment of "0" which
creates ambiguity because "1/foo", "1+0/foo", and "1-0/foo"
are now three different ways to write a pointer with the exact
same effect.

This complicates round-trips between textual and functional
representations, the original text would need to be preserved
in order to re-constitute it correctly.  There is no need for
this added complication.
  • Loading branch information
handrews committed Feb 20, 2023
1 parent c54b3de commit 64e047f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions relative-json-pointer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,10 @@
; json-pointer from RFC 6901
origin-specification = non-negative-integer [ index-manipulation ]
index-manipulation = ( "+" / "-" ) non-negative-integer
non-negative-integer = "0" / %x31-39 *DIGIT
; zero, or digits without a leading zero
index-manipulation = ( "+" / "-" ) positive-integer
non-negative-integer = "0" / positive-integer
positive-integer = %x31-39 *DIGIT
; digits without a leading zero
]]></sourcecode>
</section>

Expand Down

0 comments on commit 64e047f

Please sign in to comment.