Pagination should not generate unnecessary prev/next links
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
craton |
Won't Fix
|
Undecided
|
Unassigned |
Bug Description
Currently the pagination code in craton.
* prev, even if there is no previous records
* next, even if the query object has already finished with less than limit records
This violates the common reading of the terms of the spec for pagination:
#. If there is a page prior to the current one, we would include the ``prev`` **and** ``first`` relations. These tell the user what the previous page is and what the first page is.
#. If there is a page after the current one, we would include the ``next`` **and** ``last`` relations. These are the opposites to ``prev`` and ``first`` respectively.
(I suppose this can be read differently, such that these links are always present, and we are merely extra affirming their presence when they are useful. But this is an unusual reading.)
Note that fixing this bug does mask problems with regions and projects with respect to parsing marker args, but that can be resolved separately of course. For now this masking is helpful (!) in making progress with the client.
This bug is the real underlying reason why the pagination generator in the client would always make one extra REST API call; see the now invalid https:/
Change abandoned by Jim Baker (<email address hidden>) on branch: master /review. openstack. org/436760
Review: https:/
Reason: Such links can be useful in the case of tailing a resource collection, so abandoning. Also we will fix specific pagination problems against resources and projects, vs the workaround this patch would have provided.