-
-
Notifications
You must be signed in to change notification settings - Fork 234
Closed
Milestone
Description
I am using jackson-dataformat-xml:2.6.2
If an empty tag is available in the xml and the respective field in the object is a string, it would be nice to have jackson populate the field with empty string rather than with null value.
Ex:
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(
name = "",
propOrder = {"first", "last"}
)
@XmlRootElement(
name = "name"
)
public class Name {
private String first;
private String last;
}
xml:
<name>
<first>Ryan</first>
<last></last>
</name>
mapper creation:
new XmlMapper(XMLInputFactory2.newFactory(), XMLOutputFactory2.newFactory());
I would expect
Name name = mapper.readValue(xml, Name.class)
name.getLast().equals("") to return true but name.getLast() ends up being null.
Any help would be appreciated.
Metadata
Metadata
Assignees
Labels
No labels