These are chat archives for hseeberger/akka-http-json

3rd
Jan 2017
Luke Wyman
@lukewyman
Jan 03 2017 03:30

Seems I'm having a problem getting io.circe.java8.time._ to work. The beginning of my trait that defines the routes goes:

trait InventoryRoutes {
  import Directives._
  import CirceSupport._
  import io.circe.generic.auto._
  import io.circe.java8.time._
  import RequestViews._
  import ResponseMappers._

......

def acceptShipment: Route = {
    post {
      pathPrefix("items" / ItemId / "shipments") { itemId =>
        pathEndOrSingleSlash {
          entity(as[AcceptShipmentView]) { asv =>
            val shipment = AcceptShipment(ItemRef(itemId), ShipmentRef(asv.id, asv.date, asv.count))
            inventoryItems ! shipment
            complete(OK)
          }
        }
      }
    }
  }

My class that I expected to be unmarshalled is:

case class AcceptShipmentView(id: UUID, date: ZonedDateTime, count: Int)

sbt compile complains that it can't find the implicit and the import is grayed out in IntelliJ. No sbt dependency errors at all.

Luke Wyman
@lukewyman
Jan 03 2017 18:06
...and it appears I've somehow magically fixed this bug - not sure how. no issue here.