Repository navigation
Description
API product implementation work · roadmap #1008 · use parent dependency order; not a separate product rank.
Part of #857. Stack rank 3 of 13. Depends on: T2 (consumes er-api-spec), T1 (references wire-struct schemas).
Color
The document finally describes operations — derived from the handler source, per the house decision written in both test headers: "a #[utoipa::path] response body, or any hand-maintained table, is one more claim that can drift from the code." Every routed handler already carries a doc comment shaped Role: summary (`METHOD /path`), and a handler the derivation cannot classify is a hard failure, not a skip. This ticket also adds the bearer securityScheme (the erk_… token format) — the first half of "a user sets up their own connection", and what makes Swagger UI's Authorize button work later.
Scope
er-server/src/openapi.rsbuilds the document programmatically (utoipa 6'sPathsBuilder/OperationBuilderoverer_api_spec::routes(include_str!("lib.rs"))): per route — summary, path parameters, asecurityrequirement naming the required role, request body ($refto the entity wire schema where the body type is an entity, derived inline schema otherwise), and responses at envelope granularity plus the{"detail": …}error body (a real contract — the BFF parses it).- Register the bearer security scheme in
components.securitySchemes. - Regenerate
openapi.json+schema.d.ts(snapshot test + CI byte-compare pin both). - Skills in this PR: rewrite
api-contract's "What is generated and not yet consumed → No path is described" section — it becomes false here.
Out of scope
Audience filtering / public document (T4). Typed response bodies (T7). Query parameters (T8).
Testing
- Snapshot test updated; a derivation-floor test (
paths count > 80— same pattern as the existing> 40tool floor). schema.d.ts'spathstype is no longerRecord<string, never>.- Spot-assert one route per envelope class (bare, wrapped, record, page, scalar, arrow) against
envelopes.json. make check+cd frontend && pnpm gen:apicommitted in the same PR.
Definition of done
Epic DoD, plus: every non-/v1/internal route present in the document with role, params and summary; the bearer scheme declared; the api-contract skill no longer claims zero paths.
Activity
athvin commentedon Nov 9, 2026
Claimed — working in #1063 (draft), 2026-11-09T20:44:41Z. Closing that PR releases the claim.
feat(api): derive OpenAPI operations and bearer security