diff --git a/routers/api/v1/api.go b/routers/api/v1/api.go index 526940493f0fb..44ae2d5076c98 100644 --- a/routers/api/v1/api.go +++ b/routers/api/v1/api.go @@ -356,7 +356,7 @@ func RegisterRoutes(m *macaron.Macaron) { }, reqToken()) // Repositories - m.Post("/org/:org/repos", reqToken(), bind(api.CreateRepoOption{}), repo.CreateOrgRepo) + m.Post("/orgs/:orgname/repos", reqToken(), bind(api.CreateRepoOption{}), repo.CreateOrgRepo) m.Group("/repos", func() { m.Get("/search", repo.Search) diff --git a/routers/api/v1/repo/repo.go b/routers/api/v1/repo/repo.go index 20393102fc825..7cba9f55e8a6c 100644 --- a/routers/api/v1/repo/repo.go +++ b/routers/api/v1/repo/repo.go @@ -159,7 +159,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 organization createOrgRepo + // swagger:route POST /orgs/{orgname}/repos organization createOrgRepo // // Consumes: // - application/json @@ -173,7 +173,7 @@ func CreateOrgRepo(ctx *context.APIContext, opt api.CreateRepoOption) { // 403: forbidden // 500: error - org, err := models.GetOrgByName(ctx.Params(":org")) + org, err := models.GetOrgByName(ctx.Params(":orgname")) if err != nil { if models.IsErrOrgNotExist(err) { ctx.Error(422, "", err)