几个选择;首先,您要启用`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; }}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)