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

Add scala3 support for spray json #2181

Merged
merged 2 commits into from
May 20, 2024
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -897,7 +897,7 @@ lazy val sprayJson = (projectMatrix in file("json/spray-json"))
),
scalaTest
)
.jvmPlatform(scalaVersions = scala2)
.jvmPlatform(scalaVersions = scala2 ++ scala3)
.dependsOn(core, jsonCommon)

lazy val play29Json = (projectMatrix in file("json/play29-json"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,21 @@ package sttp.client4

import org.scalatest.EitherValues
import spray.json.DefaultJsonProtocol._
import spray.json.DefaultJsonProtocol.RootJsObjectFormat
import spray.json.JsonParser.ParsingException
import spray.json.{DeserializationException => _, _}
import sttp.client4.SprayJsonTests._
import sttp.client4.internal.Utf8
import sttp.client4.sprayJson._
import sttp.client4.sprayJson.{sprayBodySerializer, _}
import sttp.model._
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers

class SprayJsonTests extends AnyFlatSpec with Matchers with EitherValues {
behavior of "The spray-json module"

implicit private val jsObjectSerializer: BodySerializer[JsObject] = sprayBodySerializer(RootJsObjectFormat)

it should "encode arbitrary json bodies" in {
val body = Outer(Inner(42, true, "horses"), "cats")

Expand Down
Loading