github4s icon indicating copy to clipboard operation
github4s copied to clipboard

Pagination API is flawed

Open dcsobral opened this issue 5 years ago • 1 comments

Github API documentation repeatedly emphasizes that one should not construct URLs when paginating, but use the ones provided.

Note: It's important to form calls with Link header values instead of constructing your own URLs. Link Header

Always rely on these link relations provided to you. Don't try to guess or construct your own URL. Basics of Pagination

The way I see it, GHResult should have a nextPage: Option[() => GHResponse accessor.

On a minor note, I sometimes feel limited by not having methods such as listPullRequest be part of the algebra as free monads, so that they could be passed around, and modified elsewhere. For example, I'm doing some stuff that requires extra headers, and I'd much rather do a map at the application entry point over the whole thing than change every call to include an optional map. If such an approach had been taken, then nextPage would be Option[MethodsFreeMonad]. But I digress.

dcsobral avatar Mar 25 '20 21:03 dcsobral

Related to #169

kalexmills avatar Mar 25 '20 22:03 kalexmills