echo-swagger
echo-swagger copied to clipboard
There are repeated slashes when jumping to index
The regular match contains a slash, but an extra slash is spliced below.
https://github.com/swaggo/echo-swagger/blob/56020475d07fb7bc62e0efe48e8bb97ac88b758b/swagger.go#L131-L164
So if you access the path /swagger/, you will get /swagger//index.html
This is my workaround FWIW:
swaggerRedirect := func(c echo.Context) error {
return c.Redirect(http.StatusMovedPermanently, "/api/v1/doc/index.html")
}
e.GET("/api/v1/doc", swaggerRedirect)
e.GET("/api/v1/doc/", swaggerRedirect)
e.GET("/api/v1/doc/*", echoSwagger.WrapHandler)
I have same problem. I'm going to look to the gin side...