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
This commit is contained in:
Antoine GIRARD 2017-08-21 13:13:47 +02:00 committed by Lauris BH
parent 951c909a67
commit fd8e8a421a
32 changed files with 1911 additions and 110 deletions

View file

@ -15,13 +15,13 @@ import (
// ListHooks list all hooks of a repository
func ListHooks(ctx *context.APIContext) {
// swagger:route GET /repos/{username}/{reponame}/hooks
// swagger:route GET /repos/{username}/{reponame}/hooks repository repoListHooks
//
// Produces:
// - application/json
//
// Responses:
// 200: apiHooks
// 200: HookList
// 500: error
hooks, err := models.GetWebhooksByRepoID(ctx.Repo.Repository.ID)
@ -50,7 +50,7 @@ func GetHook(ctx *context.APIContext) {
// CreateHook create a hook for a repository
func CreateHook(ctx *context.APIContext, form api.CreateHookOption) {
// swagger:route POST /repos/{username}/{reponame}/hooks
// swagger:route POST /repos/{username}/{reponame}/hooks repository repoCreateHook
//
// Consumes:
// - application/json
@ -59,7 +59,7 @@ func CreateHook(ctx *context.APIContext, form api.CreateHookOption) {
// - application/json
//
// Responses:
// 200: apiHook
// 200: Hook
// 422: validationError
// 500: error
@ -71,13 +71,13 @@ func CreateHook(ctx *context.APIContext, form api.CreateHookOption) {
// EditHook modify a hook of a repository
func EditHook(ctx *context.APIContext, form api.EditHookOption) {
// swagger:route PATCH /repos/{username}/{reponame}/hooks/{id}
// swagger:route PATCH /repos/{username}/{reponame}/hooks/{id} repository repoEditHook
//
// Produces:
// - application/json
//
// Responses:
// 200: apiHook //TODO
// 200: Hook
// 422: validationError
// 500: error
@ -87,7 +87,7 @@ func EditHook(ctx *context.APIContext, form api.EditHookOption) {
// DeleteHook delete a hook of a repository
func DeleteHook(ctx *context.APIContext) {
// swagger:route DELETE /repos/{username}/{reponame}/hooks/{id}
// swagger:route DELETE /repos/{username}/{reponame}/hooks/{id} repository repoDeleteHook
//
// Produces:
// - application/json