Skip to content

MethodValidationInterceptor support for Mono and Flux method parameters #20781

Closed
@spring-projects-issues

Description

@spring-projects-issues

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:

  1. Support for Mono and Flux is missing when using MethodValidationPostProcessor
  2. 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

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions