config icon indicating copy to clipboard operation
config copied to clipboard

Support ISO 8601 Standard for Duration parsing

Open mabrod opened this issue 4 years ago • 0 comments

I think adding support for ISO 8601 time format would be more robust option to define duration properties either as 1s and PT1S. Currently defining duration with ISO 8601 format fails e.g in Duration test “second” : PT1S with the following exception:

com.typesafe.config.ConfigException$BadValue: Reader: 73: Invalid value at 'second': Could not parse time unit 'S' (try ns, us, ms, s, m, h, d)

Potential solution would be simply to see if attribute might be in ISO 8601 format and delegate to Java JDK Duration.parse(string) to do the heavy lifting, otherwise proceed with the current getDuration implementation. I have forked the project and implemented potential solution as a POC.

mabrod avatar Jul 24 '21 17:07 mabrod