forked from 0xWheatyz/SPARC
Add cursor-based pagination to /analyze/batch and /jobs endpoints #658
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
Roadmap item: P3 — API Pagination
The
/analyze/batchand/jobsendpoints return all records. For large result sets this will become slow and memory-intensive.What to do
cursor(opaque string encoding the last-seen record ID or timestamp) and alimit(default 20, max 100)next_cursorfield (null if no more results)Acceptance criteria
GET /jobs?limit=10returns at most 10 results and anext_cursorGET /jobs?limit=10&cursor=<value>returns the next pagenext_cursorisnullon the last pageClosing as already implemented. Cursor-based pagination is implemented on the
/jobsendpoint inapi.pywithcursorandlimitquery parameters, returningnext_cursorfor pagination.