diff --git a/modules/http4s-swagger/src-jvm-ce2/Compat.scala b/modules/http4s-swagger/src-jvm-ce2/Compat.scala index e6f870bf5..056380815 100644 --- a/modules/http4s-swagger/src-jvm-ce2/Compat.scala +++ b/modules/http4s-swagger/src-jvm-ce2/Compat.scala @@ -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, diff --git a/modules/http4s-swagger/src-jvm-ce3/Compat.scala b/modules/http4s-swagger/src-jvm-ce3/Compat.scala index c1161da1b..aa12cea34 100644 --- a/modules/http4s-swagger/src-jvm-ce3/Compat.scala +++ b/modules/http4s-swagger/src-jvm-ce3/Compat.scala @@ -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( diff --git a/modules/http4s-swagger/test/src/smithy4s/http4s/swagger/DocsSpec.scala b/modules/http4s-swagger/test/src/smithy4s/http4s/swagger/DocsSpec.scala index 735c3f2bd..9f4c35123 100644 --- a/modules/http4s-swagger/test/src/smithy4s/http4s/swagger/DocsSpec.scala +++ b/modules/http4s-swagger/test/src/smithy4s/http4s/swagger/DocsSpec.scala @@ -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/" + ) + ) + } }