Skip to content

~ not followed by 0 or 1 should be an error condition per RFC 6901 #11

@AhmedHanyGamal

Description

@AhmedHanyGamal

After reading RFC 6901 and going through the library code, I noticed a potential gap.

In the beginning of page 2 of the spec, the following is written:
"""
The ABNF syntax of a JSON Pointer is:

      json-pointer    = *( "/" reference-token )
      reference-token = *( unescaped / escaped )
      unescaped       = %x00-2E / %x30-7D / %x7F-10FFFF
         ; %x2F ('/') and %x7E ('~') are excluded from 'unescaped'
      escaped         = "~" ( "0" / "1" )
        ; representing '~' and '/', respectively

It is an error condition if a JSON Pointer value does not conform to
this syntax (see Section 7).

Note that JSON Pointers are specified in characters, not as bytes.
"""

If I'm not mistaken, the spec explicitly states that ~ should only exist if followed by 0 or 1.
It also states that failing to conform to this syntax is an error condition.

Is this something that passed by you while working on the library implementation, or does enforcing this not really matter, or did I misinterpret the spec?

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions