I thought this was actually enforced in the spec since a long time, but it turns out it's not:
If CDI is supported in the container, it would be a benefit for developers if they could rely that an implementation also supports dependency injection in the validator.
I thought this was actually enforced in the spec since a long time, but it turns out it's not:
If CDI is supported in the container, it would be a benefit for developers if they could rely that an implementation also supports dependency injection in the validator.
https://beanvalidation.org/2.0/spec/#integration-dependencyinjection enforces this only that the validator must be injectable itself, but not "inside". Additionally the scope then should be handled by CDI, if a CDI scoped annotation is present.
Example
Most impls IMO do this already, but it turns out not all (e.g. Payara), since it's not enforced in the spec. WDYT?