Skip to content

Relative JSON Pointer specification inconsistency #1175

Open
@omgmashina

Description

@omgmashina

First issue: text part of section 3. Syntax does not describe [index-manipulation] which is present in ABNF.

A Relative JSON Pointer is a Unicode string in UTF-8 encoding (see
RFC 8259, Section 8 [RFC8259]), comprising a non-negative integer,
followed by either a '#' (%x23) character or a JSON Pointer (RFC 6901
[RFC6901]).

relative-json-pointer =  non-negative-integer [index-manipulation] <json-pointer>
relative-json-pointer =/ non-negative-integer "#"
index-manipulation    =  ("+" / "-") non-negative-integer
non-negative-integer      =  %x30 / %x31-39 *( %x30-39 )
        ; "0", or digits without a leading "0"

Second issue: one of examples (0-1#) does not comply with ABNF -- # can't be used together with [index-manipulation].

                   For example, given the JSON document:

                         {
                            "foo": ["bar", "baz"],
                            "highly": {
                               "nested": {
                                  "objects": true
                               }
                            }
                         }

     Starting from the value "baz" (inside "foo"), the following JSON
               strings evaluate to the accompanying values:

                     "0"                         "baz"
                     "1/0"                       "bar"
                     "0-1"                       "bar"
                     "2/highly/nested/objects"   true
                     "0#"                        1
                     "0-1#"                      0
                     "1#"                        "foo"

Is ABNF the ultimate truth? Should I refer to it when implementing Relative JSON Pointers? Or does ABNF require fixes? In any case, I could make a pull request with fixes, if anyone can tell me what exactly needs to be fixed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    In Discussion

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions