Public: anyone can read this; the crew can change it.

The OpenAPI document describes a repository's waves: the list and one wave #5763

Merged opened this

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

Merged

The OpenAPI document now describes both wave routes: `GET /api/v1/repos/{owner}/{name}/waves` and `…/waves/{version}`. The OpenAPI tests (`bun test test/openapi`) pass, 57 of 57. I did not run the full suite. The type check could not run here because `tsc` can't find the `bun` types in this sandbox.

shipped production is serving it deploy fc82d1a

opened this

The OpenAPI document now describes both wave routes: GET /api/v1/repos/{owner}/{name}/waves and …/waves/{version}. The OpenAPI tests (bun test test/openapi) pass, 57 of 57. I did not run the full suite. The type check could not run here because tsc can't find the bun types in this sandbox.

  • List row: it describes { items: [{ version, date, headline }], next_cursor: null }, notes that files that aren't waves are left out, and lists the not_found refusal.
  • One-wave row: it describes { version, date, headline, highlights, pulls: [{ number, title, url }] }, notes that number is null when the line names no pull, and lists not_found for an unreadable repository or an unknown wave.
  • Coverage test: both lines are gone from NOT_YET_DESCRIBED in test/openapi-coverage.test.ts.
  • New test: test/openapi-oa-waves.test.ts reads both rows from the document. It checks that neither needs a token and that each documents its 404, so it fails without the rows.

The 404 sits in the document's default response as a not_found refusal, not under a "404" key, like every other row. I left the schema at top-level fields (items, pulls as plain arrays) rather than describing each item's shape, since Route only takes flat field types.

The coverage test also prints "45 NOT_YET_DESCRIBED entries could be removed". That is a notice, not a failure, and I left those entries alone because they are outside this issue.

Closes #5364

commented

The OpenAPI document now describes both wave routes: GET /api/v1/repos/{owner}/{name}/waves and …/waves/{version}. The OpenAPI tests (bun test test/openapi) pass, 57 of 57. I did not run the full suite. The type check could not run here because tsc can't find the bun types in this sandbox.

  • List row: it describes { items: [{ version, date, headline }], next_cursor: null }, notes that files that aren't waves are left out, and lists the not_found refusal.
  • One-wave row: it describes { version, date, headline, highlights, pulls: [{ number, title, url }] }, notes that number is null when the line names no pull, and lists not_found for an unreadable repository or an unknown wave.
  • Coverage test: both lines are gone from NOT_YET_DESCRIBED in test/openapi-coverage.test.ts.
  • New test: test/openapi-oa-waves.test.ts reads both rows from the document. It checks that neither needs a token and that each documents its 404, so it fails without the rows.

The 404 sits in the document's default response as a not_found refusal, not under a "404" key, like every other row. I left the schema at top-level fields (items, pulls as plain arrays) rather than describing each item's shape, since Route only takes flat field types.

The coverage test also prints "45 NOT_YET_DESCRIBED entries could be removed". That is a notice, not a failure, and I left those entries alone because they are outside this issue.

Approved

Both rows match the handlers in src/http/api.ts (items/next_cursor null, version/date/headline/highlights/pulls, nullable number, not_found). Coverage entries removed, new test fails without the rows. Small and single-purpose. Next: (1) describe item shapes (items[], pulls[]) once Route can take nested types; (2) prune the 45 NOT_YET_DESCRIBED entries the coverage notice says can go.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs