Skip to content

Commit

Permalink
Play-JSON Scala 3 support (#2141)
Browse files Browse the repository at this point in the history
  • Loading branch information
markarasev committed Apr 19, 2024
1 parent 86ad70b commit 1fd619b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -933,10 +933,10 @@ lazy val playJson = (projectMatrix in file("json/play-json"))
scalaTest
)
.jvmPlatform(
scalaVersions = scala2,
scalaVersions = scala2 ++ scala3,
settings = commonJvmSettings
)
.jsPlatform(scalaVersions = scala2, settings = commonJsSettings)
.jsPlatform(scalaVersions = scala2 ++ scala3, settings = commonJsSettings)
.dependsOn(core, jsonCommon)

lazy val prometheusBackend = (projectMatrix in file("observability/prometheus-backend"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -152,7 +152,7 @@ class PlayJsonTests extends AnyFlatSpec with Matchers with EitherValues {

def runJsonResponseAs[A](responseAs: ResponseAs[A]): String => A =
responseAs.delegate match {
case responseAs: MappedResponseAs[_, A, Nothing] =>
case responseAs: MappedResponseAs[_, _, _] =>
responseAs.raw match {
case ResponseAsByteArray =>
s => responseAs.g(s.getBytes(Utf8), ResponseMetadata(StatusCode.Ok, "", Nil))
Expand Down

0 comments on commit 1fd619b

Please sign in to comment.