You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would go for the simplest one, so RFC3339Nano one, and add a test to ensure that it is correctly parsed in case that there is a breaking change in the future.
Allo !
Currently, when a field has "date-time" as its format, it is parsed using time.RFC3339 (it is used in multiple places):
asyncapi-codegen/pkg/codegen/generators/v2/templates/message.tmpl
Line 58 in 931df74
That constant is defined here:
https://pkg.go.dev/time#pkg-constants
as
RFC3339 = "2006-01-02T15:04:05Z07:00"
According to the specification, the date-time format
https://www.asyncapi.com/docs/reference/specification/v3.0.0#dataTypeFormat
-> https://www.rfc-editor.org/rfc/rfc3339.html#section-5.6
is defined as:
The difference is with the time-secfrac which is not included in that constant.
I see two options to solve that:
RFC3339Nano = "2006-01-02T15:04:05.999999999Z07:00"
RFC3339 = "2006-01-02T15:04:05.9Z07:00"
within generated code to ensure compliancePlease let me know what are your thoughts on this
Thanks,
TheSadlig
The text was updated successfully, but these errors were encountered: