racket-github-api
racket-github-api copied to clipboard
Pagination & Ratelimiting
It appears the Link (for pagination) and X-RateLimit-* headers are discarded and not inserted into github-response structs. I'm not sure if you're still maintaining this repo, but figured I'd open a ticket anyway :)
My first thought would be to extend the struct with two more fields, but unfortunately that'd probably break some existing code - such as using the struct match expander on github-response structs.
Another option could be to make a new struct that inherits from github-response, but this could get messy.
Finally the backwards compatibility could be ignored :skull_and_crossbones: - but I don't think this is the best bet.
Hey, thanks for letting me know about this. I'll take a look at it soon. Sorry about the wait.
I noticed this as well. While displaying all the issues for racket/racket you only get 30 results and no way to find next page. @eu90h will you have time to look into this?
In case it helps @pmatos or anyone else until a more permanent fix is in place, I was able to get around the pagination problem by calling the function returned by github-api with my own API request and adding the pagination parameters manually:
(define G-API (github-api my-github-id))
(define request
(format "/repos/OWNER/REPO/issues/ISSUE#/comments?page=~a&per_page=100" page))
(define response
(github-response-data (G-API request #:media-type "")))
You can keep incrementing page until (length response) is 0.
@otherjoel thanks for the suggestion