-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
Hi, you might want to take a simpler approach and create a TypeAdapter generator for TemporalAccessor implementations like so:
https://gist.github.com/baudm/1d403548f63012bc503ed61f7c4f61ca
I was thinking of packaging it as a library but it's too small, thus a gist.
The advantage of this approach is two-fold:
- Extremely small API (just 1 static method)
- Able to pass a custom DateTimeFormatter for serializing/deserializing the TemporalAccessor instance (which means that even if your backend doesn't follow conventions, you can still parse a valid date/time value into its corresponding type (e.g. LocalDate, ZonedDateTime).
feinstein and MyDogTom
Metadata
Metadata
Assignees
Labels
No labels