danielgtaylor / danielgtaylor/openapi-cli-generator
Handle Pagination
- 主要言語
- Go
- スター
- 218
- フォーク
- 54
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
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.
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
調査の方向性
ファイル、テスト、エントリーポイントは指定されていません。まず cli パッケージの API レスポンス処理と生成されたコマンドフローを見つけ、次に 3 つのページネーションモデルを比較して、必要な OpenAPI 拡張と制限を判断してください。宣言されたモデルに従ってページネーションが一貫して処理され、適切なテストでカバーされていれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- go, openapi
- 領域
- api, cli
- issue の種類
- 機能追加
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 活発さ
- 停滞
- 明瞭さ
- 説明が足りない
- 初心者へのやさしさ
- 25/100