Add support for javax.validation.executable.ValidateOnExecution [SPR-10641] #15269
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
status: bulk-closed
An outdated, unresolved issue that's closed in bulk as part of a cleaning process
Nick Williams opened SPR-10641 and commented
Bean Validation 1.1 added a
@javax.validation.executable.ValidateOnExecution
annotation meant to mark classes or methods whose method executions should be validated. This is in some ways quite synonymous with Spring's@Validated
, but with broader implications.@Validated
is for classes and parameters only.@ValidateOnExecution
applies to packages, classes, methods, and constructors (but not parameters). So, even if I configured theMethodValidationPostProcessor
to look for@ValidateOnExecution
by callingsetValidatedAnnotationType
it wouldn't match cases where the package or method was annotated.Out of the box, if a
MethodValidationPostProcessor
is defined it seems like Spring should enable method validation if any of the following conditions are met:@Validated
or@ValidateOnExecution
@Validated
or@ValidateOnExecution
@Validated
or@ValidateOnExecution
(assuming Spring is responsible for the instantiation of the bean)@Validated
or@ValidateOnExecution
@Validated
(to preserve current functionality)This will necessitate:
@Target
of@Validated
to include packages, constructors, and methodsMethodPostProcessor
to look for both annotations on the package, class, or method instead of just@Validated
on the classAffects: 4.0 M1
Issue Links:
@Validated
should allow ElementType.METHOD target1 votes, 4 watchers
The text was updated successfully, but these errors were encountered: