danielgtaylor / danielgtaylor/openapi-cli-generator

Handle Pagination

Open
#9 0 comments 0 reactions 0 assignees View on GitHub
feature help-wanted need-info
Dominant language
Go
Stars
218
Forks
54
PR merge metrics
No merged PRs in 30d

Description

For APIs with paginated responses, the `cli` package should include utilities for handling the response and fetching subsequent pages automatically up to some limit.

For example, the [GitHub API v3](https://developer.github.com/v3/#pagination) uses Link headers with hypermedia relations to provide pagination.

In general there seem to be three models in use:

1. Passing a page size and page number to get items. Maybe also some way to get a total page count.
2. Passing an iterator value to get the next set of items. When no iterator is (or no items are) returned you are done.
3. Using link relations to provide full URLs to fetch more items.

There should be a new OpenAPI extension to hint to the CLI which of these cases it is, how to handle it (e.g. parameter names), and whether to fetch all or expose limits via parameters in the CLI.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.