github-api icon indicating copy to clipboard operation
github-api copied to clipboard

Pagination Support

Open rdeutz opened this issue 10 years ago • 2 comments

That's more a question to the maintainer(s). Any plans to implements pagination or should this be handled outside the package? At least we need to implement a way to get the headers. Some guidance would be great, I need pagination in one of my projects and have it implemented, but it can't be done without a B/C break. Form what I can see in the 2.0-branch it is still not possible to paginate the results. So the options I see are:

  1. just return to response object and let the outside class handle pagination
  2. implement a pagination class and return body and pagination object

Either way is fine, if I know what is the preference I could work on a PR.

rdeutz avatar Nov 23 '15 17:11 rdeutz

#19 shows how easy it is to make the change (actually unless something isn't using that processResponse method it's already 100% done), the long part is in changing the unit test infrastructure.

FWIW I've taken the same type of approach I proposed on #19 in my own package (see https://github.com/BabDev/Transifex-API/compare/1.x...master for the changes, including how to DRY out the duplicated unit test logic).

I've gone ahead and restored the Return-Response branch that RFC was based on. IMO that is the quickest route to make available the data that's being stripped out with the current return structure.

mbabker avatar Nov 23 '15 17:11 mbabker

ok, so the answer is: 1)

and let the outside class handle pagination. Good I can check the unit tests.

rdeutz avatar Nov 23 '15 17:11 rdeutz