Some things don't unmarshal well
lukewyman opened this issue · comments
Things like joda's DateTime, or java's URI don't unmarshal well with CirceSupport. For example, if I have a case class that has a DateTime field, I get the following error:
could not find implicit value for parameter um: akka.http.scaladsl.unmarshalling.FromRequestUnmarshaller[com.ecommerce.inventory.api.RequestViews.AcknowledgeShipmentView]
(AcknowledgeShipment
has an expectedDate
field of type org.joda.time.DateTime
)
circe has out of the box support for encoding and decoding many standard types and also offers automatic derivation of encoders and decoders for case classes and sealed hierarchies. See https://circe.github.io/circe/codec.html for more details.
If you use non-standard types, you have to provide the encoders and decoders yourself. Luckily the type you mendioned – DateTime
– is supported by circe: just import io.circe.java8.time._
. Ah, wait, just noticed that you are using Joda time instead of the (equivalent) Java 8 time package. So in this case you have to write the encoder and decoder yourself.
Actually, this isn't an issue. Please ask such questions on the Gitter channel.