octokit.rb icon indicating copy to clipboard operation
octokit.rb copied to clipboard

Description about the default value of the `per_page` option

Open ybiquitous opened this issue 5 years ago • 2 comments

Hi there,

I found the difference between README and the actual code, about the default per_page value.

REAMDE: 30

Default results from the GitHub API are 30, if you wish to add more you must do so during Octokit configuration.

https://github.com/octokit/octokit.rb/blob/c5037e4abbf154b2123019e8d109e24490bf1be5/README.md#default-results-per_page

Code: 100

https://github.com/octokit/octokit.rb/blob/116ddac2a9c962b4016ca31fb69f62b14361adb0/lib/octokit/connection.rb#L81

It seems that the README description is incorrect, but what do you think? Thanks.

ybiquitous avatar Mar 25 '20 06:03 ybiquitous

@ybiquitous the actual GitHub API defaults to 30 if we don't pass in a per_page query parameter. It looks like we set it in the client as 100 if we are auto paginating so that we make fewer requests.

I'm not sure I see the inconsistency here.

tarebyte avatar Mar 25 '20 12:03 tarebyte

Surely, there is no inconsistency. But the behavior, which per_page is 100 if auto_paginate is set, seems undocumented and may confuse users (like me 😅 ).

So, what about documenting that behavior on this README?

ybiquitous avatar Mar 25 '20 12:03 ybiquitous

👋 Hey Friends, this issue has been automatically marked as stale because it has no recent activity. It will be closed if no further activity occurs. Please add the Status: Pinned label if you feel that this issue needs to remain open/active. Thank you for your contributions and help in keeping things tidy!

github-actions[bot] avatar Jul 26 '23 01:07 github-actions[bot]