Skip to content

Commit

Permalink
Merge pull request #309 from disneystreaming/fix-default-swagger-ui-path
Browse files Browse the repository at this point in the history
Fix default swagger-ui path.
  • Loading branch information
Baccata authored Jul 13, 2022
2 parents 3e7ff3b + b360d55 commit ca86b08
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion modules/http4s-swagger/src-jvm-ce2/Compat.scala
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ private[smithy4s] object Compat {
private[smithy4s] val EffectCompat = cats.effect.Sync

def docs[F[_]](blocker: Blocker): PartiallyAppliedDocs[F] =
new PartiallyAppliedDocs[F](blocker, "docs", "swagger-ui")
new PartiallyAppliedDocs[F](blocker, "docs", swaggerUiResourcePath)

case class PartiallyAppliedDocs[F[_]](
blocker: Blocker,
Expand Down
2 changes: 1 addition & 1 deletion modules/http4s-swagger/src-jvm-ce3/Compat.scala
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ private[smithy4s] object Compat {
private[smithy4s] val EffectCompat = cats.effect.Concurrent

def docs[F[_]]: PartiallyAppliedDocs[F] =
new PartiallyAppliedDocs[F]("docs", "swagger-ui")
new PartiallyAppliedDocs[F]("docs", swaggerUiResourcePath)

case class PartiallyAppliedDocs[F[_]](path: String, swaggerUiPath: String) {
def apply(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,13 @@ object DocsSpec extends SimpleIOSuite with TestCompat {
expect(response.status == Status.NotFound)
}
}

pureTest("Default swagger-ui-path") {
val docs = mkDocs
expect(
docs.swaggerUiPath.startsWith(
"META-INF/resources/webjars/swagger-ui-dist/"
)
)
}
}

0 comments on commit ca86b08

Please sign in to comment.