aboutsummaryrefslogtreecommitdiffstats
path: root/routers/api/v1/admin/org.go
diff options
context:
space:
mode:
authorAntoine GIRARD <sapk@users.noreply.github.com>2017-08-21 13:13:47 +0200
committerLauris BH <lauris@nix.lv>2017-08-21 14:13:47 +0300
commitfd8e8a421ae21f8c68eaad195bdd4881e1d34b21 (patch)
tree2c651e0f39a0360496d1fbbd1f4d0fd03ec9a95f /routers/api/v1/admin/org.go
parent951c909a67bb6f1f8577fb1e61f22dca2bc3c07f (diff)
downloadgitea-fd8e8a421ae21f8c68eaad195bdd4881e1d34b21.tar.gz
gitea-fd8e8a421ae21f8c68eaad195bdd4881e1d34b21.zip
Improve swagger doc (#2274)
* Add swagger comment for adminCreateOrg * Add swagger comment for admin route * add hook swagger doc * Add tags * Add auth * Fix name of responses * Edit name method * Update vendor * make generate-swagger
Diffstat (limited to 'routers/api/v1/admin/org.go')
-rw-r--r--routers/api/v1/admin/org.go15
1 files changed, 14 insertions, 1 deletions
diff --git a/routers/api/v1/admin/org.go b/routers/api/v1/admin/org.go
index 706e2cedeb..99c9cf0b95 100644
--- a/routers/api/v1/admin/org.go
+++ b/routers/api/v1/admin/org.go
@@ -14,8 +14,21 @@ import (
)
// CreateOrg api for create organization
-// see https://github.com/gogits/go-gogs-client/wiki/Administration-Organizations#create-a-new-organization
func CreateOrg(ctx *context.APIContext, form api.CreateOrgOption) {
+ // swagger:route POST /admin/users/{username}/orgs admin adminCreateOrg
+ //
+ // Consumes:
+ // - application/json
+ //
+ // Produces:
+ // - application/json
+ //
+ // Responses:
+ // 201: Organization
+ // 403: forbidden
+ // 422: validationError
+ // 500: error
+
u := user.GetUserByParams(ctx)
if ctx.Written() {
return