summaryrefslogtreecommitdiffstats
path: root/routers/api/v1
diff options
context:
space:
mode:
authorPiotr Orzechowski <piotr@orzechowski.tech>2018-07-28 02:19:01 +0200
committerLauris BH <lauris@nix.lv>2018-07-28 03:19:01 +0300
commita74426d631e3311cc3c460ae9917f76f0221f4de (patch)
tree1343766d999308825f42bc0b67c1845a5e9e9546 /routers/api/v1
parent412583a3f28162c89e827fbb586319ac8eea9825 (diff)
downloadgitea-a74426d631e3311cc3c460ae9917f76f0221f4de.tar.gz
gitea-a74426d631e3311cc3c460ae9917f76f0221f4de.zip
Swagger.v1.json template (#3572)
* Turn swagger.v1.json into template * Rename ENABLE_SWAGGER_ENDPOINT option to ENABLE_SWAGGER
Diffstat (limited to 'routers/api/v1')
-rw-r--r--routers/api/v1/api.go4
-rw-r--r--routers/api/v1/misc/swagger.go2
2 files changed, 3 insertions, 3 deletions
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) {