Skip to content

Commit 0161e46

Browse files
cez81lunny
authored andcommitted
Add swagger comment for MirrorSync (#1747)
* Add swagger comment for MirrorSync * Generate swagger.v1.json
1 parent fd6034a commit 0161e46

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

public/swagger.v1.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,22 @@
228228
}
229229
}
230230
},
231+
"/repos/{username}/{reponame}/mirror-sync": {
232+
"post": {
233+
"produces": [
234+
"application/json"
235+
],
236+
"operationId": "repoMirrorSync",
237+
"responses": {
238+
"200": {
239+
"$ref": "#/responses/empty"
240+
},
241+
"403": {
242+
"$ref": "#/responses/forbidden"
243+
}
244+
}
245+
}
246+
},
231247
"/repos/{username}/{reponame}/subscription": {
232248
"get": {
233249
"operationId": "userCurrentCheckSubscription",

routers/api/v1/repo/repo.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,15 @@ func Delete(ctx *context.APIContext) {
337337

338338
// MirrorSync adds a mirrored repository to the sync queue
339339
func MirrorSync(ctx *context.APIContext) {
340+
// swagger:route POST /repos/{username}/{reponame}/mirror-sync repoMirrorSync
341+
//
342+
// Produces:
343+
// - application/json
344+
//
345+
// Responses:
346+
// 200: empty
347+
// 403: forbidden
348+
340349
repo := ctx.Repo.Repository
341350

342351
if !ctx.Repo.IsWriter() {

0 commit comments

Comments
 (0)