-
-
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
First attribute of list ignored #47
Comments
You are probably right, and I am guessing this behavior may be related to a fix made to allow mapping of special case, where String-value elements had "xml:lang" value (included in 2.1). It should obviously not lead to data loss as here, but perhaps does. Or it may be related to other aspects of optional wrapping of array values (and specifically case where there is no wrapping). |
I can reproduce the issue; adding (failing) unit test. Interestingly, id of second item is handled appropriately, just not the first one. |
Digging in deeper, problem only occurs if wrapper does not have attributes, but the first value has. |
Fixed for 2.2 -- fix itself is simple, so theoretically could backport to 2.1; however, since there could be regression (none of unit test fails, so there shouldn't be, but...), prefer fixing in new minor release. |
The unit test below will reproduce the problem. The general problem is that when the XML is deserialized jackson skips the attributes in the first entry of a list. All subsequent entries have their attributes read, and using an element instead of an attribute will work, but the first item in the list has it's attributes ignored.
I tried stepping through the code a bit, and found that the
JsonParser
tokens seem to go straight from the "wrapper" field to the "a" field without ever stopping at the "id" field. I could be wrong about this though.The text was updated successfully, but these errors were encountered: