Skip to content
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

Review need for @Autowired on @ConfigurationProperties class's constructor #16186

Closed
wilkinsona opened this issue Mar 10, 2019 · 2 comments
Closed
Labels
type: task A general task

Comments

@wilkinsona
Copy link
Member

The new support for constructor binding of configuration properties has introduced a need for @Autowired on a @ConfigurationProperties class's constructor. I find it a little confusing when the class only has a single constructor as, since Framework 4.3 (I think), @Autowired has not been necessary when the class only has a single constructor. I'd like to see if we can drop the requirement. If we can't, the documentation should be updated to explain why it's needed so that we can reduce the potential confusion as much as possible.

@wilkinsona wilkinsona added the type: task A general task label Mar 10, 2019
@wilkinsona wilkinsona added this to the 2.2.x milestone Mar 10, 2019
@wilkinsona
Copy link
Member Author

We can do this is part of the original issue as it hasn’t been in a release yet.

@wilkinsona wilkinsona removed this from the 2.2.x milestone Mar 10, 2019
@snicoll
Copy link
Member

snicoll commented Mar 10, 2019

There is already a doc issue #16175 - as for the use of autowired this may evolve once we implement classpath scanning that also has a dedicated issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: task A general task
Projects
None yet
Development

No branches or pull requests

2 participants