Reject `limit=0` in paginated requests
メンテナーはふだん 4 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
server/app/interfaces/base.py の BaseWSGIApp._get_slice() と、既存の負の limit の処理から始めてください。server/test/interfaces/test_base.py の TestPagination に limit=0 のケースを追加し、そのテストを実行してください。ゼロが 400 Bad Request で拒否され、ページネーションのテストが通れば完了です。
索引モデルが issue の本文から書いたものです。
説明
Currently, BaseWSGIApp._get_slice() accepts limit=0, because it parses limit as a NonNegativeInteger. With limit=0, the server returns an empty page together with a cursor pointing to the same position as the request. For example, GET /shells?limit=0 on a non-empty repository returns:
{"paging_metadata":{"cursor":"1"},"result":[]}
A client that follows the cursor until it becomes None therefore loops forever.
The specification (IDTA-01002-3-1, v3.1.2) contradicts itself on whether limit=0 is valid:
- The OpenAPI definition of
limitsetsminimum: 1. - The pagination parameter table defines
LimitasnonNegativeInteger, which allows0.
To me, a page size of 0 is no meaningful behavior as it cannot make progress through a result set.
Rejecting it is the only sensible option, and it matches the OpenAPI definition.
_get_slice() should reject limit=0 with 400 Bad Request, the same way it already rejects negative values. A test for this case should be added to TestPagination in server/test/interfaces/test_base.py.
- 主要言語
- Python
- スター
- 105
- フォーク
- 56
- 平均マージ
- 11日 9時間
- マージ済み PR(30日)
- 4
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
eclipse-basyx/basyx-python-sdk のほかの issue
-
bug high priority server
難易度 2/5 1時間未満 初心者へのやさしさ 82/100
eclipse-basyx/basyx-python-sdk#662 ·
メンテナーはふだん 4 日以内に返信
-
README CI badge is broken対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンbug documentation
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
eclipse-basyx/basyx-python-sdk#656 ·
メンテナーはふだん 4 日以内に返信
-
bug sdk
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
eclipse-basyx/basyx-python-sdk#634 · コメント 3 件 ·
メンテナーはふだん 4 日以内に返信
-
enhancement server
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
eclipse-basyx/basyx-python-sdk#632 ·
メンテナーはふだん 4 日以内に返信
-
bug high priority
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100
eclipse-basyx/basyx-python-sdk#631 ·
メンテナーはふだん 4 日以内に返信
eclipse-basyx/basyx-python-sdk の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
volcengine/OpenViking#6445 ·
メンテナーはふだん 1 日以内に返信
-
BUG:Edit Album strips spaces from the password so albums with a leading/trailing space in the password can't be edited対応中かも @ManyaJain111 が今日担当しました。 オープンbug enhancement possible-duplicate
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
AOSSIE-Org/PictoPy#1637 · コメント 4 件 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
deepspeedai/DeepSpeed#8884 ·
メンテナーはふだん 3 日以内に返信
-
Flaky: test_advisor_live_calibrates_an_unmeasured_circuit ranks engines by a 1.8ms sleep marginオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
flagos-ai/FlagQuantum#718 ·
メンテナーはふだん 1 日以内に返信
-
bug CI-failure high priority
難易度 1/5 1時間未満 初心者へのやさしさ 86/100
vllm-project/afd-plugin#483 ·
メンテナーはふだん 1 日以内に返信