Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jawn module for cats-effect 3 #3871

Merged
merged 3 commits into from Nov 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.sbt
Expand Up @@ -28,7 +28,7 @@ lazy val modules: List[ProjectReference] = List(
// jetty,
// tomcat,
// theDsl,
// jawn,
jawn,
// argonaut,
// boopickle,
// circe,
Expand Down
7 changes: 4 additions & 3 deletions jawn/src/main/scala/org/http4s/jawn/JawnInstances.scala
Expand Up @@ -11,10 +11,10 @@ import cats.effect._
import cats.implicits._
import fs2.Stream
import org.typelevel.jawn.{AsyncParser, Facade, ParseException}
import jawnfs2._
import org.typelevel.jawn.fs2._

trait JawnInstances {
def jawnDecoder[F[_]: Sync, J: Facade]: EntityDecoder[F, J] =
def jawnDecoder[F[_]: Concurrent, J: Facade]: EntityDecoder[F, J] =
EntityDecoder.decodeBy(MediaType.application.json)(jawnDecoderImpl[F, J])

protected def jawnParseExceptionMessage: ParseException => DecodeFailure =
Expand All @@ -23,7 +23,8 @@ trait JawnInstances {
JawnInstances.defaultJawnEmptyBodyMessage

// some decoders may reuse it and avoid extra content negotiation
private[http4s] def jawnDecoderImpl[F[_]: Sync, J: Facade](m: Media[F]): DecodeResult[F, J] =
private[http4s] def jawnDecoderImpl[F[_]: Concurrent, J: Facade](
m: Media[F]): DecodeResult[F, J] =
DecodeResult {
m.body.chunks
.parseJson(AsyncParser.SingleValue)
Expand Down
4 changes: 2 additions & 2 deletions project/Http4sPlugin.scala
Expand Up @@ -245,7 +245,7 @@ object Http4sPlugin extends AutoPlugin {
val dropwizardMetrics = "4.1.15"
val fs2 = "3.0.0-M3"
val jawn = "1.0.0"
val jawnFs2 = "1.0.0"
val jawnFs2 = "2.0.0-M2"
val jetty = "9.4.34.v20201102"
val json4s = "3.6.10"
val log4cats = "1.1.1"
Expand Down Expand Up @@ -296,7 +296,7 @@ object Http4sPlugin extends AutoPlugin {
lazy val fs2Io = "co.fs2" %% "fs2-io" % V.fs2
lazy val fs2ReactiveStreams = "co.fs2" %% "fs2-reactive-streams" % V.fs2
lazy val javaxServletApi = "javax.servlet" % "javax.servlet-api" % V.servlet
lazy val jawnFs2 = "org.http4s" %% "jawn-fs2" % V.jawnFs2
lazy val jawnFs2 = "org.typelevel" %% "jawn-fs2" % V.jawnFs2
lazy val jawnJson4s = "org.typelevel" %% "jawn-json4s" % V.jawn
lazy val jawnPlay = "org.typelevel" %% "jawn-play" % V.jawn
lazy val jettyClient = "org.eclipse.jetty" % "jetty-client" % V.jetty
Expand Down