Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MethodValidationPostProcessor does not work with Mono and Flux method parameters [SPR-16234] #20781

Open
spring-projects-issues opened this issue Nov 26, 2017 · 2 comments
Assignees
Labels
in: core type: enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

@spring-projects-issues spring-projects-issues commented Nov 26, 2017

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

@spring-projects-issues spring-projects-issues added type: enhancement in: web labels Jan 11, 2019
@spring-projects-issues spring-projects-issues added this to the 5.x Backlog milestone Jan 11, 2019
@rstoyanchev
Copy link
Contributor

@rstoyanchev rstoyanchev commented Jan 29, 2019

Note that @Valid is supported in WebFlux in combination with reactive types. This ticket I believe is mainly for MethodValidationPostProcessor and use of method-level Validated.

@rstoyanchev rstoyanchev added in: core and removed in: web labels Jan 29, 2019
@jhoeller jhoeller self-assigned this Jan 30, 2019
@jhoeller jhoeller removed this from the 5.x Backlog milestone Sep 9, 2019
@jhoeller jhoeller added this to the 5.3 M1 milestone Sep 9, 2019
@jhoeller jhoeller removed this from the 5.3 M1 milestone Feb 24, 2020
@jhoeller jhoeller added this to the 5.3 M2 milestone Feb 24, 2020
@jhoeller jhoeller removed this from the 5.3 M2 milestone Jul 3, 2020
@jhoeller jhoeller added this to the 5.x Backlog milestone Jul 3, 2020
@fgolygo
Copy link

@fgolygo fgolygo commented Oct 8, 2020

Any update on that?

@jhoeller jhoeller removed this from the 6.x Backlog milestone Nov 1, 2021
@jhoeller jhoeller added this to the 6.0.x milestone Nov 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core type: enhancement
Projects
None yet
Development

No branches or pull requests

4 participants