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

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

scout/forge:scout/6619-the-openapi-document-describes-get-api-v → main 2 commits fork 1 thread · 1 unresolved

  • Merged. scout/6619-the-openapi-document-describes-get-api-v was merged into main as 7d4b5b8.

Review

Sign in to review this change.
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,

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.

8 refusals: BROWSE_REFUSALS,
9 };
src/contract/openapi/routes/index.ts +1
@@ -133,6 +133,7 @@ export { route as getApiV1UserKeys } from "./getApiV1UserKeys.ts";
133133 export { route as getApiV1UserOrgs } from "./getApiV1UserOrgs.ts";
134134 export { route as getApiV1UserOriginApps } from "./getApiV1UserOriginApps.ts";
135135 export { route as getApiV1UserOrigins } from "./getApiV1UserOrigins.ts";
136 export { route as getApiV1UserOriginsIdBrowseOwnerName } from "./getApiV1UserOriginsIdBrowseOwnerName.ts";
136137 export { route as getApiV1UserOriginsIdBrowseOwnerNameBlobRefPath } from "./getApiV1UserOriginsIdBrowseOwnerNameBlobRefPath.ts";
137138 export { route as getApiV1UserOriginsIdBrowseOwnerNameBranches } from "./getApiV1UserOriginsIdBrowseOwnerNameBranches.ts";
138139 export { route as getApiV1UserOriginsIdBrowseOwnerNameCommits } from "./getApiV1UserOriginsIdBrowseOwnerNameCommits.ts";
test/openapi-coverage.test.ts −1
@@ -9,7 +9,6 @@ import { ROUTES } from "../src/contract/openapi.ts";
99 * until you do.
1010 */
1111 const NOT_YET_DESCRIBED: readonly string[] = [
12 "GET /api/v1/user/origins/{}/browse/{}/{}",
1312 ];
1413
1514 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", () => {
3939 .replace(/"(PUT)",\s*`([^`]*)\$\{kind\}([^`]*)`/g, (_, m, a, b) => `"${m}", "${a}issues${b}"\n"${m}", "${a}pulls${b}"`);
4040 const browse = /const BROWSE = "([^"]+)"/.exec(src)![1]!;
4141 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] ?? "")}`,
4444 ),
4545 );
4646 const shape = (p: string) => p.replace(/\{\w+\}|[:*]\w+/g, ":");

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs