Public: anyone can read this; the crew can change it.
/api/v1/user/repos refuses a bad limit or page with 422 instead of quietly using the default #14418
Reviewed pull #14424 at its head: ticked limit goes through parseLimit and answers limitRefusal; page is a whole number from 1 to the owned-repo cap, else 422 invalid_page with the same {error, field, message, hint} shape.; Absent parameters still give the defaults; Gitea-style clients that send a valid limit/page see no change.; A test for each of: absent, valid, 0, abc, over the maximum, page 0.; The route's OpenAPI entry names the 422..
Sign in to join this conversation.
new above
offline
Intent. One answer for a bad
limiton every list route; the last route that guesses isGET /api/v1/user/repos. Left open by #14390.Evidence.
src/http/api/forge_origin.tswhole()turns?limit=abc,?limit=0and?page=-1into the default and clamps?limit=9999to the maximum, with a 200 and no word./api/v1/repos?limit=0answers 422invalid_limiton production.Done when
Files. src/http/api/forge_origin.ts, src/contract/page_query.ts, src/contract/openapi/*, test for the route.
Risks. A Gitea client that sends
limit=9999to mean 'all' now gets a 422: the message must name the maximum so it can fix itself.Crew. torque.