From 0161e46b5a1a60b9e5a20438c5b67ca84dce5861 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jonas=20=C3=96stanb=C3=A4ck?=
 <cez81@users.noreply.github.com>
Date: Fri, 19 May 2017 02:20:06 +0200
Subject: [PATCH] Add swagger comment for MirrorSync (#1747)

* Add swagger comment for MirrorSync

* Generate swagger.v1.json
---
 public/swagger.v1.json      | 16 ++++++++++++++++
 routers/api/v1/repo/repo.go |  9 +++++++++
 2 files changed, 25 insertions(+)

diff --git a/public/swagger.v1.json b/public/swagger.v1.json
index 264ae52be6..dd91a6fdc1 100644
--- a/public/swagger.v1.json
+++ b/public/swagger.v1.json
@@ -228,6 +228,22 @@
         }
       }
     },
+    "/repos/{username}/{reponame}/mirror-sync": {
+      "post": {
+        "produces": [
+          "application/json"
+        ],
+        "operationId": "repoMirrorSync",
+        "responses": {
+          "200": {
+            "$ref": "#/responses/empty"
+          },
+          "403": {
+            "$ref": "#/responses/forbidden"
+          }
+        }
+      }
+    },
     "/repos/{username}/{reponame}/subscription": {
       "get": {
         "operationId": "userCurrentCheckSubscription",
diff --git a/routers/api/v1/repo/repo.go b/routers/api/v1/repo/repo.go
index 83b1dbd26b..da4034a0d4 100644
--- a/routers/api/v1/repo/repo.go
+++ b/routers/api/v1/repo/repo.go
@@ -337,6 +337,15 @@ func Delete(ctx *context.APIContext) {
 
 // MirrorSync adds a mirrored repository to the sync queue
 func MirrorSync(ctx *context.APIContext) {
+	// swagger:route POST /repos/{username}/{reponame}/mirror-sync repoMirrorSync
+	//
+	//     Produces:
+	//     - application/json
+	//
+	//     Responses:
+	//       200: empty
+	//       403: forbidden
+
 	repo := ctx.Repo.Repository
 
 	if !ctx.Repo.IsWriter() {