mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2026-05-12 22:10:25 +00:00
feat: Add header annotations for accurate API documentation (#9380)
This will help api packages like https://codeberg.org/Cyborus/forgejo-api to generate clients that expose the header information as well. Currently `forgejo-api` has to edit the swagger json to generate a client crate that knows about headers. - Create separate response types for different endpoint behaviors - CommitList: Base type with only X-Total-Count header - CommitListWithPagination: For GetPullRequestCommits (pagination headers + X-Total-Count) - CommitListWithLegacyPagination: For GetAllCommits (pagination headers + X-Total-Count + deprecated X-Total) - ChangedFileList: Base type with only X-Total-Count header - ChangedFileListWithPagination: For GetPullRequestFiles (pagination headers + X-Total-Count) This ensures swagger documentation accurately reflects which headers each endpoint returns. Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9380 Reviewed-by: Gusted <gusted@noreply.codeberg.org> Reviewed-by: Cyborus <cyborus@disroot.org> Co-authored-by: Myers Carpenter <myers@maski.org> Co-committed-by: Myers Carpenter <myers@maski.org>
This commit is contained in:
parent
3f994a6e80
commit
00b457e291
26 changed files with 550 additions and 88 deletions
|
|
@ -19,7 +19,6 @@ type AccessToken struct {
|
|||
}
|
||||
|
||||
// AccessTokenList represents a list of API access token.
|
||||
// swagger:response AccessTokenList
|
||||
type AccessTokenList []*AccessToken
|
||||
|
||||
// CreateAccessTokenOption options when create access token
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue