Cannot deserialize value of type java.util.ArrayList<>

 




Hello,

If you are encountering an error as in the title. It is probably due to the singular object coming in the field you defined as List<>. It will be enough to make the following setting for ObjectMapper.



  ObjectMapper objectMapper = new ObjectMapper()
  objectMapper.configure(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY,true);
  
That's it.


Seamless java days

Yorum Gönder

0 Yorumlar