mike-burns/aeson — comment on commit 4fbd5b9139d487dd7eb00fe5674e424489a85b7c
File: Data/Aeson/Types/Class.hs line 639
By hvr:

You're right, that's what the spec says... but it's rather unfortunate the spec is type-unsafe in this regard, as it makes it impossible to distinguish a `LocalTime` from a `ZonedTime` defaulting to UTC-offset this way;

I have a few web-service backends written in Python and Haskell with several JSON-RPC services (for which I have written `ToJSON`/`FromJSON` instances similar to yours), for which I require the clients to be specific whether they mean local-time `1995-02-05T12:32` or absolute time `1995-02-05T12:32Z`... and unfortunately many developers don't think much about timezones, so this has caught many misunderstandings early on, by forcing them to be explicit...

I'm a bit undecided here, whether it's better to strictly follow the spec, and accept a weaker JSON "typesystem" w.r.t. to the `LocalTime` vs. `ZonedTime` serialization (converting a `LocalTime` to JSON, and parsing that back as a `ZonedTime` would silently convert it to UTC time, which is one of the bugs I've fought against in the past) vs. ignoring that "absent timezone defaults to `Z`" passage...