summaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorRichard Mahn <richmahn@users.noreply.github.com>2019-02-06 11:19:26 -0700
committerzeripath <art27@cantab.net>2019-02-06 18:19:26 +0000
commitda1edbfb79566e9d31f43ee85eb2e9fc9b52695b (patch)
tree6e81098a8ddb5695b52a6a136bb24286fb8a8c9b /templates
parent0c840a924a9a78556dafdc3e558bdcfe3c704201 (diff)
downloadgitea-da1edbfb79566e9d31f43ee85eb2e9fc9b52695b.tar.gz
gitea-da1edbfb79566e9d31f43ee85eb2e9fc9b52695b.zip
Feature - Pagination for git tree API (#5838)
* Feature - Pagination for git tree API * Handles case when page is negative * Does a for loop over the start and end rather than all entries * Removed redundent logic * Adds per_page as a query parameter * Adds DEFAULT_GIT_TREES_PER_PAGE for settings, ran make fmt * Fix typo in cheat-sheet en * Makes page start at 1, generated swagger * Use updates to SDK * Updates to use latest sdk * Updates swagger for tree api * Adds test for GetTreeBySHA * Updates per PR reviews * Updates per PR reviews * Remove file * Formatting * Fix to swagger file * Fix to swagger * Update v1_json.tmpl * Fix to swagger file
Diffstat (limited to 'templates')
-rw-r--r--templates/swagger/v1_json.tmpl28
1 files changed, 28 insertions, 0 deletions
diff --git a/templates/swagger/v1_json.tmpl b/templates/swagger/v1_json.tmpl
index bde496c7f1..c2ed1d75b8 100644
--- a/templates/swagger/v1_json.tmpl
+++ b/templates/swagger/v1_json.tmpl
@@ -1775,6 +1775,24 @@
"name": "sha",
"in": "path",
"required": true
+ },
+ {
+ "type": "boolean",
+ "description": "show all directories and files",
+ "name": "recursive",
+ "in": "query"
+ },
+ {
+ "type": "integer",
+ "description": "page number; the 'truncated' field in the response will be true if there are still more items after this page, false if the last page",
+ "name": "page",
+ "in": "query"
+ },
+ {
+ "type": "integer",
+ "description": "number of items per page; default is 1000 or what is set in app.ini as DEFAULT_GIT_TREES_PER_PAGE",
+ "name": "per_page",
+ "in": "query"
}
],
"responses": {
@@ -7352,10 +7370,20 @@
"description": "GitTreeResponse returns a git tree",
"type": "object",
"properties": {
+ "page": {
+ "type": "integer",
+ "format": "int64",
+ "x-go-name": "Page"
+ },
"sha": {
"type": "string",
"x-go-name": "SHA"
},
+ "total_count": {
+ "type": "integer",
+ "format": "int64",
+ "x-go-name": "TotalCount"
+ },
"tree": {
"type": "array",
"items": {