json-schema-spec icon indicating copy to clipboard operation
json-schema-spec copied to clipboard

Defines what happens when relative JSON pointer starts with zero

Open Relequestual opened this issue 3 years ago • 7 comments

Resolves #1121

Relequestual avatar Nov 09 '21 14:11 Relequestual

https://tools.ietf.org/id/draft-handrews-relative-json-pointer-00.html#rfc.section.3

The spec already says that relative JSON pointers must start with positive integers.

Maybe we just remove "non-negative".

gregsdennis avatar Nov 09 '21 18:11 gregsdennis

The spec already says that relative JSON pointers must start with positive integers.

Maybe we just remove "non-negative".

It quantifies in the ABNF...

"0", or digits without a leading "0"

This is also shown in the proceeding examples...

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

It's essentially a no-op, but is valid. The use is when apending # to get the key or index of the location.

(FYI latest is https://datatracker.ietf.org/doc/html/draft-bhutton-relative-json-pointer-00)

Relequestual avatar Nov 10 '21 08:11 Relequestual

Then we should either change the section I linked or change the ANBF. They conflict. Personally, I'm happy with either.

(It seems "non-negative" is the current term in the latest.)

gregsdennis avatar Nov 10 '21 09:11 gregsdennis

You do not believe zero is a non-negative integer? We changed the language from "positive" to "non-negative" so as to include zero.

Relequestual avatar Nov 10 '21 11:11 Relequestual

My concern was alignment. I didn't care which it was. Positive and non-negative are both fine as long as the spec is consistent.

gregsdennis avatar Nov 10 '21 19:11 gregsdennis

It is consistent in the current version. You were viewing the previous 😅

Relequestual avatar Nov 10 '21 21:11 Relequestual

As there has been little interest, I'm removing this PR and associated issue from the milestone. It can be added back again should anyone show interest, but it shouldn't be a blocker.

Relequestual avatar Nov 29 '21 14:11 Relequestual