-
-
Notifications
You must be signed in to change notification settings - Fork 222
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
Make JsonNode
implicitly create ArrayNode
s for repeated XML Elements
#403
Comments
@cowtowncoder I'm facing this issue. Is there any work around for this before 2.12? Please help. |
@cowtowncoder at present it is only recognising last found element if there are not inorder. Do we have any work around for this ? Otherwise I'm unsure what else to do other than switching other parser. Appreciate your help. |
Nope, I don't think this can really be worked around with earlier versions. |
Okay. Thanks for the respinse.for now, I went ahead with JAXB. May be will switch back to Jackson once new version released. 👍 |
I've found a solution for grouping repeated, non-consecutive XML fields into one list using Jackson, but it also uses Lombok.
|
Note: as per this issue, non-consequtive fields ARE supported for special cases of |
(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 intoArrayNode
s, in case of "duplicates", however; and as long as this is guarded with something (for example, newStreamReadCapability.DUPLICATE_PROPERTIES
), it should be completely safe and not change regular JSON processing accidentally.The text was updated successfully, but these errors were encountered: