summaryrefslogtreecommitdiffstats
path: root/routers/api/v1/swagger
diff options
context:
space:
mode:
authorMike Schwörer <mailport@mikescher.de>2019-08-26 16:09:10 +0200
committerAntoine GIRARD <sapk@users.noreply.github.com>2019-08-26 16:09:10 +0200
commit042089fbaf8a818042405a75bee08dea8db347c0 (patch)
tree5f5692b5e29a4cf8ab5b2c03a735506073317480 /routers/api/v1/swagger
parent6b3f52fe5f7db5b3122cc8481ab8fed83e273fde (diff)
downloadgitea-042089fbaf8a818042405a75bee08dea8db347c0.tar.gz
gitea-042089fbaf8a818042405a75bee08dea8db347c0.zip
API method to list all commits of a repository (#6408)
* Added API endpoint ListAllCommits (/repos/{owner}/{repo}/git/commits) Signed-off-by: Mike Schwörer <mailport@mikescher.de> * Fixed failing drone build Signed-off-by: Mike Schwörer <mailport@mikescher.de> * Implemented requested changes (PR reviews) Signed-off-by: Mike Schwörer <mailport@mikescher.de> * gofmt Signed-off-by: Mike Schwörer <mailport@mikescher.de> * Changed api route from "/repos/{owner}/{repo}/git/commits" to "/repos/{owner}/{repo}/commits" * Removed unnecessary line * better error message when git repo is empty * make generate-swagger * fixed removed return * Update routers/api/v1/repo/commits.go Co-Authored-By: Lauris BH <lauris@nix.lv> * Update routers/api/v1/repo/commits.go Co-Authored-By: Lauris BH <lauris@nix.lv> * go fmt * Refactored common code into ToCommit() * made toCommit not exported * added check for userCache == nil
Diffstat (limited to 'routers/api/v1/swagger')
-rw-r--r--routers/api/v1/swagger/repo.go29
1 files changed, 29 insertions, 0 deletions
diff --git a/routers/api/v1/swagger/repo.go b/routers/api/v1/swagger/repo.go
index 2cab5b0ed4..422cc0861c 100644
--- a/routers/api/v1/swagger/repo.go
+++ b/routers/api/v1/swagger/repo.go
@@ -190,6 +190,35 @@ type swaggerCommit struct {
Body api.Commit `json:"body"`
}
+// CommitList
+// swagger:response CommitList
+type swaggerCommitList struct {
+ // The current page
+ Page int `json:"X-Page"`
+
+ // Commits per page
+ PerPage int `json:"X-PerPage"`
+
+ // Total commit count
+ Total int `json:"X-Total"`
+
+ // Total number of pages
+ PageCount int `json:"X-PageCount"`
+
+ // True if there is another page
+ HasMore bool `json:"X-HasMore"`
+
+ //in: body
+ Body []api.Commit `json:"body"`
+}
+
+// EmptyRepository
+// swagger:response EmptyRepository
+type swaggerEmptyRepository struct {
+ //in: body
+ Body api.APIError `json:"body"`
+}
+
// FileResponse
// swagger:response FileResponse
type swaggerFileResponse struct {