2
我遇到了杰克逊已知的关于“序列化中缺少类型信息”的问题(http://wiki.fasterxml.com/JacksonPolymorphicDeserialization) 我无法理解它。 为什么这个工作正常(类类型设置正确)?序列化后为什么类类型丢失?
@Path("{id}")
@GET
public List<POJO> getPOJO(@PathParam("id") BigInteger id) {
//get some pojoInstances from db
List<POJO> arr = new ArrayList<>(pojoInstances);
return arr;
}
这一个不工作
@Path("{id}")
@GET
public Collection<POJO> getPOJO(@PathParam("id") BigInteger id) {
//get some pojoInstances from db
return new ArrayList<>(pojoInstances);
}