summaryrefslogtreecommitdiff
path: root/docs/api-usage.rst
diff options
context:
space:
mode:
authorJohn L. Villalovos <john@sodarock.com>2021-12-30 12:34:50 -0800
committerJohn L. Villalovos <john@sodarock.com>2021-12-30 12:34:50 -0800
commitcb824a49af9b0d155b89fe66a4cfebefe52beb7a (patch)
treee2227ebe783649de4c4b8a1b45ac4a9bc9e18a6a /docs/api-usage.rst
parent501f9a1588db90e6d2c235723ba62c09a669b5d2 (diff)
downloadgitlab-jlvillal/pagination.tar.gz
fix: handle situation where GitLab does not return valuesjlvillal/pagination
If a query returns more than 10,000 records than the following values are NOT returned: x.total_pages x.total Modify the code to allow no value to be set for these values. If there is not a value returned the functions will now return None. Update unit test so no longer `xfail` https://docs.gitlab.com/ee/user/gitlab_com/index.html#pagination-response-headers Closes #1686
Diffstat (limited to 'docs/api-usage.rst')
-rw-r--r--docs/api-usage.rst13
1 files changed, 11 insertions, 2 deletions
diff --git a/docs/api-usage.rst b/docs/api-usage.rst
index f30ed03..66e5887 100644
--- a/docs/api-usage.rst
+++ b/docs/api-usage.rst
@@ -265,8 +265,17 @@ The generator exposes extra listing information as received from the server:
* ``prev_page``: if ``None`` the current page is the first one
* ``next_page``: if ``None`` the current page is the last one
* ``per_page``: number of items per page
-* ``total_pages``: total number of pages available
-* ``total``: total number of items in the list
+* ``total_pages``: total number of pages available. This may be a ``None`` value.
+* ``total``: total number of items in the list. This may be a ``None`` value.
+
+.. note::
+
+ For performance reasons, if a query returns more than 10,000 records, GitLab
+ does not return the ``total_pages`` or ``total`` headers. In this case,
+ ``total_pages`` and ``total`` will have a value of ``None``.
+
+ For more information see:
+ https://docs.gitlab.com/ee/user/gitlab_com/index.html#pagination-response-headers
Sudo
====