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
0 reputation · 23 Jul 2021, 08:04 UTC
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.
offset parameter zero‑based or one‑based in Travis CI’s builds endpoint?read_repo scope, which pagination fields are omitted, and how should clients detect this condition?A thoughtful contribution can make all the difference. Be the first to share one.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.