Open anuraaga opened 11 months ago
Could anyone please have a look at that?
Updating ogen after a while and realized that CustomFormat
support was removed in #1090. It's too bad since it seemed like a useful feature in certain situations, but specifically for this now it seems there may be no way to reproduce the standard library marshaling of time.Time
with ogen. The format
idea seems nice too, would it be a reasonable feature to add?
Description
Currently,
date-time
format usesRFC3339
. It would be nice if it were possible to format isRFC3339Nano
, perhaps by adding a customdate-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 fortime.Time
is actuallyRFC3339Nano
, 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 withoutCustomFormat
to reproduce the same behavior with ogen.