JuliaComputing / OpenAPI.jl

OpenAPI helper and code generator for Julia
Other
43 stars 8 forks source link

handle datetimes with more than millisec precision #24

Closed tanmaykm closed 1 year ago

tanmaykm commented 1 year ago

OpenAPI spec seems to suggest that the format should be RFC3339. But we do encounter APIs that send out date-time data with millisecond or nanosecond precision date-time.

The default date time packages in Julia (TimeZones.jl & Dates) do not support parsing sub-millisecond formats. It seems okay (since the specifications mention only rfc3339) to discard some of the precision while parsing such strings.So until there is a good way to handle it, in this PR we change the date-time parsing to discard some precision and not error out with such data. Also added more date-time related tests.