From 63ee11c2275fd47665d56352bdabecb7e11e2b6c Mon Sep 17 00:00:00 2001 From: 47erbot Date: Wed, 3 Mar 2021 05:07:22 +0000 Subject: [PATCH 1/2] Failed Scalafix rule(s) github:http4s/http4s/v0_20?sha=v0.20.11 See https://github.com/http4s/http4s/blob/v0.20.0/docs/src/main/tut/upgrading.md for details --- http/src/main/scala/client/HttpClient.scala | 2 +- http/src/main/scala/server/HttpServer.scala | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/http/src/main/scala/client/HttpClient.scala b/http/src/main/scala/client/HttpClient.scala index 2e7379f..05de319 100644 --- a/http/src/main/scala/client/HttpClient.scala +++ b/http/src/main/scala/client/HttpClient.scala @@ -51,7 +51,7 @@ class HttpClient[F[_]: Effect](c: Client[F], host: String, port: Int) { val request: Request[F] = Request[F](Method.POST, baseUri) - val req = request.withBody(newPerson.asJson) + val req = request.withEntity(newPerson.asJson) c.expect(req) diff --git a/http/src/main/scala/server/HttpServer.scala b/http/src/main/scala/server/HttpServer.scala index c65c73b..27473b7 100644 --- a/http/src/main/scala/server/HttpServer.scala +++ b/http/src/main/scala/server/HttpServer.scala @@ -14,6 +14,7 @@ import org.http4s.dsl.io._ import org.http4s.server.blaze._ import scala.concurrent.ExecutionContext.Implicits.global +import org.http4s.server.blaze.BlazeServerBuilder object HttpServer extends StreamApp[IO] { @@ -23,7 +24,7 @@ object HttpServer extends StreamApp[IO] { ): fs2.Stream[IO, StreamApp.ExitCode] = for { b <- - BlazeBuilder[IO] + BlazeServerBuilder[IO] .bindHttp(HttpConf.port, HttpConf.host) .mountService(httpServices, "/") .serve @@ -32,7 +33,7 @@ object HttpServer extends StreamApp[IO] { ) } yield b - val httpServices = HttpService[IO] { + val httpServices = HttpRoutes.of[IO] { case GET -> Root / "person" => Ok(listPersons) case GET -> Root / "person" / id => Ok(getPerson(PersonId(id))) From 08a7732f6fa0571c410aea9fedd85912231a9928 Mon Sep 17 00:00:00 2001 From: 47erbot Date: Wed, 3 Mar 2021 05:07:23 +0000 Subject: [PATCH 2/2] Update http4s-argonaut, ... to 0.21.20 --- project/ProjectPlugin.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/ProjectPlugin.scala b/project/ProjectPlugin.scala index 5a330c0..f9b099d 100644 --- a/project/ProjectPlugin.scala +++ b/project/ProjectPlugin.scala @@ -13,7 +13,7 @@ object ProjectPlugin extends AutoPlugin { lazy val V = new { lazy val freesRPC = "0.15.1" - lazy val http4s = "0.18.26" + lazy val http4s = "0.21.20" lazy val config = "1.4.1" lazy val logback = "1.2.3" lazy val circe = "0.13.0"