I am trying to build a Java object using fasterxml with the below JSON
JSON : {"name":"Location Test",
"location":{
"coordinates":[10.1234657,10.123467]
},
...
}
I am getting this exception :
play.api.Application$$anon$1: Execution exception[[RuntimeException: com.fasterxml.jackson.databind.JsonMappingException:
Can not deserialize instance of double[] out of START_OBJECT token
at [Source: N/A; line: -1, column: -1] (through reference chain: com.mypackages.models.Place["location"])]]
Place Class :
public class Place{
private String name;
private Location location;
...
getters and setters
}
Location Class :
public class Location{
private double[] coordinates;
public Location(double[] coordinates) {
this.coordinates = coordinates;
}
...
//getter and setter for coordinate field
}
Can someone tell me what is causing the issue?