diff options
author | Jonas Östanbäck <cez81@users.noreply.github.com> | 2017-05-19 02:20:06 +0200 |
---|---|---|
committer | Lunny Xiao <xiaolunwen@gmail.com> | 2017-05-19 08:20:06 +0800 |
commit | 0161e46b5a1a60b9e5a20438c5b67ca84dce5861 (patch) | |
tree | e3b4aef40800782896904f66ecbbe765c6afa827 | |
parent | fd6034aaf23af1ce03bcba0babcbe7675ce093ee (diff) | |
download | gitea-0161e46b5a1a60b9e5a20438c5b67ca84dce5861.tar.gz gitea-0161e46b5a1a60b9e5a20438c5b67ca84dce5861.zip |
Add swagger comment for MirrorSync (#1747)
* Add swagger comment for MirrorSync
* Generate swagger.v1.json
-rw-r--r-- | public/swagger.v1.json | 16 | ||||
-rw-r--r-- | routers/api/v1/repo/repo.go | 9 |
2 files changed, 25 insertions, 0 deletions
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() { |