Jackson JsonMappingException: Can not deserialize instance

前端 未结 4 1642
一个人的身影
一个人的身影 2021-01-12 11:18

I\'m trying to convert my json data to a POJO object using Jackson. Here is the MainActivity and my POJO class code. I\'m basically getting a JsonMappingException error. I h

4条回答
  •  情歌与酒
    2021-01-12 11:36

    Can not deserialize instance of java.util.ArrayList out of START_OBJECT token

    The key words here are ArrayList and START_OBJECT token. You cannot deserialize a single object into an array of objects. Try to make sense of doing that and you'll understand why.

    You can only deserialize an array of JSON objects into an array or collection of POJO's. Note that, whereas a JSON object is delimited by { } braces, an array is delimited by [ ] brackets, with some number of objects inside of it.

提交回复
热议问题