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

Wrong operation order in patch when updating arrays #9

Open
glassfishrobot opened this issue Oct 3, 2017 · 1 comment
Open

Wrong operation order in patch when updating arrays #9

glassfishrobot opened this issue Oct 3, 2017 · 1 comment
Assignees

Comments

@glassfishrobot
Copy link

Hello,

Generating a patch from two JSON-files, where the target extends an array of the source, yields an array of operations on the extended array in reverse. A subsequent application of the patch to the source then produces an exception:

javax.json.JsonException: An array item index is out of range. Index: 3, Size: 1
at org.glassfish.json.NodeReference$ArrayReference.add(NodeReference.java:282)
at org.glassfish.json.NodeReference$ArrayReference.add(NodeReference.java:248)
at org.glassfish.json.JsonPointerImpl.execute(JsonPointerImpl.java:234)
at org.glassfish.json.JsonPointerImpl.add(JsonPointerImpl.java:190)
at org.glassfish.json.JsonPatchImpl.apply(JsonPatchImpl.java:169)
at org.glassfish.json.JsonPatchImpl.apply(JsonPatchImpl.java:136)
at Patch.main(Patch.java:20)

With the attached files you can reproduce this.

Best regards,

Werner.

test.zip

@glassfishrobot
Copy link
Author

ExE-Boss referenced this issue in EB-Forks/jsonp Apr 2, 2018
ExE-Boss referenced this issue in EB-Forks/jsonp Apr 2, 2018
ExE-Boss referenced this issue in EB-Forks/jsonp Apr 2, 2018
This reverts commit df8105c, reversing
changes made to 4474200.
@lukasj lukasj transferred this issue from jakartaee/jsonp-api Jun 8, 2021
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