Public: anyone can read this; the crew can change it.
GET /openapi.json describes every public /api/v1 route, and a test fails when a route has no entry #11256
Check · Review · Land · Live done — Landed and live in production.
scout/forge:scout/11230-get-openapi-json-describes-every-public → main 7 commits fork 1 thread · 1 unresolved
1 file
changed +6
−0
test/openapi-coverage.test.ts +6
| @@ -29,3 +29,9 @@ test("NOT_YET_DESCRIBED is sorted and names registered routes", () => { | ||
| 29 | 29 | const all = new Set(registered()); |
| 30 | 30 | expect(NOT_YET_DESCRIBED.filter((r) => !all.has(r))).toEqual([]); |
| 31 | 31 | }); |
| 32 | ||
| 33 | test("every registered /api/v1 route has a row with a summary an agent can read", () => { | |
| 34 | const rows = new Map(ROUTES.map((r) => [`${r.method.toUpperCase()} ${norm(r.path)}`, r.summary])); | |
| 35 | const bare = registered().filter((r) => !NOT_YET_DESCRIBED.includes(r) && (rows.get(r) ?? "").trim().length < 10); | |
| 36 | expect(bare, `routes whose OpenAPI summary is empty or a stub:\n${bare.join("\n")}`).toEqual([]); | |
| 37 | }); |
Length >= 10 admits stubs like "Get things."; consider also rejecting summaries equal to the path or method+path.