I see issues in parsing below json to java object using jackson api.
Json String
[
[
{
"id": "6555",
"fname": "hello",
"lname": "test"
},
{
"id": "6588",
"fname": "world",
"lname": "test"
}
]
]
I have created below pojos (removed setters and getters).
public class Result {
List<Student> studentList;
}
public class Student{
private String id;
private String fname;
private String lname;
}
ObjectMapper mapper = new ObjectMapper();
List<Result > responseList = mapper.readValue(jsonStr, new TypeReference<List<Result>>(){});
Jackson has throwing exception
com.fasterxml.jackson.databind.JsonMappingException: Can not deserialize instance of out of START_ARRAY token at [Source:
Do I need to any specific jackson annotation to Result object?
