mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-09-19 00:51:25 +00:00
Cleanup openapi generation (#4331)
Co-authored-by: oauth <woodpecker-bot@obermui.de> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: 6543 <6543@obermui.de>
This commit is contained in:
@@ -20,10 +20,10 @@ import (
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/rs/zerolog/log"
|
||||
swagger_files "github.com/swaggo/files"
|
||||
openapi_files "github.com/swaggo/files"
|
||||
ginSwagger "github.com/swaggo/gin-swagger"
|
||||
|
||||
"go.woodpecker-ci.org/woodpecker/v2/cmd/server/docs"
|
||||
"go.woodpecker-ci.org/woodpecker/v2/cmd/server/openapi"
|
||||
"go.woodpecker-ci.org/woodpecker/v2/server"
|
||||
"go.woodpecker-ci.org/woodpecker/v2/server/api"
|
||||
"go.woodpecker-ci.org/woodpecker/v2/server/api/metrics"
|
||||
@@ -78,9 +78,9 @@ func Load(noRouteHandler http.HandlerFunc, middleware ...gin.HandlerFunc) http.H
|
||||
}
|
||||
|
||||
func setupSwaggerConfigAndRoutes(e *gin.Engine) {
|
||||
docs.SwaggerInfo.Host = getHost(server.Config.Server.Host)
|
||||
docs.SwaggerInfo.BasePath = server.Config.Server.RootPath + "/api"
|
||||
e.GET(server.Config.Server.RootPath+"/swagger/*any", ginSwagger.WrapHandler(swagger_files.Handler))
|
||||
openapi.SwaggerInfo.Host = getHost(server.Config.Server.Host)
|
||||
openapi.SwaggerInfo.BasePath = server.Config.Server.RootPath + "/api"
|
||||
e.GET(server.Config.Server.RootPath+"/swagger/*any", ginSwagger.WrapHandler(openapi_files.Handler))
|
||||
}
|
||||
|
||||
func getHost(s string) string {
|
||||
|
Reference in New Issue
Block a user