-
-
Notifications
You must be signed in to change notification settings - Fork 221
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
failed to deserialize all interleaved elements for list #165
Comments
Please include Java POJOs included, as well as code. XML structure itself is not enough to know what exactly you are trying to do. Please also note that reading of root-level |
Sorry, I didn't state clearly. The description is updated and it's not the root-level List issue. Actually, I find the second link is replied from you, so it seems you already know this issue. Would you consider to fix it? |
Thank you for the update. The problem here is the |
I think it's a very common use case when editing XML manually by many people. Nobody is willing to take care of tags order. |
It is a limitation by Jackson module. XML allows any sequence of tags, repeating, and so forth. |
I ran into this issue parsing SVG documents. Polygons, paths, and rects are interleaved. Anyone know if there is any jackson solution at this time? |
@pswulius one thing that 2.9 will add in public class Container {
@JsonMerge(OptBoolean.TRUE)
public List<Point> points = new ArrayList<>();
} which would not reset value, so multiple segments would effectively be merged. This assuming that problem is not due to mixed content (that is, no unwrapped text/cdata sections), but due to disjoint sequences of elements with same name. |
Excellent. Thank you for the upcoming feature, and the current workaround. Both are great, and I've confirmed the setPoints(List<> p) workaround. Thank you for pointing that out! |
Since there is a work-around (or two) but no clear path on how to solve this in other ways, will close the issue: should be possible for users to find work-arounds on closed issue. |
POJO:
XML:
It's expected to get two elements 'id1' and 'id2' in bList, but only 'id2' is available after deserialisation.
related links:
The text was updated successfully, but these errors were encountered: