-
Notifications
You must be signed in to change notification settings - Fork 40.9k
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
Consider deprecating @EnableConfigurationProperties value attribute #23324
Comments
Requiring I'd very much like a user to be able to define a constructor bound properties class without needing the extra annotation. We've investigated this before in #23216. |
Would it be possible to end up with a default implementation where:
|
We'll consider this as part of #23607 |
#23172 has introduced a new
@ImportAsConfigurationPropertiesBean
annotation which now means we have two very similar ways to import configuration properties classes. We might want to consider deprecating thevalue
attribute fromEnableConfigurationProperties
.There's one subtle difference between the two at the moment. If you import a class via
@EnableConfigurationProperties
, it will not use constructor binding unless the class itself has a@ConstructorBinding
annotation. With@ImportAsConfigurationPropertiesBean
, it will attempt to deduce if constructor binding should be used.It's possible that a user may have an
@EnableConfigurationProperties
with a constructor that they expect to be autowired, and with getters/setters that they expect to be bound. The new annotation doesn't currently support this. We might be able to offer an additional attribute to deal with this, e.g.:The text was updated successfully, but these errors were encountered: