Docs: every v2 route documents its body, answer and parameters (1.52.1)
Most routes answered by a v1 handler showed an empty body and
`data: unknown` in /docs/v2. Each now documents what its handler reads
and answers, and every path and query parameter is described.
- `documented: { body?, response? }` on v1Route/defineRoute, with shared
shapes in src/v2/docs.ts. Documentation only: not enforced, so nothing
that works can start failing; outside production a body or answer that
doesn't fit is logged ("doesn't match its documented schema").
- QUERY_HELP / PATH_HELP describe common parameters; empty bodies say
"No body needed".
- Declared the funnel's eventIds and webhook deliveries' status/before.
- tests/v2Docs.test.ts keeps the document complete; frontend types
regenerated, three call sites' types tightened (no payload change).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -7,6 +7,25 @@ and this project follows [Semantic Versioning](https://semver.org/).
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
## [1.52.1] - 2026-11-02
|
||||
|
||||
### Changed
|
||||
|
||||
- **The API documentation (`/docs/v2`, `GET /api/v2/openapi.json`) now describes every route in
|
||||
full.** Before, most routes answered by a v1 handler showed an empty body and `data: unknown`.
|
||||
Each one now documents the body it reads and what it answers, from the handler's actual code, and
|
||||
every path and query parameter has a description. Actions that take no input say "No body
|
||||
needed".
|
||||
- How: `documented: { body?, response? }` on `v1Route` (and `defineRoute`), with shared shapes in
|
||||
`src/v2/docs.ts`. These are documentation only — requests and answers aren't checked against
|
||||
them, so nothing an app already does can start failing — but outside production a body or
|
||||
answer that doesn't fit is logged (`[api/v2] … doesn't match its documented schema`).
|
||||
`tests/v2Docs.test.ts` keeps the document complete.
|
||||
- The funnel report's `eventIds` and the webhook deliveries' `status`/`before` filters are now
|
||||
declared (they worked, but weren't in the document or the typed frontend calls).
|
||||
- The frontend's generated API types are richer; a few calls had their types tightened to match
|
||||
(ticket transfer, breach register, kids check-out). Nothing changes in what they send.
|
||||
|
||||
## [1.52.0] - 2026-11-02 — urgent
|
||||
|
||||
### Fixed
|
||||
|
||||
Reference in New Issue
Block a user