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

Merged opened this

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

Merged

scout/forge:scout/11230-get-openapi-json-describes-every-public → main 7 commits fork 1 thread · 1 unresolved

  • Merged. scout/11230-get-openapi-json-describes-every-public was merged into main as 7bd4f86.

Review

Sign in to review this change.
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", () => {
2929 const all = new Set(registered());
3030 expect(NOT_YET_DESCRIBED.filter((r) => !all.has(r))).toEqual([]);
3131 });
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);

Length >= 10 admits stubs like "Get things."; consider also rejecting summaries equal to the path or method+path.

36 expect(bare, `routes whose OpenAPI summary is empty or a stub:\n${bare.join("\n")}`).toEqual([]);
37 });

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs