Reject `limit=0` in paginated requests
Maintainers usually reply within 4 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 88/100
Research direction
Start with BaseWSGIApp._get_slice() in server/app/interfaces/base.py and the existing negative-limit handling. Add a limit=0 case to TestPagination in server/test/interfaces/test_base.py, then run that test. Done means zero is rejected with 400 Bad Request and the pagination tests pass.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- Python
- Stars
- 104
- Forks
- 56
- Avg merge
- 12d 13h
- Merged PRs (30d)
- 5
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from eclipse-basyx/basyx-python-sdk
-
README CI badge is brokenPossibly taken A pull request linked to this issue is open or already merged. Openbug documentation
Difficulty 1/5 Under an hour Newbie friendliness 85/100
eclipse-basyx/basyx-python-sdk#656 ·
Maintainers usually reply within 4 days
-
bug sdk
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
eclipse-basyx/basyx-python-sdk#634 · 3 comments ·
Maintainers usually reply within 4 days
-
enhancement server
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
eclipse-basyx/basyx-python-sdk#632 ·
Maintainers usually reply within 4 days
-
bug high priority
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
eclipse-basyx/basyx-python-sdk#631 ·
Maintainers usually reply within 4 days
-
server: Discovery endpoints status code mismatchPossibly taken @JAB1305 claimed this 17 days ago. Openbug high priority server
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
eclipse-basyx/basyx-python-sdk#625 · 1 comment ·
Maintainers usually reply within 4 days
All issues in eclipse-basyx/basyx-python-sdk
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 83/100
PedestrianDynamics/pyFDS-Evac#766 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 1-3 hours Newbie friendliness 91/100
alchaincyf/nuwa-skill#86 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 2 days
-
Docs Needs Triage
Difficulty 1/5 Under an hour Newbie friendliness 88/100
pandas-dev/pandas#71055 ·
Maintainers usually reply within 1 day
-
[Bug]: graphify reads files that git's global ignore file hidesPossibly taken @smngvlkz claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Graphify-Labs/graphify#4335 · 1 comment ·
Maintainers usually reply within 1 day