Reject `limit=0` in paginated requests
Maintainer thường phản hồi trong vòng 4 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 88/100
Hướng nghiên cứu
Bắt đầu với BaseWSGIApp._get_slice() trong server/app/interfaces/base.py và phần xử lý giới hạn âm hiện có. Thêm trường hợp limit=0 vào TestPagination trong server/test/interfaces/test_base.py, sau đó chạy bài kiểm thử đó. Hoàn thành khi giá trị 0 bị từ chối bằng 400 Bad Request và các bài kiểm thử phân trang đều đạt.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Python
- Star
- 106
- Fork
- 59
- Merge trung bình
- 4 ngày 1 giờ
- Pull request đã merge (30 ngày)
- 3
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của eclipse-basyx/basyx-python-sdk
-
server: XML responses contain `cursor="None"` on the last pageCó thể đã có người làm @qiaobochi040726-source đã nhận 2 ngày trước. Đang mởbug good-first-issue server
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
eclipse-basyx/basyx-python-sdk#673 ·
Maintainer thường phản hồi trong vòng 4 ngày
-
adapter.aasx: Failsafe writer adds duplicate parts for conflicting filesCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởbug good-first-issue sdk
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
eclipse-basyx/basyx-python-sdk#671 ·
Maintainer thường phản hồi trong vòng 4 ngày
-
enhancement good-first-issue server
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
eclipse-basyx/basyx-python-sdk#670 ·
Maintainer thường phản hồi trong vòng 4 ngày
-
bug good-first-issue sdk
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
eclipse-basyx/basyx-python-sdk#665 ·
Maintainer thường phản hồi trong vòng 4 ngày
-
bug server
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
eclipse-basyx/basyx-python-sdk#663 ·
Maintainer thường phản hồi trong vòng 4 ngày
Tất cả issue của eclipse-basyx/basyx-python-sdk
Issue tương tự
-
The changelog workflow excludes otelbot but not dependabot, so every Dependabot pull request fails the changelog checkCó thể đã có người làm @ocelotl đã nhận hôm nay. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 82/100
open-telemetry/opentelemetry-python#5825 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
cuga-project/cuga-agent#1020 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 70/100
microsoft/playwright#43640 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
stac-utils/stac-fastapi-elasticsearch-opensearch#965 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
from-review-extraction library privacy python severity:suggested
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
LearningCircuit/local-deep-research#7951 ·
Maintainer thường phản hồi trong vòng 2 ngày