I have a JSON string that marks empty lists as \"\"
instead of []
. So for example, if I have an object with no children, I\'ll receive a string lik
Couple of options; first, you want to enable `ACCEPT_EMPTY_STRING_AS_NULL_OBJECT':
mapper.enable(DeserializationFeature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT);
so that empty String becomes null. And if you want it to get converted to actual empty List, override setter:
public void setChildren(List<Child> c) {
if (c == null) {
children = Collections.emptyList();
} else {
chidlren = c;
}
}