Hi these is my model that inclues some simple field and a set of OrderModel.
public class ActiveRequsetModel {
private Long id;
private String applicatorDescription;
private Customer customer;
private Set<OrderModel> odersModel = new HashSet<>();
}
and this is my method in my controller
@RequestMapping(value = "/register-request", method = RequestMethod.POST, consumes = "application/json")
@ResponseBody
public ResponseEntity<String> registerActiveRequest(@RequestBody ActiveRequsetModel activeRequsetModel){
customerService.registerActiveRequest(activeRequsetModel);
return new ResponseEntity<>("Request registered.", HttpStatus.OK);
}
and this is what I get from client side as you see it includes a applicatorDescription, customer object and a List of orderModel with key ordersModel.
{
"applicatorDescription" : "quick please",
"customer" : {
"id" : 1
},
"ordersModel" :
[
{
"transfereeName" : "Alex",
"address" : "home",
"countOrSize" : 12.5,
"derap" : 4,
"description" : "descriptionnnnn",
"kalite" : {
"id" : 1
},
"product" : {
"id" : 1
}
}
]
}
When I get request spring can bind customer and applicatorDescription, but It can't bind ordersModel. What should I do?