I know this is very basic, but I have a problem with deserializing json using jackson when the format is like this :
I created a class Person with id, name and place and tried to read the results from API call using jackson (using the @JsonProperty annotation), but when I debug the persons variable is null:
json body:
{ people:[
{
"id":"0",
"name":"Bob",
"place":"Colorado",
},
{
"id":"1",
"name":"John",
"place":"Chicago",
},
{
"id":"2",
"name":"Marry",
"place":"Miami",
}
]}
RequestEntity<Void> reqEntity = RequestEntity.get(new URI(url))
.accept(MediaType.APPLICATION_JSON)
.build();
ResponseEntity<List<Person>> persons = template.exchange(reqEntity, new ParameterizedTypeReference<List<Person>>() {});