spring-boot: User-defined Validator bean should not be used as the `mvcValidator`
Hi,
@Valid Annotations in controller are not working since I upgraded to 1.5.3.
I use them like this:
public String method(@Valid @RequestBody Pojo pojo);
@Data
class Pojo {
@NotBlank
public String name;
}
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 27 (17 by maintainers)
Commits related to this issue
- Hacking Recent `Validator` changes have introduced a soft link between `ValidationAutoConfiguration` and `WebMvcAutoConfiguration` that brings several issues: 1. Any existing Spring `Validator` in t... — committed to snicoll/spring-boot by snicoll 7 years ago
- Revert "Refine validator and MVC validator configuration" This commit reverts c9561f0 and 69a8c0d See gh-8495, gh-8979 — committed to snicoll/spring-boot by snicoll 7 years ago
- Mark auto-configured Validator @Primary This commit ensures that a primary JSR 303 and Spring Validator will be exposed if the auto-configuration kicks in. As `LocalValidatorFactoryBean` exposes 3 co... — committed to snicoll/spring-boot by snicoll 7 years ago
- Revert "Refine validator and MVC validator configuration" This commit reverts c9561f0 and 69a8c0d and effectivly fixes gh-8979 but reintroduces the issue reported in gh-8495. — committed to spring-projects/spring-boot by snicoll 7 years ago
- Refine validator and MVC validator configuration This commit ensures that a primary JSR 303 and Spring Validator will be exposed if the auto-configuration kicks in. As `LocalValidatorFactoryBean` exp... — committed to spring-projects/spring-boot by snicoll 7 years ago
- Revert "Refine validator and MVC validator configuration" This commit reverts c9561f0 and 69a8c0d and effectivly fixes gh-8979 but reintroduces the issue reported in gh-8495. — committed to mbhave/spring-boot by snicoll 7 years ago
- Refine validator and MVC validator configuration This commit ensures that a primary JSR 303 and Spring Validator will be exposed if the auto-configuration kicks in. As `LocalValidatorFactoryBean` exp... — committed to mbhave/spring-boot by snicoll 7 years ago
Sure, https://github.com/jonhkr/spring-validation-sample