summaryrefslogtreecommitdiffstats
path: root/routers/api/v1/repo/repo.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/api/v1/repo/repo.go')
-rw-r--r--routers/api/v1/repo/repo.go29
1 files changed, 21 insertions, 8 deletions
diff --git a/routers/api/v1/repo/repo.go b/routers/api/v1/repo/repo.go
index e44159817e..e8bf026511 100644
--- a/routers/api/v1/repo/repo.go
+++ b/routers/api/v1/repo/repo.go
@@ -20,7 +20,7 @@ import (
// Search repositories via options
func Search(ctx *context.APIContext) {
- // swagger:route GET /repos/search repoSearch
+ // swagger:route GET /repos/search repository repoSearch
//
// Produces:
// - application/json
@@ -130,8 +130,21 @@ func CreateUserRepo(ctx *context.APIContext, owner *models.User, opt api.CreateR
}
// Create one repository of mine
-// see https://github.com/gogits/go-gogs-client/wiki/Repositories#create
func Create(ctx *context.APIContext, opt api.CreateRepoOption) {
+ // swagger:route POST /user/repos repository user createCurrentUserRepo
+ //
+ // Consumes:
+ // - application/json
+ //
+ // Produces:
+ // - application/json
+ //
+ // Responses:
+ // 201: Repository
+ // 403: forbidden
+ // 422: validationError
+ // 500: error
+
// Shouldn't reach this condition, but just in case.
if ctx.User.IsOrganization() {
ctx.Error(422, "", "not allowed creating repository for organization")
@@ -142,7 +155,7 @@ func Create(ctx *context.APIContext, opt api.CreateRepoOption) {
// CreateOrgRepo create one repository of the organization
func CreateOrgRepo(ctx *context.APIContext, opt api.CreateRepoOption) {
- // swagger:route POST /org/{org}/repos createOrgRepo
+ // swagger:route POST /org/{org}/repos organization createOrgRepo
//
// Consumes:
// - application/json
@@ -175,7 +188,7 @@ func CreateOrgRepo(ctx *context.APIContext, opt api.CreateRepoOption) {
// Migrate migrate remote git repository to gitea
func Migrate(ctx *context.APIContext, form auth.MigrateRepoForm) {
- // swagger:route POST /repos/migrate
+ // swagger:route POST /repos/migrate repository repoMigrate
//
// Consumes:
// - application/json
@@ -260,7 +273,7 @@ func Migrate(ctx *context.APIContext, form auth.MigrateRepoForm) {
// Get one repository
func Get(ctx *context.APIContext) {
- // swagger:route GET /repos/{username}/{reponame}
+ // swagger:route GET /repos/{username}/{reponame} repository repoGet
//
// Produces:
// - application/json
@@ -274,7 +287,7 @@ func Get(ctx *context.APIContext) {
// GetByID returns a single Repository
func GetByID(ctx *context.APIContext) {
- // swagger:route GET /repositories/{id}
+ // swagger:route GET /repositories/{id} repository repoGetByID
//
// Produces:
// - application/json
@@ -306,7 +319,7 @@ func GetByID(ctx *context.APIContext) {
// Delete one repository
func Delete(ctx *context.APIContext) {
- // swagger:route DELETE /repos/{username}/{reponame}
+ // swagger:route DELETE /repos/{username}/{reponame} repository repoDelete
//
// Produces:
// - application/json
@@ -339,7 +352,7 @@ 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
+ // swagger:route POST /repos/{username}/{reponame}/mirror-sync repository repoMirrorSync
//
// Produces:
// - application/json