From f0f53a76ee9454f158d480cc16ec85ee72366f60 Mon Sep 17 00:00:00 2001 From: Roshan Ramani <154859727+rawsun007@users.noreply.github.com> Date: Fri, 25 Sep 2026 23:45:24 +0530 Subject: [PATCH] docs(api): name the unadopted-repository search parameter query (#39370) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `GET /admin/unadopted` documents a `pattern` query parameter, but the handler reads `query`: ```go repoNames, count, err := repo_service.ListUnadoptedRepositories(ctx, ctx.FormString("query"), &listOptions) ``` Nothing in the tree reads `pattern`. A client generated from the published spec sends it, the server ignores it, and the caller gets the full unadopted list with no error — the failure is silent. Both spellings date from the commit that added the endpoint, https://github.com/go-gitea/gitea/pull/12920, so the documentation has been wrong since 2020 rather than drifting. The handler side is the one clients already depend on, so this renames the documented parameter and regenerates the spec. --------- Co-authored-by: silverwind Co-authored-by: Lunny Xiao --- routers/api/v1/admin/adopt.go | 4 ++-- templates/swagger/v1-openapi3.generated.json | 4 ++-- templates/swagger/v1-swagger.generated.json | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/routers/api/v1/admin/adopt.go b/routers/api/v1/admin/adopt.go index 5b65e51a922..2bc8ddc4bd6 100644 --- a/routers/api/v1/admin/adopt.go +++ b/routers/api/v1/admin/adopt.go @@ -31,9 +31,9 @@ func ListUnadoptedRepositories(ctx *context.APIContext) { // in: query // description: page size of results // type: integer - // - name: pattern + // - name: query // in: query - // description: pattern of repositories to search for + // description: glob pattern of repositories to search for, in the form owner or owner/repo // type: string // responses: // "200": diff --git a/templates/swagger/v1-openapi3.generated.json b/templates/swagger/v1-openapi3.generated.json index f0a12632662..ed97e4ff46b 100644 --- a/templates/swagger/v1-openapi3.generated.json +++ b/templates/swagger/v1-openapi3.generated.json @@ -11837,9 +11837,9 @@ } }, { - "description": "pattern of repositories to search for", + "description": "glob pattern of repositories to search for, in the form owner or owner/repo", "in": "query", - "name": "pattern", + "name": "query", "schema": { "type": "string" } diff --git a/templates/swagger/v1-swagger.generated.json b/templates/swagger/v1-swagger.generated.json index 38fc9172f4a..5dfecc50d77 100644 --- a/templates/swagger/v1-swagger.generated.json +++ b/templates/swagger/v1-swagger.generated.json @@ -723,8 +723,8 @@ }, { "type": "string", - "description": "pattern of repositories to search for", - "name": "pattern", + "description": "glob pattern of repositories to search for, in the form owner or owner/repo", + "name": "query", "in": "query" } ],