mirror of
https://github.com/go-gitea/gitea
synced 2025-07-16 07:18:37 +00:00
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:
committed by
Lauris BH
parent
951c909a67
commit
fd8e8a421a
@@ -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
|
||||
|
Reference in New Issue
Block a user