• Phillip Webb's avatar
    Refine validator and MVC validator configuration · c9561f03
    Phillip Webb authored
    Update `ValidationAutoConfiguration` and `WebMvcAutoConfiguration` to
    ensure as much as possible that only a single Validator bean of each
    type is registered.
    
    Validation auto-configuration now does the following:
    - If no validator is found: Registers a `LocalValidatorFactoryBean`
      (providing both Spring and JSR validation)
    - If the user defines a Spring & JSR validator: Backs off
    - If the user defines only a JSR validator: Adapts it to a Spring
      validator (without exposing another JSR implementation)
    
    WebMvcAutoConfiguration auto-configuration has been updated to make
    MVC validation follow common Spring Boot patterns:
    - If not validator beans are found (due to the user excluding
      ValidationAutoConfiguration) a new `mvcValidator` bean will be
      registered.
    - If a single validator bean is found it will be used for MVC
      validation.
    - If multiple validator beans are defined it will either use the one
      named `mvcValidator` or it will register a new `mvcValidator` bean
    
    Any automatically registered `mvcValidator` bean will not implement
    the JSR validator interface.
    
    Finally, it is no longer possible to provide an MVC validator via a
    `WebMvcConfigurer`.
    
    Fixes gh-8495
    c9561f03
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...