fix(api): document X-Total-Count instead of non-existent X-Total header (#38717)

The `CommitList` and `ChangedFileList` swagger responses documented an
`X-Total` response header that their endpoints never send, they send
`X-Total-Count` via `SetTotalCountHeader`. This renames the documented
header and regenerates the spec.

`repoGetAllCommits` also uses `CommitList` and sends both headers, so
the new name is accurate for all three endpoints.

Also corrects `ChangedFileList` describing its headers as commit counts.

Documentation only, no handler behaviour changes.

Fixes https://github.com/go-gitea/gitea/issues/22048

---------

Signed-off-by: davidpavlovschi <davidpavlov2048@gmail.com>
Co-authored-by: silverwind <me@silverwind.io>
This commit is contained in:
David Pavlovschii
2026-08-07 16:00:35 +03:00
committed by GitHub
parent e81ab0a5ea
commit 8873150206
3 changed files with 12 additions and 12 deletions
+4 -4
View File
@@ -248,7 +248,7 @@ type swaggerCommitList struct {
PerPage int `json:"X-PerPage"`
// Total commit count
Total int `json:"X-Total"`
Total int `json:"X-Total-Count"`
// Total number of pages
PageCount int `json:"X-PageCount"`
@@ -266,11 +266,11 @@ type swaggerChangedFileList struct {
// The current page
Page int `json:"X-Page"`
// Commits per page
// Files per page
PerPage int `json:"X-PerPage"`
// Total commit count
Total int `json:"X-Total"`
// Total file count
Total int `json:"X-Total-Count"`
// Total number of pages
PageCount int `json:"X-PageCount"`
+4 -4
View File
@@ -213,14 +213,14 @@
}
},
"X-PerPage": {
"description": "Commits per page",
"description": "Files per page",
"schema": {
"format": "int64",
"type": "integer"
}
},
"X-Total": {
"description": "Total commit count",
"X-Total-Count": {
"description": "Total file count",
"schema": {
"format": "int64",
"type": "integer"
@@ -311,7 +311,7 @@
"type": "integer"
}
},
"X-Total": {
"X-Total-Count": {
"description": "Total commit count",
"schema": {
"format": "int64",
+4 -4
View File
@@ -31247,12 +31247,12 @@
"X-PerPage": {
"type": "integer",
"format": "int64",
"description": "Commits per page"
"description": "Files per page"
},
"X-Total": {
"X-Total-Count": {
"type": "integer",
"format": "int64",
"description": "Total commit count"
"description": "Total file count"
}
}
},
@@ -31311,7 +31311,7 @@
"format": "int64",
"description": "Commits per page"
},
"X-Total": {
"X-Total-Count": {
"type": "integer",
"format": "int64",
"description": "Total commit count"