Bean Validation
WebFlux
The position of the @Valid
annotation on reactive types has changed in 2024.2. Until then the @Valid
was placed on the generic type of the reactive wrapper, like this:
@Mapping("/foo-flux")
void postFooFlux(@Parameter Flux<@Valid Bar> body);
Unfortunately validation did not happen. Spring needs the @Valid
annotation on the reactive wrapper to trigger the validation. Therefore @Valid
is placed by default on the reactive wrapper:
@Mapping("/foo-flux")
void postFooFlux(@Parameter @Valid Flux<Bar> body);
To keep the old behaviour see compatibility.