Affects: 6.1.0-SNAPSHOT
https://github.com/spring-projects/spring-framework/issues/28990 added support for configuring MethodValidationPostProcessor
with a Supplier<Validator>
that would then be used to resolve the Validator
lazily. This laziness appears to have been lost as get()
is called on the Supplier
during afterPropertiesSet()
processing. The problem becomes apparent when upgrading Spring Boot to 6.1.0-SNAPSHOT as methodValidationPostProcessorValidatorDependencyDoesNotTriggerEarlyInitialization
in ValidationAutoConfigurationTests
fails.
The regression can be worked around by reverting https://github.com/spring-projects/spring-boot/commit/639f9808765cc39ccf35d3c49936a611eb7fff95 but it leaves setValidationProvider
without a purpose. We'd also prefer not to have to use a lazy proxy in Boot.