I am unable to unable to Map to the data .
I am sending the following JSON to map to my List Object
[{
"Student": {
"name": "Ram"
},
"Address": {
"text": "6666 SE 3301"
}
}]
This is Student class
@Data
public class Student {
private String name;
}
This is Address class
@Data
public class Address {
private String text;
}
This is AllDetails class
@Data
public class AllDetails {
private Student student;
private Address text;
}
This is the way i am accepting data
@PostMapping(value = AllDetails)
public @ResponseBody String maptoObj(@RequestBody List<AllDetails> details) throws Exception {
ObjectMapper objectMapper = new ObjectMapper();
objectMapper.configure(MapperFeature.ACCEPT_CASE_INSENSITIVE_PROPERTIES, true);
List<AllDetails> allDet = objectMapper.readValue(details, AllDetails[].class);
return "";
}