Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Reject `limit=0` in paginated requests

Aperta Adatta ai principianti
#655 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 4 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
88/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python
Ambito
api

Direzione di ricerca

Inizia da BaseWSGIApp._get_slice() in server/app/interfaces/base.py e dalla gestione esistente dei limiti negativi. Aggiungi un caso limit=0 a TestPagination in server/test/interfaces/test_base.py, poi esegui quel test. Il lavoro è completato quando zero viene rifiutato con 400 Bad Request e i test di paginazione passano.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug server Specification

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:

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.

Lingua principale
Python
Stelle
104
Fork
56
Merge medio
12g 13h
PR unite (30g)
5

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di eclipse-basyx/basyx-python-sdk

Tutte le issue di eclipse-basyx/basyx-python-sdk

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.