Skip to content

Commit

Permalink
Update upickle, zio to 4.0.0-RC1 (#1743)
Browse files Browse the repository at this point in the history
* Update upickle, zio to 4.0.0-RC1

* Update build.sbt

* fix compilation issues with sttp 4

---------

Co-authored-by: Julien Jean Paul Sirocchi <[email protected]>
  • Loading branch information
scala-steward and sirocchj authored Feb 10, 2025
1 parent 405407a commit dee5074
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ val V = new {
val scala3 = "3.3.5"
val `scala-collection-compat` = "2.13.0"
val slf4j = "2.0.16"
val sttp = "4.0.0-M19"
val upickle = "3.1.4"
val sttp = "4.0.0-RC1"
val upickle = "4.1.0"
val vulcan = "1.11.1"
val `zio-interop` = "23.1.0.3"
val `zio-cache` = "0.2.3"
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/scala/tamer/Registry.scala
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ object Registry {
): Task[Int] =
requestWithAuth(maybeRegistryAuth)
.post(uri"$url/subjects/$subject?normalize=false&deleted=false")
.body(SchemaString(schema.show))
.body(asJson(SchemaString(schema.show)))
.response(asJson[SubjectIdVersionSchemaString])
.send(backend)
.flatMap(response => ZIO.fromEither(response.body.map(_.id)))
Expand All @@ -69,7 +69,7 @@ object Registry {
): Task[Int] =
requestWithAuth(maybeRegistryAuth)
.post(uri"$url/subjects/$subject/versions?normalize=false")
.body(SchemaString(schema.show))
.body(asJson(SchemaString(schema.show)))
.response(asJson[Id])
.send(backend)
.flatMap(response => ZIO.fromEither(response.body.map(_.id)))
Expand Down
5 changes: 3 additions & 2 deletions rest/src/main/scala/tamer/rest/package.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import java.net.http.HttpRequest
import sttp.capabilities.{Effect, WebSockets}
import sttp.capabilities.zio.ZioStreams
import sttp.client4.{BackendOptions, Request, Response}
import sttp.client4.compression.CompressionHandlers
import sttp.client4.httpclient.zio._
import zio.{Ref, Task, TaskLayer}

Expand All @@ -15,9 +16,9 @@ package object rest {
final def restLive(
options: BackendOptions = BackendOptions.Default,
customizeRequest: HttpRequest => HttpRequest = identity,
customEncodingHandler: HttpClientZioBackend.ZioEncodingHandler = PartialFunction.empty
customCompressionHandler: CompressionHandlers[ZioStreams, ZioStreams.BinaryStream] = HttpClientZioBackend.DefaultCompressionHandlers
): TaskLayer[SttpClient with EphemeralSecretCache] =
HttpClientZioBackend
.layer(options, customizeRequest, customEncodingHandler)
.layer(options, customizeRequest, customCompressionHandler)
.mapError(e => TamerError(e.getLocalizedMessage(), e)) ++ EphemeralSecretCache.live
}

0 comments on commit dee5074

Please sign in to comment.