解决:Jackson反序列化Java内部类失败(序列化后的识别码为LinkedHashMap,而非内部类本身)
warning:
这篇文章距离上次修改已过464天,其中的内容可能已经有所变动。


jaskon识别错误
解决方案:实体类添加
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "mytype", include = JsonTypeInfo.As.PROPERTY)
@JsonSubTypes({ //设置对应子类的识别码值
@JsonSubTypes.Type(value = LinkedHashMap.class, name = "ipsEntity"),
@JsonSubTypes.Type(value = CmsReaderPermissions.IpsEntity.class, name = "ipsEntity")
})