-
Notifications
You must be signed in to change notification settings - Fork 41.1k
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
java.time.Duration properties can't be injected through @Value #13237
Comments
I can understand why you feel that way but it isn't. The purpose of that issue was to upgrade Spring Boot's binding and |
We considered that but the |
Cool, thanks for the explanation. I'll watch #12148 then, I'm happy to close this one if it doesn't make sense on its own. Is there a reason why Spring Boot has its own conversion mechanism and converters? Properties resolution seems something fundamental to me. |
@detouched The |
Ok, I see the picture now. Well, looking forward to the next releases then :) |
Thanks @detouched, we've discussed this today and #12148 is our proposal to support this. |
Introduced in #11078 injection of
java.time.Duration
properties is incomplete. It works for properties injected into a structured object through@ConfigurationProperties
, but it does not work for properties injected through@Value
.E.g. something like this:
fails to start up with an error:
Meanwhile this works just fine:
This looks at least inconsistent and doesn't allow the short syntax.
You can find the full code for both use cases in this repository.
The text was updated successfully, but these errors were encountered: