1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

Refactor repo contents API and add "contents-ext" API (#34822)

See the updated swagger document for details.
This commit is contained in:
wxiaoguang
2025-06-25 10:34:21 +08:00
committed by GitHub
parent 7be1a5e585
commit dbd9c69909
18 changed files with 481 additions and 262 deletions

View File

@@ -119,6 +119,11 @@ type FileLinksResponse struct {
HTMLURL *string `json:"html"`
}
type ContentsExtResponse struct {
FileContents *ContentsResponse `json:"file_contents,omitempty"`
DirContents []*ContentsResponse `json:"dir_contents,omitempty"`
}
// ContentsResponse contains information about a repo's entry's (dir, file, symlink, submodule) metadata and content
type ContentsResponse struct {
Name string `json:"name"`
@@ -145,6 +150,9 @@ type ContentsResponse struct {
// `submodule_git_url` is populated when `type` is `submodule`, otherwise null
SubmoduleGitURL *string `json:"submodule_git_url"`
Links *FileLinksResponse `json:"_links"`
LfsOid *string `json:"lfs_oid"`
LfsSize *int64 `json:"lfs_size"`
}
// FileCommitResponse contains information generated from a Git commit for a repo's file.