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

Allow JsonNode auto-convert into ArrayNode if duplicates found (for XML) #2732

Closed
cowtowncoder opened this issue May 20, 2020 · 1 comment
Closed
Milestone

Comments

@cowtowncoder
Copy link
Member

cowtowncoder commented May 20, 2020

(note: follow-up for FasterXML/jackson-dataformat-xml#229)

So, XML presents unique problem for JsonNode support in that there is a possibility of seeing what looks like duplicate properties: this is common in XML since sequences of elements are legal, and do not need to be unique unlike JSON properties.
One consequence of this is that currently (as of 2.11) use of JsonNode with XML is limited.

But it seems relatively simple to allow special mode in which such duplicates would be used to "auto-convert" existing entry for property into ArrayNode (if it isn't already one) to allow better support.

@cowtowncoder
Copy link
Member Author

Actually, I think I got a better idea: by adding StreamReadCapability.DUPLICATE_PROPERTIES (true for XML, false for other formats), it should be possible to simply "make it work" as expected, without JsonNodeConfig.

@cowtowncoder cowtowncoder changed the title New JsonNodeFeature for "convert JsonNode into ArrayNode if duplicates found" (for XML) Allow JsonNode auto-convert into ArrayNode if duplicates found" (for XML) May 21, 2020
@cowtowncoder cowtowncoder added this to the 2.12.0 milestone May 21, 2020
@cowtowncoder cowtowncoder changed the title Allow JsonNode auto-convert into ArrayNode if duplicates found" (for XML) Allow JsonNode auto-convert into ArrayNode if duplicates found (for XML) May 22, 2020
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

1 participant