Unmarshalling

Akka Http parameters

Lorenzo Barasti

parameter('tagId.as[UUID].?)
  • akka.http.scaladsl.unmarshalling.
    PredefinedFromStringUnmarshallers
  • io.circe.Decoder
  • de.heikoseeberger.akkahttpcirce.
    FailFastUnmarshaller
implicit def stringUnmarshaller[A: Decoder]: FromStringUnmarshaller[A] = {
  Unmarshaller.strict[String, A] { str =>
    implicitly[Decoder[A]].decodeJson(Json.fromString(str))
      .fold(throw _, identity)
  }
}

Unmarshalling Akka Http parameters

By Lorenzo Barasti

Unmarshalling Akka Http parameters

Making the best of Akka Http routing DSL

  • 1,492