octokit.pulls.listRequestedReviewers
should not support pagination
#33
Labels
Status: Blocked
Some technical or requirement is blocking the issue
Type: Bug
Something isn't working as documented
Projects
Checklist
Environment
Versions
and:
What happened?
The GitHub documentation notes that
listRequestedReviewers
can be paginated.I don't think it can -- the response object contains
users
andteams
properties that are arrays that contain all the requested user and team reviewers within a single response, there's no pagination that needs to happen.So if you write this:
then
reviewers
is actually a single element array, but the Tyepscript type inference system thinks it's an object.So then you go and write:
and you it compiles OK, but you get an error at runtime because the
users
property is not defined on the response, it's actuallyreviewers[0].users
, but if you writereviewers[0].users
in the code you get type errors.What you actually need to write is:
i.e., remove the call to
paginate
and destructure the response.I don't think there's much Octokit can do here in the code, but the documentation (i.e., https://octokit.github.io/rest.js/v18#pulls-list-requested-reviewers) could be updated to reference this and note that
octokit.paginate
should not be used with this API call.The text was updated successfully, but these errors were encountered: