fix: swagger ui bug (#177)

This commit is contained in:
Ryan Brink
2022-02-07 15:18:35 -05:00
committed by GitHub
parent 71ddc62366
commit d1b951b4b1
7 changed files with 94 additions and 5 deletions

View File

@ -5,6 +5,10 @@ import io.ktor.response.respondRedirect
import io.ktor.routing.Routing
import io.ktor.routing.get
@Deprecated(
"Webjar approach is deprecated",
replaceWith = ReplaceWith("swagger()", "io.bkbn.kompendium.core.routes.swagger")
)
fun Routing.swaggerUI(openApiJsonUrl: String = "/openapi.json") {
get("/swagger-ui") {
call.respondRedirect("/webjars/swagger-ui/index.html?url=$openApiJsonUrl", true)