From ed855e1492ccd5d482b98fd66d92f6357329436f Mon Sep 17 00:00:00 2001 From: Gusted Date: Sat, 8 Feb 2025 15:08:57 +0000 Subject: [PATCH] chore(api): Improve description for `repoCheckCollaborator` (#6858) - Make it clear how the API responds with if the user is a collaborator or not. - Yes, not ideal. Should've been a JSON response instead - but backwards compatibility. - Resolves forgejo/forgejo#6837 Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6858 Reviewed-by: Earl Warren Co-authored-by: Gusted Co-committed-by: Gusted --- routers/api/v1/repo/collaborators.go | 1 + templates/swagger/v1_json.tmpl | 1 + 2 files changed, 2 insertions(+) diff --git a/routers/api/v1/repo/collaborators.go b/routers/api/v1/repo/collaborators.go index a43a21a88e..9ef1a92be4 100644 --- a/routers/api/v1/repo/collaborators.go +++ b/routers/api/v1/repo/collaborators.go @@ -82,6 +82,7 @@ func IsCollaborator(ctx *context.APIContext) { // swagger:operation GET /repos/{owner}/{repo}/collaborators/{collaborator} repository repoCheckCollaborator // --- // summary: Check if a user is a collaborator of a repository + // description: If the user is a collaborator, return 204. If the user is not a collaborator, return 404. // produces: // - application/json // parameters: diff --git a/templates/swagger/v1_json.tmpl b/templates/swagger/v1_json.tmpl index 2a8252557e..0d8497ca75 100644 --- a/templates/swagger/v1_json.tmpl +++ b/templates/swagger/v1_json.tmpl @@ -6074,6 +6074,7 @@ }, "/repos/{owner}/{repo}/collaborators/{collaborator}": { "get": { + "description": "If the user is a collaborator, return 204. If the user is not a collaborator, return 404.", "produces": [ "application/json" ],