-
-
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
Serialization of "JacksonXmlElementWrapper"-annotated List with NULL-Value #103
Comments
Thanks -- will try to figure what goes on. |
Fixed: my take is that ideally entry should completely not exist, that is, have: |
you can see it that way, so that the entry should completely not exist ... here just some thoughts about this: the other side, that will decode this xml will not know that the encoded list was an empty list. Sometimes it could be important to differ between those three states:
For example: if i export data, the other side that decodes this data needs to be able to decide if the data should be processed.
But this is some specific use-case i have at the moment ;) |
The way I see it, if input for I am open to discussion for this case, but there is one potential problem with including empty List for null: handling of wrapped vs unwrapped Lists would differ (I think) if null Lists were serialized as empty ones. Although I guess this actually ties to another issue; that of how to express XML null ("nil"). So I think question needs to be in context of that issue -- when using "isNillable" marker, Lists, too, should use that facility. |
I have defined a List of Objects in a POJO:
Normally this Element will be serialized like this if it is not null (this works as expected and is ok):
But if the List is provided as null it will be serialized like this (tested with Jackson 2.3.1):
But correct would be:
I also found a hint in the comments of the jackson-code :-)
See XMLBeanPropertyWriter:
The text was updated successfully, but these errors were encountered: