According to the current document (5.0.0.RELEASE), Spring Webflux supports validation when working with annotated controllers:
By default, if Bean Validation is present in the classpath - for example. Hibernate Validator, LocalValidatorFactoryBean is registered as a global validator for use with @Valid and Validated on @Controller method arguments.
However, nothing has been said about how to automate it using functional endpoints. In fact, the only example of input processing in the documentation confirms nothing:
public Mono<ServerResponse> createPerson(ServerRequest request) { Mono<Person> person = request.bodyToMono(Person.class); return ServerResponse.ok().build(repository.savePerson(person)); }
Should we do it manually or is there some kind of automatic way to do this?
source share