一个简单的解决方案是将
@JsonTypeInfo和
@JsonSubTypes配置移至
MixIn,然后仅注册
MixIn进行反序列化。
mapper.getDeserializationConfig().addMixInAnnotations(MyClass.class,MyMixIn.class)

一个简单的解决方案是将
@JsonTypeInfo和
@JsonSubTypes配置移至
MixIn,然后仅注册
MixIn进行反序列化。
mapper.getDeserializationConfig().addMixInAnnotations(MyClass.class,MyMixIn.class)