Hi,

I was working to pass the TCK with Johnzon, but I have failures around the
usage of "/-" in arrays.

>From JSON Pointer RCF https://tools.ietf.org/html/rfc6901

> If the currently referenced value is a JSON array, the reference
>       token MUST contain either:
>
>       *  characters comprised of digits (see ABNF below; note that
>          leading zeros are not allowed) that represent an unsigned
>          base-10 integer value, making the new referenced value the
>          array element with the zero-based index identified by the
>          token, or
>
>       *  exactly the single character "-", making the new referenced
>          value the (nonexistent) member after the last array element.
>
>
And then

> Note that the use of the "-" character to index an array will always
>    result in such an error condition because by definition it refers to
>    a nonexistent array element.  Thus, applications of JSON Pointer need
>    to specify how that character is to be handled, if it is to be
>    useful.
>
>
When I opened https://issues.apache.org/jira/browse/JOHNZON-325
I first fixed with
https://github.com/apache/johnzon/pull/68/commits/3ef4fb80bdaf6010d4ad66c481675b70bc1e4bca

And we were 100% JSONP compliant but as you can see in the commit, I had
to @Ignore some junit tests because they did not make sense.

After talking with Romain, he mentioned some improvements to attempt to be
backward compatible and still support the previous behavior.
See commit
https://github.com/apache/johnzon/pull/68/commits/2626806f82b076ada11800221c8458da8ec53794

But unfortunately this is breaking the spec and the TCK.
My understanding of JSON Pointer and as per the 2 quotes in this email, I
think using /- for anything but ADD does not make sense and must fail (and
this is what the spec is testing).
JSON Path relies on JSON Pointer and therefore should not go against.

So I think I should let the first fix I got in even if it breaks some edge
cases.

What do you think?

Copying TomEE mailing list because it's breaking JSONP there too.


--
Jean-Louis Monteiro
http://twitter.com/jlouismonteiro
http://www.tomitribe.com

Reply via email to