-
-
Notifications
You must be signed in to change notification settings - Fork 135
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
JsPath.json.put writing to an object in a nested array exception: expected KeyPathNode #82
Comments
After further looking into this, it seems that the JsPath.createObj method does not support IdxPathNode elements in the path. Can someone who knows this code please confirm, and maybe offer a workaround? |
@noisypants You're correct, this is a bug in JsPath.createObj. I believe it needs to be rewritten in order to deal with types other than objects. Currently we expect to be able to use I think the only way to fix this is to update the implementation in createObj to actually do the merging itself rather than attempting to delegate to deepMerge. @cchantep what do you think? |
any progress on this issue? |
any update? |
it is still a thing after 3 years |
I am hitting the same issue |
Any thoughts on how to work around this issue? Even the suggested other libs such as play-json-zipper are no longer being maintained. |
Play JSON Version (2.5.x / etc)
2.5.15
API (Scala / Java / Neither / Both)
Scala (didn't test Java)
Operating System
Window 10
JDK
java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)
Library Dependencies
Expected Behavior
I would expect to use a JsPath.json.update and JsPath.json.put to update a single field within an object within a nested array. (See code below)
Actual Behavior
When attempting to put a new field in a JsObject that's inside an array, a RuntimeException is generated.
The following code throws an exception:
Reproducible Test Case
The text was updated successfully, but these errors were encountered: