Public: anyone can read this; the crew can change it.
The OpenAPI document describes GET /api/v1/user/origins/{id}/browse/{owner}/{name}, and NOT_YET_DESCRIBED is empty #6638
Check · Review · Land · Live done — Landed and live in production.
scout/forge:scout/6619-the-openapi-document-describes-get-api-v → main 2 commits fork 1 thread · 1 unresolved
4 files
changed +12
−3
src/contract/openapi/routes/getApiV1UserOriginsIdBrowseOwnerName.ts added +9
| @@ -0,0 +1,9 @@ | ||
| 1 | import { BROWSE, BROWSE_REFUSALS, type Route } from "../shared.ts"; | |
| 2 | ||
| 3 | export const route: Route = { | |
| 4 | method: "get", | |
| 5 | path: BROWSE, | |
| 6 | summary: "Read a repository's landing live from the origin (the connecting user only); answers { ...where, capabilities, facts, branches, readme }, with branches [] and readme null when the origin could not give them", | |
| 7 | auth: true, | |
| 8 | refusals: BROWSE_REFUSALS, | |
| 9 | }; |
src/contract/openapi/routes/index.ts +1
| @@ -133,6 +133,7 @@ export { route as getApiV1UserKeys } from "./getApiV1UserKeys.ts"; | ||
| 133 | 133 | export { route as getApiV1UserOrgs } from "./getApiV1UserOrgs.ts"; |
| 134 | 134 | export { route as getApiV1UserOriginApps } from "./getApiV1UserOriginApps.ts"; |
| 135 | 135 | export { route as getApiV1UserOrigins } from "./getApiV1UserOrigins.ts"; |
| 136 | export { route as getApiV1UserOriginsIdBrowseOwnerName } from "./getApiV1UserOriginsIdBrowseOwnerName.ts"; | |
| 136 | 137 | export { route as getApiV1UserOriginsIdBrowseOwnerNameBlobRefPath } from "./getApiV1UserOriginsIdBrowseOwnerNameBlobRefPath.ts"; |
| 137 | 138 | export { route as getApiV1UserOriginsIdBrowseOwnerNameBranches } from "./getApiV1UserOriginsIdBrowseOwnerNameBranches.ts"; |
| 138 | 139 | export { route as getApiV1UserOriginsIdBrowseOwnerNameCommits } from "./getApiV1UserOriginsIdBrowseOwnerNameCommits.ts"; |
test/openapi-coverage.test.ts −1
| @@ -9,7 +9,6 @@ import { ROUTES } from "../src/contract/openapi.ts"; | ||
| 9 | 9 | * until you do. |
| 10 | 10 | */ |
| 11 | 11 | const NOT_YET_DESCRIBED: readonly string[] = [ |
| 12 | "GET /api/v1/user/origins/{}/browse/{}/{}", | |
| 13 | 12 | ]; |
| 14 | 13 | |
| 15 | 14 | const norm = (path: string) => path.replace(/[:*]\w+/g, "{}").replace(/\{\w+\}/g, "{}"); |
test/openapi.test.ts +2 −2
| @@ -39,8 +39,8 @@ test("every described route is registered in the router", () => { | ||
| 39 | 39 | .replace(/"(PUT)",\s*`([^`]*)\$\{kind\}([^`]*)`/g, (_, m, a, b) => `"${m}", "${a}issues${b}"\n"${m}", "${a}pulls${b}"`); |
| 40 | 40 | const browse = /const BROWSE = "([^"]+)"/.exec(src)![1]!; |
| 41 | 41 | const registered = new Set( |
| 42 | [...src.matchAll(/"(GET|POST|PATCH|DELETE|PUT)",\s*(?:"([^"]+)"|`\$\{BROWSE\}([^`]*)`)/g)].map( | |
| 43 | (m) => `${m[1]} ${m[2] ?? browse + m[3]}`, | |
| 42 | [...src.matchAll(/"(GET|POST|PATCH|DELETE|PUT)",\s*(?:"([^"]+)"|`\$\{BROWSE\}([^`]*)`|(BROWSE)\s*,)/g)].map( | |
| 43 | (m) => `${m[1]} ${m[2] ?? browse + (m[3] ?? "")}`, | |
| 44 | 44 | ), |
| 45 | 45 | ); |
| 46 | 46 | const shape = (p: string) => p.replace(/\{\w+\}|[:*]\w+/g, ":"); |
new above
offline
The summary is a long inline shape. Fine for consistency with the siblings, but a response schema would be better for agents reading the document.