Browse Source

Add swagger comment for MirrorSync (#1747)

* Add swagger comment for MirrorSync

* Generate swagger.v1.json
for-closed-social
Jonas Östanbäck 7 years ago
committed by Lunny Xiao
parent
commit
0161e46b5a
2 changed files with 25 additions and 0 deletions
  1. +16
    -0
      public/swagger.v1.json
  2. +9
    -0
      routers/api/v1/repo/repo.go

+ 16
- 0
public/swagger.v1.json View File

@ -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": { "/repos/{username}/{reponame}/subscription": {
"get": { "get": {
"operationId": "userCurrentCheckSubscription", "operationId": "userCurrentCheckSubscription",

+ 9
- 0
routers/api/v1/repo/repo.go View File

@ -337,6 +337,15 @@ func Delete(ctx *context.APIContext) {
// MirrorSync adds a mirrored repository to the sync queue // MirrorSync adds a mirrored repository to the sync queue
func MirrorSync(ctx *context.APIContext) { 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 repo := ctx.Repo.Repository
if !ctx.Repo.IsWriter() { if !ctx.Repo.IsWriter() {

Loading…
Cancel
Save