-
Notifications
You must be signed in to change notification settings - Fork 41.2k
@ConfigurationProperties class's default values are not visible in the Errors instance passed to Validator.validate(Object target, Errors errors) #25356
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Thanks for the report, but I'm not sure what you're trying to do. A |
I've read that documentation and we're actually migrating our code from Spring Boot 2.1.2 to 2.4.3 and, as already said, before this was working fine (and nicer than having a single |
Unfortunately, if your arrangement worked in 2.1.2 then I believe that was by accident rather than design. The documentation for 2.1.2 describes the same approach using a |
How can you have multiple validators then? It seems impossible to me then. |
Sorry, I was mistaken above. I'd forgotten that we'd added support for a The change in behaviour appears to be a side-effect of the fix for #17424.
|
I've just followed the flow from |
Errors
instance passed to Validator.validate(Object target, Errors errors)
Errors
instance passed to Validator.validate(Object target, Errors errors)
Uh oh!
There was an error while loading. Please reload this page.
Spring Boot version: 2.4.3-SNAPSHOT
Hi.
I've a
@ConfigurationProperties
annotated class which implements theValidator
interface to validate some fields, but the method in the subject is never called causing the validation to fail.In particular, I've the following structure:
and
In Spring Boot 2.1.2 the default values specified in the class where used when no value was explicitly configured, but in the specified version the validation actually fails with
The text was updated successfully, but these errors were encountered: