-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Deep merge for JsonNode
using ObjectReader.readTree()
#3122
Comments
It should just work, with Jackson 2.12 at least. There is no (and there is unlikely ever to be a way) to select deep/shallow merge as this depends on POJOs in question (or more accurately, deserializers). If |
Thanks @cowtowncoder for the quick reply! I've created a repo https://github.com/sirianni/jsonMerge with a failing unit test. |
What are the semantics for |
Since But actual implementation relies on |
Ah. Quick fix is to use But I am not sure why the difference should matter and will see if that can be fixed. Thanks! |
JsonNode
JsonNode
using ObjectReader.readTree()
Fixed by simply delegating calls to |
Thanks Tatu!! |
@sirianni Would you happen to have a working code example of this deep merge? |
Ah I had a silly mistake, got it now:
|
Is your feature request related to a problem? Please describe.
Describe the solution you'd like
Ability to deep merge two
JsonNode
objects, and/or to deserialize a stream by updating an existingJsonNode
rather than creating a new one.Usage example
Additional context
#584 implies that this capability exists, but it does not appear to be functioning propery for
JsonNode
. There also doesn't seem to be a way to specify shallow or deep merge using the tree APIreaderForUpdating()
The text was updated successfully, but these errors were encountered: