Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Traversing with Pagination #285

Closed
elbaulp opened this issue Oct 26, 2019 · 3 comments
Closed

Traversing with Pagination #285

elbaulp opened this issue Oct 26, 2019 · 3 comments

Comments

@elbaulp
Copy link

elbaulp commented Oct 26, 2019

Is there a way of traversing with Pagination as explained here? I could not find anything in the docs or code

So far, the only way I could find to do it is to look at the link header in the response headers. But seems a very complicated way to do it, since all tags are shown as a single string:

Link | <https://api.github.com/organizations/9919/members?page=1&per_page=1>;  rel="prev",  <https://api.github.com/organizations/9919/members?page=3&per_page=1>;  rel="next",  <https://api.github.com/organizations/9919/members?page=214&per_page=1>;  rel="last",  <https://api.github.com/organizations/9919/members?page=1&per_page=1>;  rel="first"
@BenFradet
Copy link
Contributor

Hey, here is how I did it: https://github.com/BenFradet/dashing/blob/e452e9c1d7032ec8199ed9de370680be945a16ee/server/src/main/scala/dashing/server/utils.scala#L112-L135

@dcsobral
Copy link
Contributor

@BenFradet Your solution has two issues. First, by enumerating the pages beforehand, it may fail due to changes in number of pages. Open PRs filter might find itself fetching a page that does not exist, and there's always the risk of fetching too few pages.

The second is that github API documentation repeatedly emphasizes that one must not construct the URL, but use the one given. The inability to do that is a flaw on github4s API.

@BenFradet
Copy link
Contributor

closing as dupe of #169

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants