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