Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Root Pointer should replace existing object #7

Closed
Thihup opened this issue Jan 20, 2021 · 3 comments
Closed

Root Pointer should replace existing object #7

Thihup opened this issue Jan 20, 2021 · 3 comments

Comments

@Thihup
Copy link
Contributor

Thihup commented Jan 20, 2021

Test: https://github.com/eclipse-ee4j/jakartaee-tck/blob/master/src/com/sun/ts/tests/jsonp/api/pointertests/PointerAdd.java#L649

It uses a root pointer to replace the existing object with the array.
It is failing because it throws JsonException: The value must have the same type as the target

@leadpony
Copy link
Owner

@Thihup
I expect you are right, but the Javadoc of JSON-P API states:

If the reference is the target (empty JSON Pointer string), the specified value, which must be the same type as specified target, is returned.
https://www.javadoc.io/static/jakarta.json/jakarta.json-api/2.0.0/jakarta.json/jakarta/json/JsonPointer.html#add(T,jakarta.json.JsonValue)

Therefore my implementation throws a JsonException.
OK, I will modify it.

@Thihup
Copy link
Contributor Author

Thihup commented Jan 21, 2021

Please don't take my word for granted 😉
If you think there is some test that is not correct, you can open a challenge to the JSONP repo.
However, there are some places where the Javadoc is not fully clear, and the TCK provides more information.

(We're writing a Servlet container, Piranha, so we have the same issues to pass the Servlet TCK 😂 )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants