From da1edbfb79566e9d31f43ee85eb2e9fc9b52695b Mon Sep 17 00:00:00 2001 From: Richard Mahn Date: Wed, 6 Feb 2019 11:19:26 -0700 Subject: 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 --- templates/swagger/v1_json.tmpl | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'templates/swagger/v1_json.tmpl') 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": { -- cgit v1.2.3