-
-
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
Deserialization of null
String values in Arrays / Collection
s not working as expected
#584
Comments
Quick note(s):
Having said that, yes, handling of |
null
String values in arrays not working as expectednull
String values in Arrays / Collection
s (and probably Map
s) not working as expected
Thanks for the feedback.
I agree that's working as expected, that is why I went for the |
@mbladel yes good. I did realize it is/was not the main point. Mostly mentioned since at some point I was trying to consider/expose distinction and spent some time thinking about it. |
null
String values in Arrays / Collection
s (and probably Map
s) not working as expectednull
String values in Arrays / Collection
s not working as expected
Environment: Jackson Dataformat XML 2.14.2
We are trying to serialize and deserialize arrays or collections of Strings containing both empty and
null
values.We noticed that
null
s are handled correctly when serializing:<item />
, while empty strings as<item></item>
ToXmlGenerator.Feature.WRITE_NULLS_AS_XSI_NIL
works as expectedWhen parsing this values back
null
elements have become empty (""
) values.We tried:
FromXmlParser.Feature.PROCESS_XSI_NIL
, even though it should be enabled by defaultFromXmlParser.Feature.EMPTY_ELEMENT_AS_NULL
But we still got empty String values as a result.
Testing showed that with simple String attributes inside a class both null and empty values are correctly handled during deserialization, as expected (see also #354).
The behavior of String values inside collections should be aligned to how String attributes inside objects are handled.
Here's an example:
The text was updated successfully, but these errors were encountered: