• Stephane Nicoll's avatar
    Refine validator and MVC validator configuration · 1de2316a
    Stephane Nicoll authored
    This commit ensures that a primary JSR 303 and Spring Validator will be
    exposed if the auto-configuration kicks in. As `LocalValidatorFactoryBean`
    exposes 3 contracts (JSR-303 `Validator` and `ValidatorFactory` as well as
    the `Spring` validator one), this makes sure that those types can be
    injected by type.
    
    `LocalValidatorFactoryBean` exposes 3 contracts and we're only checking
    for the absence of a `javax.validation.Validator` to auto-configure a
    `LocalValidatorFactoryBean`. If no standard JSR validator exists but a
    Spring's `Validator` exists and is primary, we shouldn't flag the
    auto-configured one as `@Primary`. Previous iterations on this feature
    have made sure that we'll auto-configure at most one
    `javax.validation.Validator` so not flagging it `@Primary` is no problem.
    
    This commit also restores and adds tests that validates
    `ValidationAutoConfiguration` will configure a JSR validator even if a
    Spring Validator is present.
    
    This effectively fixes gh-8495 in a different way.
    
    Closes gh-8979
    Closes gh-8976
    1de2316a
Name
Last commit
Last update
.github Loading commit data...
.mvn Loading commit data...
eclipse Loading commit data...
spring-boot Loading commit data...
spring-boot-actuator Loading commit data...
spring-boot-actuator-docs Loading commit data...
spring-boot-autoconfigure Loading commit data...
spring-boot-cli Loading commit data...
spring-boot-dependencies Loading commit data...
spring-boot-deployment-tests Loading commit data...
spring-boot-devtools Loading commit data...
spring-boot-docs Loading commit data...
spring-boot-full-build Loading commit data...
spring-boot-integration-tests Loading commit data...
spring-boot-parent Loading commit data...
spring-boot-samples Loading commit data...
spring-boot-starters Loading commit data...
spring-boot-test Loading commit data...
spring-boot-test-autoconfigure Loading commit data...
spring-boot-tools Loading commit data...
.editorconfig Loading commit data...
.gitignore Loading commit data...
.settings-template.xml Loading commit data...
.travis.yml Loading commit data...
CODE_OF_CONDUCT.adoc Loading commit data...
CONTRIBUTING.adoc Loading commit data...
LICENSE.txt Loading commit data...
README.adoc Loading commit data...
mvnw Loading commit data...
mvnw.cmd Loading commit data...
pom.xml Loading commit data...