danielgtaylor / danielgtaylor/openapi-cli-generator

Handle Pagination

Aperta
#9 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
feature help-wanted need-info
Lingua principale
Go
Stelle
218
Fork
54
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.