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 values of "untyped" auto-convert into List if duplicates found (for XML) #2733

Closed
cowtowncoder opened this issue May 22, 2020 · 0 comments
Milestone

Comments

@cowtowncoder
Copy link
Member

(note: similar to #2732, but for Untyped deserialization)
(note: pre-req for FasterXML/jackson-dataformat-xml#205)

With XML there is a problem of how to represent sequences of repeating elements: these are exposed via streaming API as "duplicate" properties. Currently (2.11) Jackson simply replaces existing element (unless duplicate detection enabled, in which case exception may be thrown).
But for just XML it seems better to actually use coercion in which repeating elements are collected under logical List instead.

Detection of case for this handling can be determined using new

DeserializationContext.isEnabled(StreamReadCapability.DUPLICATE_PROPERTIES)

mechanism, which will trigger only for XML currently, but potentially for other formats where similar behavior makes sense, if any.

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