mirror of
https://github.com/go-gitea/gitea.git
synced 2026-09-27 00:39:43 +00:00
docs(api): name the unadopted-repository search parameter query (#39370)
`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 <me@silverwind.io>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
@@ -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":
|
||||
|
||||
+2
-2
@@ -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"
|
||||
}
|
||||
|
||||
+2
-2
@@ -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"
|
||||
}
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user