Closed venera-program closed 1 year ago
Hi @venera-program Thanks for submitting this PR. Isn't the time.Parse() enough? It can handle RFC-3339 / ISO-8601 date-time as well.
@spolti How would we determine the correct layout
to use in time.Parse(layout, value string)
? Serverless spec does not define a specific format other than "ISO 8601 format" for this field. Additionally, there is no field for specifying a layout for ValidUntil
; therefore we should probably aim to support as many layout variations as we can allow. Using time.Parse
does not sufficiently fill that role.
What this PR does / why we need it: The parsing method currently used for validating
Cron.ValidUntil
tries to convert the given value to ISO8601 Duration when it should be parsing for Datetime.You can see this in the 0.8 spec's example definition found here: https://github.com/serverlessworkflow/specification/blob/0.8.x/specification.md#cron-definition
Special notes for reviewers: If there is a preference for a different ISO8601 timestamp parser library over github.com/relvacode/iso8601 I am welcome to any suggestions.