ogen
ogen copied to clipboard
format: support formatting time.Time as RFC3339Nano
Description
Currently, date-time
format uses RFC3339
. It would be nice if it were possible to format is RFC3339Nano
, perhaps by adding a custom date-time-nano
format, or adding a generator option. While there is naturally a limit to how many bespoke formats this generator can support, I believe this one is particularly helpful because the default JSON marshaling of Golang for time.Time
is actually RFC3339Nano
, which means that there is some friction in migrating existing codebases to ogen which may be using default JSON marshaling, even via some framework like Gin, and having no way without CustomFormat
to reproduce the same behavior with ogen.