From a74426d631e3311cc3c460ae9917f76f0221f4de Mon Sep 17 00:00:00 2001 From: Piotr Orzechowski Date: Sat, 28 Jul 2018 02:19:01 +0200 Subject: Swagger.v1.json template (#3572) * Turn swagger.v1.json into template * Rename ENABLE_SWAGGER_ENDPOINT option to ENABLE_SWAGGER --- routers/api/v1/api.go | 4 ++-- routers/api/v1/misc/swagger.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'routers/api') diff --git a/routers/api/v1/api.go b/routers/api/v1/api.go index 3174e56374..5d47570c5f 100644 --- a/routers/api/v1/api.go +++ b/routers/api/v1/api.go @@ -278,13 +278,13 @@ func mustAllowPulls(ctx *context.Context) { func RegisterRoutes(m *macaron.Macaron) { bind := binding.Bind - if setting.API.EnableSwaggerEndpoint { + if setting.API.EnableSwagger { m.Get("/swagger", misc.Swagger) //Render V1 by default } m.Group("/v1", func() { // Miscellaneous - if setting.API.EnableSwaggerEndpoint { + if setting.API.EnableSwagger { m.Get("/swagger", misc.Swagger) } m.Get("/version", misc.Version) diff --git a/routers/api/v1/misc/swagger.go b/routers/api/v1/misc/swagger.go index 0599f85154..e17b775227 100644 --- a/routers/api/v1/misc/swagger.go +++ b/routers/api/v1/misc/swagger.go @@ -10,7 +10,7 @@ import ( ) // tplSwagger swagger page template -const tplSwagger base.TplName = "swagger" +const tplSwagger base.TplName = "swagger/ui" // Swagger render swagger-ui page with v1 json func Swagger(ctx *context.Context) { -- cgit v1.2.3