Jackson JSON library: how to instantiate a class that contains abstract fields

后端 未结 4 699
你的背包
你的背包 2020-11-30 05:20

I want to convert a JSON string into java object, but the class of this object contains abstract fields, which Jackson can\'t instantiate, and doesn\'t produce the object. W

4条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-11-30 06:00

    the problem can solve with the annotation @JsonDeserialize on the abstract class refers to Jackson Exceptions Problems and Solutions https://www.baeldung.com/jackson-exception

提交回复
热议问题