guardrail icon indicating copy to clipboard operation
guardrail copied to clipboard

Circe Encoders and Decoders Duplication

Open calvinbrown085 opened this issue 6 years ago • 2 comments

implicit def decodeInstant: Decoder[Instant] = j8time.decodeInstant.or(decodeLong.map(Instant.ofEpochMilli))

We don't actually need to generate these, these come free if we extend TimeInstances

https://github.com/circe/circe/blob/master/modules/java8/src/main/scala/io/circe/java8/time/TimeInstances.scala#L28

Also I can see this being a potential problem for some people since this requires an extra dep from circe. Just a heads up!

calvinbrown085 avatar Aug 18 '18 16:08 calvinbrown085

Good call! Additionally, I'm realizing the epochMillis conversion should be enabled explicitly instead of assuming the user wants that behavior

blast-hardcheese avatar Aug 18 '18 17:08 blast-hardcheese

Related to #103

blast-hardcheese avatar Oct 02 '18 23:10 blast-hardcheese