Method validation with @Validated not working [SPR-17369] #21902
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
status: declined
A suggestion or change that we don't feel we should currently apply
blaugold opened SPR-17369 and commented
I would like to use validation groups in my service layer to validate dtos, but am not able to trigger validation exceptions when using
@Validated
on a method parameter.@Valid
works, but to use groups I need@Validated
to work. I have isolated the issue in a reproduction repo which includes these minimal classes:Service.validMethod
throws as expected ifobj
is invalid (for default group constraints), but the methods where@Validated
is used do not seem to validatedobj
at all.I was not able to find any examples where
@Validated
is used in a service, only in controllers, but from the docs I got the impression this should work.Affects: 5.0.9
Reference URL: https://github.com/blaugold/spring-method-validation-issue
The text was updated successfully, but these errors were encountered: