param is missing or the value is invalid: limit must be an integer – Travis CI builds endpoint pagination
0 reputation · 23 Jul 2021, 08:04 UTC
Understanding Offset Indexing and Empty Result Behavior
The Travis CI REST API v3 exposes a /repos/:slug/builds collection that accepts limit and offset query parameters for pagination. While the API documentation specifies a default limit of 25 and a maximum of 100, the exact semantics of offset remain unclear: is it zero‑based or one‑based? This ambiguity can cause off‑by‑one errors when retrieving the first or last page of builds.
Another point of uncertainty is how the API signals that a client has reached the end of the collection. When offset exceeds the total number of builds, the API currently returns an empty array ([]) with an HTTP 200 status. It is unknown whether this empty array is a definitive indicator of completion or merely a transient state that could be followed by non‑empty results if new builds are created.
Additionally, the pagination.total_count field is sometimes omitted for private repositories when the OAuth token lacks the read_repo scope, potentially leading to misinterpretation of pagination boundaries.
- Is the
offsetparameter zero‑based or one‑based in Travis CI’s builds endpoint? - Does an empty array response guarantee that no further builds exist, or can new builds appear after such a response?
- When a token lacks
read_reposcope, which pagination fields are omitted, and how should clients detect this condition?