-
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
Allow @ConstructorBinding to be optional #23216
Comments
Would this mean that my If so, I think that would be a reasonable improvement. |
I don't think we can/should. I remember us having a very lengthy conversation that concluded with the current arrangement. One problem with this approach is that you can't opt-out if you happen to have a single constructor and you don't want it to be used that way (can be surprising for folks having an existing class that uses javabean conventions and a constructor for whatever reason). |
Maybe it's an idea to consolidate Would it work if the constructor only sets some of the properties, but others should still be set by setters? |
@snicoll I remember some discussions, but I couldn't remember exactly why we landed on the current setup.
Ah yes, I remember now. The issue is that you may have a |
Currently
ConfigurationPropertiesBindConstructorProvider
requires that@ConstructorBinding
be used to indicate that a@ConfigurationProperties
instance should use theValueObjectBinder
. I think we could skip the need for this if there is a single constructor with one or more arguments.Somewhat related to #23172
The text was updated successfully, but these errors were encountered: