-
Notifications
You must be signed in to change notification settings - Fork 41.2k
Smarter @ConfigurationProperties binding for nested namespaces #3445
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
I like the idea of a global validation. It would be a bit hairy to implement though (as anything global is wont to be). |
This enhancement is there for quite a while and there isn't a obvious way to replace it so we're considering removing that feature altogether instead (#12601) rather than keeping it with false promise. Looking at properties unbound on startup and generating a report would be a nice alternative, see #10030 for more details. |
ignoreUnknownFields
on@ConfigurationProperties
is handled locally while it should probably be validated against a given application.Consider the following case:
Then somewhere else in the project we have the following
The binder might fail if we provide a valid property, let's say
foo.bar.name
because when it is processed againstFooProperties
that class does not have such field. In practice, this setup is perfectly OK, that property is valid, it's just that it's managed by a different class.Maybe we should build that knowledge since we have the list
@ConfigurationProperties
annotated POJO for a given app.The text was updated successfully, but these errors were encountered: