CustomDeserializer has no default (no arg) constructor

后端 未结 2 2189
無奈伤痛
無奈伤痛 2020-12-14 21:23

I am consuming a REST Api with RestTemplate. The response I\'m getting from the API has lots of nested objects. Here\'s a little snippet as an example:

\"for         


        
2条回答
  •  感情败类
    2020-12-14 21:43

    It is required that you have a default constructor without arguments. What you can do is create one (or replace the other one if you don't really need it):

    public class CustomDeserializer extends StdDeserializer {
    
       public CustomDeserializer() {
           super(Efs.class);
       }
       ...
    }
    

提交回复
热议问题