aboutsummaryrefslogtreecommitdiffstats
path: root/routers/swagger_json.go
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/swagger_json.go
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/swagger_json.go')
-rw-r--r--routers/swagger_json.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/routers/swagger_json.go b/routers/swagger_json.go
new file mode 100644
index 0000000000..896f1afa2a
--- /dev/null
+++ b/routers/swagger_json.go
@@ -0,0 +1,14 @@
+package routers
+
+import (
+ "code.gitea.io/gitea/modules/base"
+ "code.gitea.io/gitea/modules/context"
+)
+
+// tplSwaggerV1Json swagger v1 json template
+const tplSwaggerV1Json base.TplName = "swagger/v1_json"
+
+// SwaggerV1Json render swagger v1 json
+func SwaggerV1Json(ctx *context.Context) {
+ ctx.HTML(200, tplSwaggerV1Json)
+}