Skip to content

Commit

Permalink
Merge pull request #824 from scala-steward/update/tapir-http4s-server…
Browse files Browse the repository at this point in the history
…-0.20.1

Update tapir-http4s-server, ... to 0.20.1
  • Loading branch information
adamw authored Mar 3, 2022
2 parents 6575eaa + 8e33377 commit b4ca8e2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import com.softwaremill.bootzooka.util.ServerEndpoints
import org.http4s.HttpRoutes
import sttp.tapir.server.http4s._
import sttp.tapir.server.interceptor.ValuedEndpointOutput
import sttp.tapir.swagger.SwaggerUIOptions
import sttp.tapir.swagger.bundle.SwaggerInterpreter

class EndpointsToRoutes(http: Http, apiContextPath: List[String]) {
Expand All @@ -21,7 +22,7 @@ class EndpointsToRoutes(http: Http, apiContextPath: List[String]) {
/** Interprets the given endpoint descriptions as docs, and returns http4s routes which expose the documentation using Swagger. */
def toDocsRoutes(es: ServerEndpoints): HttpRoutes[IO] = {
val swaggerEndpoints =
SwaggerInterpreter(contextPath = apiContextPath, customiseDocsModel = _.addServer(s"/${apiContextPath.mkString("/")}"))
SwaggerInterpreter(swaggerUIOptions = SwaggerUIOptions.default.copy(contextPath = apiContextPath), customiseDocsModel = _.addServer(s"/${apiContextPath.mkString("/")}"))
.fromServerEndpoints(es.toList, "My App", "1.0")
Http4sServerInterpreter[IO]().toRoutes(swaggerEndpoints)
}
Expand Down
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ val circeVersion = "0.14.1"
val tsecVersion = "0.4.0"
val sttpVersion = "3.5.0"
val prometheusVersion = "0.15.0"
val tapirVersion = "0.20.0-M10"
val tapirVersion = "0.20.1"
val macwireVersion = "2.5.6"

val dbDependencies = Seq(
Expand Down

0 comments on commit b4ca8e2

Please sign in to comment.