You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 22, 2019. It is now read-only.
Given that stuff is empty, I would expect this to output an empty object. However, it instead outputs:
{"stuff": []}
I have isolated this behavior to JaxbAnnotationIntrospector.findSerializationInclusion. (This is the 2.4.4 version, but this function is currently unmodified on master.) This function receives the default value of NON_EMPTY, but will return NON_NULL as long as the XmlElement annotation is present.
Given that this behavior is unexpected given the configuration, and also conflicts with the JAXB behavior of not serializing the list, I believe this function should return NON_EMPTY instead of NON_NULL if:
XmlElementWrapper is not present. (JAXB would output an empty element with the wrapper's name.)