Fix code example for validation on functional endpoints
Closes gh-23020
This commit is contained in:
parent
82d0e49de9
commit
2f8aa368fe
|
|
@ -253,8 +253,8 @@ public class PersonHandler {
|
|||
}
|
||||
|
||||
private void validate(Person person) {
|
||||
Errors errors = new BeanPropertyBindingResult(body, "person");
|
||||
validator.validate(body, errors);
|
||||
Errors errors = new BeanPropertyBindingResult(person, "person");
|
||||
validator.validate(person, errors);
|
||||
if (errors.hasErrors) {
|
||||
throw new ServerWebInputException(errors.toString()); <3>
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue