Closed
Description
Sanjaya Kumar Patel opened SPR-16234 and commented
Traditionally (non-reactive), we had been doing method parameter validation as below:
@Validated
@Service
public class FooService
@Validated(SignUpValidation.class)
public void signup(@Valid UserCommand userCommand) {
...
}
In a reactive world, this might look like:
@Validated
@Service
public class FooService
@Validated(SignUpValidation.class)
public Mono<Void> signup(@Valid Mono<UserCommand> userCommand) {
...
}
But this is not working. So, in summary:
- Support for Mono and Flux is missing when using MethodValidationPostProcessor
- Also need support for validation groups (See
@Validated
(SignUpValidation.class) above)
Affects: 5.0.1
Reference URL: https://stackoverflow.com/questions/47244769/how-to-validate-mono-when-using-spring-reactive