Improve Swagger documentation for user endpoints

This commit is contained in:
JakobDev 2024-11-23 10:33:55 +01:00
parent 1316f4d338
commit b074e08f34
No known key found for this signature in database
GPG key ID: 39DEF62C3ED6DC4C
23 changed files with 703 additions and 2 deletions

View file

@ -32,6 +32,10 @@ func ListHooks(ctx *context.APIContext) {
// responses:
// "200":
// "$ref": "#/responses/HookList"
// "401":
// "$ref": "#/responses/unauthorized"
// "403":
// "$ref": "#/responses/forbidden"
utils.ListOwnerHooks(
ctx,
@ -56,6 +60,10 @@ func GetHook(ctx *context.APIContext) {
// responses:
// "200":
// "$ref": "#/responses/Hook"
// "401":
// "$ref": "#/responses/unauthorized"
// "403":
// "$ref": "#/responses/forbidden"
hook, err := utils.GetOwnerHook(ctx, ctx.Doer.ID, ctx.ParamsInt64("id"))
if err != nil {
@ -93,6 +101,10 @@ func CreateHook(ctx *context.APIContext) {
// responses:
// "201":
// "$ref": "#/responses/Hook"
// "401":
// "$ref": "#/responses/unauthorized"
// "403":
// "$ref": "#/responses/forbidden"
utils.AddOwnerHook(
ctx,
@ -124,6 +136,10 @@ func EditHook(ctx *context.APIContext) {
// responses:
// "200":
// "$ref": "#/responses/Hook"
// "401":
// "$ref": "#/responses/unauthorized"
// "403":
// "$ref": "#/responses/forbidden"
utils.EditOwnerHook(
ctx,
@ -150,6 +166,10 @@ func DeleteHook(ctx *context.APIContext) {
// responses:
// "204":
// "$ref": "#/responses/empty"
// "401":
// "$ref": "#/responses/unauthorized"
// "403":
// "$ref": "#/responses/forbidden"
utils.DeleteOwnerHook(
ctx,