I have a Spring controller method that I wanna validate using @Valid and get the BindingResult errorlist. But In my @RequestBody have List list.
@PostMapping(path="/save/inouts")
public ResponseEntity<List<InoutResponse>> saveInouts(@Valid InoutWrapper inouts, BindingResults res){
.....
}
class InoutWrapper {
private List<Inouts> inoutList;
//getters and //setters
}
So I need to get error list as well as each error has the reference to Inout object to make InoutResponse.