From 3fe605932cec4625964962beefef4b0e183af3f4 Mon Sep 17 00:00:00 2001 From: Richard Mahn Date: Wed, 6 Feb 2019 11:19:26 -0700 Subject: [PATCH] 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 --- doc/advanced/config-cheat-sheet.en-us.md | 1 + doc/advanced/config-cheat-sheet.zh-cn.md | 1 + 2 files changed, 2 insertions(+) diff --git a/doc/advanced/config-cheat-sheet.en-us.md b/doc/advanced/config-cheat-sheet.en-us.md index 89eb9af7..3494311d 100644 --- a/doc/advanced/config-cheat-sheet.en-us.md +++ b/doc/advanced/config-cheat-sheet.en-us.md @@ -332,6 +332,7 @@ Values containing `#` or `;` must be quoted using `` ` `` or `"""`. - `ENABLE_SWAGGER`: **true**: Enables /api/swagger, /api/v1/swagger etc. endpoints. True or false; default is true. - `MAX_RESPONSE_ITEMS`: **50**: Max number of items in a page. - `DEFAULT_PAGING_NUM`: **30**: Default paging number of api. +- `DEFAULT_GIT_TREES_PER_PAGE`: **1000**: Default and maximum number of items per page for git trees api. ## i18n (`i18n`) diff --git a/doc/advanced/config-cheat-sheet.zh-cn.md b/doc/advanced/config-cheat-sheet.zh-cn.md index 990d4d42..2f025135 100644 --- a/doc/advanced/config-cheat-sheet.zh-cn.md +++ b/doc/advanced/config-cheat-sheet.zh-cn.md @@ -199,6 +199,7 @@ menu: - `ENABLE_SWAGGER`: **true**: 是否启用swagger路由 /api/swagger, /api/v1/swagger etc. endpoints. True 或 false; 默认是 true. - `MAX_RESPONSE_ITEMS`: **50**: 一个页面最大的项目数。 - `DEFAULT_PAGING_NUM`: **30**: API中默认分页条数。 +- `DEFAULT_GIT_TREES_PER_PAGE`: **1000**: GIT TREES API每页的默认和最大项数. ## Markup (`markup`)