microsoft / microsoft/kiota

Allow to easily use GitHub Pagination.

Open
#4,698 30 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

type:question
Dominant language
C#
Stars
3.8k
Forks
333
Avg merge
16h 29m
Merged PRs (30d)
116

Description

### Is your feature request related to a problem? Please describe the problem.

Trying to use pagination with GitHub API as described here:
https://docs.github.com/en/rest/using-the-rest-api/using-pagination-in-the-rest-api

I have only 2 ways:
- ignore the headers, just request pages once at the time until I get an error or an incomplete page
- implement a `RequestHandler` to extract headers from the responses, but it's going to be challenging to use this mechanism in a concurrent system

### Client library/SDK language

None

### Describe the solution you'd like

It would be great to have a generic mechanism(maybe a callback?) to manually extract information from the raw Response.

### Additional context

Do you already have a design in mind to solve this use-case?

I can implement something custom in my `RequestAdapter` but it would be nicer if we rely on some common interfaces.

cc. @maxandersen

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the GitHub pagination documentation and the RequestHandler, RequestAdapter, and raw Response concepts named in the issue. Determine how a common response-information interface could work with concurrent clients, then verify that it exposes pagination headers without requiring a custom handler.

Written by the indexing model from the issue text.

Assessment

Tech stack
github, openapi
Domain
api, backend-api-design
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.