From bd8622fac8bd7caaada082ce4d799ae36c3f71b1 Mon Sep 17 00:00:00 2001 From: Marc Karassev Date: Mon, 29 Apr 2024 21:30:55 +0200 Subject: [PATCH] Release Play-JSON Scala 3 support in V3 (#2138) (#2161) --- build.sbt | 6 +++--- .../src/test/scala/sttp/client3/PlayJsonTests.scala | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/build.sbt b/build.sbt index ad3f7f50da..77217d4627 100644 --- a/build.sbt +++ b/build.sbt @@ -128,7 +128,7 @@ val play2JsonVersion: Option[(Long, Long)] => String = { case Some((2, 11)) => "2.7.4" case _ => "2.9.2" } -val playJsonVersion = "3.0.0" +val playJsonVersion = "3.0.2" val catsEffect_3_version = "3.5.1" val fs2_3_version = "3.7.0" @@ -950,10 +950,10 @@ lazy val playJson = (projectMatrix in file("json/play-json")) scalaTest ) .jvmPlatform( - scalaVersions = scala2alive, + scalaVersions = scala2alive ++ scala3, settings = commonJvmSettings ) - .jsPlatform(scalaVersions = scala2alive, settings = commonJsSettings) + .jsPlatform(scalaVersions = scala2alive ++ scala3, settings = commonJsSettings) .dependsOn(core, jsonCommon) lazy val prometheusBackend = (projectMatrix in file("observability/prometheus-backend")) diff --git a/json/play-json/src/test/scala/sttp/client3/PlayJsonTests.scala b/json/play-json/src/test/scala/sttp/client3/PlayJsonTests.scala index 269458eacc..fdb47354c7 100644 --- a/json/play-json/src/test/scala/sttp/client3/PlayJsonTests.scala +++ b/json/play-json/src/test/scala/sttp/client3/PlayJsonTests.scala @@ -79,7 +79,7 @@ class PlayJsonTests extends AnyFlatSpec with Matchers with EitherValues { val encoded = extractBody(basicRequest.body(outer)) val decoded = runJsonResponseAs(asJson[Outer])(encoded) - decoded.right.value shouldBe outer + decoded.value shouldBe outer } it should "set the content type" in { @@ -136,7 +136,7 @@ class PlayJsonTests extends AnyFlatSpec with Matchers with EitherValues { def runJsonResponseAs[A](responseAs: ResponseAs[A, Nothing]): String => A = responseAs match { - case responseAs: MappedResponseAs[_, A, Nothing] => + case responseAs: MappedResponseAs[_, _, _] => responseAs.raw match { case ResponseAsByteArray => s => responseAs.g(s.getBytes(Utf8), ResponseMetadata(StatusCode.Ok, "", Nil))