-
Notifications
You must be signed in to change notification settings - Fork 41.1k
Parse duration config strings like 1s into kotlin.time.Duration #37562
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
This comment was marked as resolved.
This comment was marked as resolved.
1s
into kotlin.time.Duration
1s
into kotlin.time.Duration
This comment was marked as resolved.
This comment was marked as resolved.
@dpozinen I am currently working on addressing this issue. I'll be submitting a pull request shortly for review |
I'd like to keep this as waiting for triage until we know what's necessary. If it requires further Kotlin code we'll need to consider if the potential benefits justify that complexity. There's also the Framework side of things to consider such as spring-projects/spring-framework#30396. |
@Sap004 please be aware that, unfortunately, there's a good chance that a PR will be declined at this time. Things are moving towards duration parsing being handling in Spring Framework. spring-projects/spring-framework#30396 is tracking that and we may not want to add any more Boot-specific features in this area until that PR's been resolved one way or another. |
1s
into kotlin.time.Duration
We discussed this today as a team and decided that we don't think this is a good idea for us to implement. The fact that our current Since Kotlin has an extension method to convert a |
The best thing about |
@neeme-praks-sympower We're not keen to add any more complexity to the Duration parsing in Spring Boot, but I do think the period parsing is interesting. I've added a comment to spring-projects/spring-framework#30396 (comment) to see if Spring Framework can consider that feature for |
I plan on getting back on the Spring Framework side of things soon, and I'll be only talking from Framework perspective here. Regarding the Kotlin-style parsing, I fear this might be a bit too involved to fully support decimal parts. And without it, the simple style seems enough? I also wonder if the other Kotlin style - the one where multiple components in different units can be combined, separated by a space - would be easier to parse AND more human readable. any opinion on that one ? |
With an
application.yml
like so:and a class property like so:
getting
Spring boot version: 3.1.4
Kotlin: 1.9.20-Beta
The text was updated successfully, but these errors were encountered: