ogen icon indicating copy to clipboard operation
ogen copied to clipboard

format: support formatting time.Time as RFC3339Nano

Open anuraaga opened this issue 10 months ago • 2 comments

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.

anuraaga avatar Oct 05 '23 02:10 anuraaga