Skip to content

Commit

Permalink
Port to akka-streams 1.0-M4
Browse files Browse the repository at this point in the history
  • Loading branch information
vikraman committed Mar 8, 2015
1 parent f22ad04 commit 74168c0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ scalacOptions in ThisBuild := Seq(

libraryDependencies ++= {
val akkaV = "2.3.9"
val akkaStreamV = "1.0-M3"
val akkaStreamV = "1.0-M4"
val argonautV = "6.1-M5"
val scalaTestV = "2.2.1"
Seq(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@ import akka.http.model.{ ContentTypes, HttpCharsets }
import akka.http.model.MediaTypes.`application/json`
import akka.http.marshalling.{ ToEntityMarshaller, Marshaller }
import akka.http.unmarshalling.{ FromEntityUnmarshaller, Unmarshaller }
import akka.stream.FlowMaterializer
import akka.stream.ActorFlowMaterializer

import scala.concurrent.ExecutionContext
import scala.language.implicitConversions

trait ArgonautSupport {

implicit def argonautUnmarshallerConverter[T](e: DecodeJson[T])(implicit ec: ExecutionContext, mat: FlowMaterializer): FromEntityUnmarshaller[T] =
implicit def argonautUnmarshallerConverter[T](e: DecodeJson[T])(implicit ec: ExecutionContext, mat: ActorFlowMaterializer): FromEntityUnmarshaller[T] =
argonautUnmarshaller(e, ec, mat)

implicit def argonautUnmarshaller[T](implicit e: DecodeJson[T], ec: ExecutionContext, mat: FlowMaterializer): FromEntityUnmarshaller[T] =
implicit def argonautUnmarshaller[T](implicit e: DecodeJson[T], ec: ExecutionContext, mat: ActorFlowMaterializer): FromEntityUnmarshaller[T] =
argonautJsonUnmarshaller.map(e.decodeJson(_).toDisjunction)

implicit def argonautJsonUnmarshaller(implicit ec: ExecutionContext, mat: FlowMaterializer): FromEntityUnmarshaller[Json] =
implicit def argonautJsonUnmarshaller(implicit ec: ExecutionContext, mat: ActorFlowMaterializer): FromEntityUnmarshaller[Json] =
Unmarshaller.byteStringUnmarshaller.forContentTypes(`application/json`).mapWithCharset { (data, charset)
val input =
if (charset == HttpCharsets.`UTF-8`) data.utf8String
Expand Down

0 comments on commit 74168c0

Please sign in to comment.