In this example Ktor will be told to serve the routes under /my-ktor-web-app/api/swagger-ui.
In the end, to call the swagger UI page, i need to navigate to http://my-domain.com/my-ktor-web-app/my-ktor-web-app/api/swagger-ui which is not what i wanted.
To fix this issue, i suggest following changes in code (based on version 2.7.2; tested it with success with and without rootHostPath):
Currently, since version 2.6.0, if i set a custom
rootHostPath
, it'll configure the routes wrong.For example, I have an nginx configured to serve the Ktor application under
http://my-domain.com/my-ktor-web-app
and configured the Plugin like this:In this example Ktor will be told to serve the routes under
/my-ktor-web-app/api/swagger-ui
. In the end, to call the swagger UI page, i need to navigate tohttp://my-domain.com/my-ktor-web-app/my-ktor-web-app/api/swagger-ui
which is not what i wanted.To fix this issue, i suggest following changes in code (based on version 2.7.2; tested it with success with and without
rootHostPath
):io.github.smiley4.ktorswaggerui.routing.SwaggerController