Skip to content

Deep merge for JsonNode using ObjectReader.readTree() #3122

@sirianni

Description

@sirianni

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 existing JsonNode rather than creating a new one.

Usage example

    var mapper = new ObjectMapper();
    var node1 = mapper.readTree("{\"root\":{\"a\":\"aaa\",\"foo\":\"hello\"}}");
    var node2 = mapper.readerForUpdating(node1)
        .readTree("{\"root\":{\"b\":\"bbb\",\"foo\":\"goodbye\"}}");

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 API readerForUpdating()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions