The checked-in OpenAPI 3.1 JSON describes the current
unversioned HTTP API. Its version follows api/package.json, currently 0.8.0.
The contract is an integration artifact, not a declaration that 1.0.0 or API v1
has shipped.
pnpm api:spec
pnpm api:spec:check
pnpm check
pnpm testGeneration runs offline, does not load .env, and does not connect to a
database, storage provider or mail service. Commit the generator sources and
regenerated JSON together. Do not hand-edit docs/openapi.json.
The normal pnpm test suite already includes contract validation, so CI rejects
an outdated artifact or a route inventory mismatch without a separate workflow.
Use a local OpenAPI-capable viewer/editor to browse the artifact. Nothing is
uploaded or published by these commands.
api/src/server.tsand HTTP/service validators define actual behavior.api/scripts/openapi/helpers.tscontains shared OpenAPI response/parameter builders, including cookie and trusted-Origin requirements.api/scripts/openapi/auth.ts,posts.ts,media.tsandpublishing.tsdescribe existing operations and reuse exported Zod input validators.api/scripts/openapi/schemas.tsdescribes wire responses, not database rows.api/scripts/openapi/document.tsassembles metadata and local references.api/scripts/generate-openapi.tswrites the reproducible artifact.
The artifact includes sensitive-operation descriptions, but no credentials, real user records, session values, signed URLs or enrollment secrets.
Some HTTP-local input shapes are mirrored in the generator; update both when changing them. Custom Zod refinements, normalization, aggregate UTF-8 limits, cross-field rules and database state cannot all be expressed by JSON Schema. Those constraints remain explicit operation/schema descriptions and service tests. For example, login requires exactly one identifier, a changed password must differ, vault paths must be safe, and scheduled posts must remain drafts.
- A pinned development-only Swagger Parser validates OpenAPI structure and resolves component references.
- Regeneration must match the checked-in JSON exactly.
- TypeScript AST inspection expands the router's explicit regex alternatives and optional paths, then compares every method/path against the artifact. An unsupported new route pattern fails rather than silently disappearing.
- Operation IDs are unique; every mutation declares required trusted Origin; administrator paths declare session authentication and the admin role.
- Sample real in-memory HTTP responses validate the user/post models used by the generator, private-content masking, missing-Origin rejection and 204.
These are not exhaustive request/response validation for every operation. Existing domain and HTTP tests remain necessary. Local fixtures do not prove hosted Vercel, PostgreSQL, R2, SMTP or multi-instance behavior.
Keep the freeze gate open until the following are reviewed and recorded:
- Approve input/output shapes, stable error identifiers, pagination, auth, Origin requirements and the partial-field PUT convention.
- Decide how future breaking changes are versioned; current paths stay
/api/*until that decision is implemented and tested. - Exercise supported Node and hosted Vercel integrations, including cookies, optional-service 503 behavior and the UUID/slug distinction.
- Add regression cases for identified compatibility risks and document any accepted exceptions. Broader live contract validation remains pending.
- Complete the 0.9.0 recovery/accessibility/hosting gates and the remaining 1.0.0 roadmap, then separately authorize publication.
Runtime health routing differs by deployment: standalone /health reports
service/license; unified Node intercepts it with a status-only payload and
adds /health/live and /health/ready. Those deployment probes are not
invented as standalone API routes in the contract.