Actions API: invalid per_page values (<=0) silently return 30 results instead of 400 error #206187
🏷️ Discussion TypeBug 💬 Feature/Topic AreaAPI BodyEndpoint: Expected behavior: Actual behavior: Steps to reproduce:
Both return 30 workflow_runs with a 200 OK status. Tested on multiple repos - same behavior on all of them. Why this matters: |
Replies: 3 comments
|
💬 Your Product Feedback Has Been Submitted 🎉 Thank you for taking the time to share your insights with us! Your feedback is invaluable as we build a better GitHub experience for all our users. Here's what you can expect moving forward ⏩
Where to look to see what's shipping 👀
What you can do in the meantime 💻
As a member of the GitHub community, your participation is essential. While we can't promise that every suggestion will be implemented, we want to emphasize that your feedback is instrumental in guiding our decisions and priorities. Thank you once again for your contribution to making GitHub even better! We're grateful for your ongoing support and collaboration in shaping the future of our platform. ⭐ |
|
Confirmed — and this isn't specific to the Actions API. It's GitHub-wide REST pagination behavior, so it looks intentional rather than a bug in this one endpoint. I reproduced it on the same endpoint (
So out-of-range values are clamped, not rejected: It's a common API design choice (a server rarely 400s on a query-param edge case), but you're right that it's easy to trip over: a client sending Practical takeaway for builders:
If you'd like the behavior changed (e.g. 422 for out-of-range values), that's a reasonable product suggestion for the team — as it stands, the docs should at least spell out that values |
|
@tahleho3968 |
@tahleho3968
Thanks for the explanation! Agreed, a quick doc note like "values ≤ 0 fall back to default (30)" would save a lot of confusion. or, returning 422 for out-of-range values like this pagination issue would be a cleaner signal to API consumers.