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)
  }
}