Skip to content

Make JsonNode implicitly create ArrayNodes for repeated XML Elements #403

Closed
@cowtowncoder

Description

@cowtowncoder

(note: requires FasterXML/jackson-databind#2732 to be implemented first)

One of long-standing issues with this module is that JsonNode does not work well with relatively common XML case where there are sequences of elements with same name: this is typically used to present Arrays, for example.
By default JsonNode assumes uniqueness of property names, and this leads to either loss of all but one element (first or last, depending), or exception for duplicate entries.

It should be easy enough to make JsonNodeDeserializer have logic of "auto-converting" value nodes into ArrayNodes, in case of "duplicates", however; and as long as this is guarded with something (for example, new StreamReadCapability.DUPLICATE_PROPERTIES), it should be completely safe and not change regular JSON processing accidentally.

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