diff --git a/CLAUDE.md b/CLAUDE.md index 204a798..ff418de 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -151,7 +151,10 @@ main. A change is done when the gate passes and the docs under `docs/` (or entry in the table in `server/routes.go`, never a direct `app.Get`/`Post`; it also needs its case in `TestRoutesConform`, which fails for a route without one, and `TestRegisteredRoutesAreTheTable` - fails for a route registered outside the table. + fails for a route registered outside the table. API inputs go in the + JSON body, never in query parameters: the path holds only a + resource's ID or a fixed word naming the route, and a `GET` takes no + inputs beyond its path (design.md, "Inputs go in the JSON body"). - An enum value or a limit goes into the field's `jsonschema` tag. The tests in `receipt/schema_test.go`, `printqueue/schema_test.go` and `server/schema_test.go` hold the tags to validation, to the Go constants diff --git a/docs/design.md b/docs/design.md index d880fdf..7038679 100644 --- a/docs/design.md +++ b/docs/design.md @@ -498,6 +498,18 @@ client ─HTTPS─▶ Caddy ─▶ server ── validate ──▶ printqueue ( `error` is for people. A refusal is answered and never logged as a failure. An unexpected error or panic is logged once and reported to Sentry once, without the body or the `Authorization` header. +- **Inputs go in the JSON body (owner, 2026-12-01).** An API input goes in + the request's JSON body, never in a query parameter. The path holds only + a resource's ID, or a fixed word that names the route, as `last`, + `failed` and `uncertain` do in `/jobs/.../reprint`. A `GET` takes no + inputs beyond its path. Some of the API breaks the rule today, and a + later change makes it follow: + - the module routes' `copies` and `printer` query parameters, and the + `invalid_query` error code that refuses them; + - the `?printer=` that docs/plans/printers.md puts on `/print`, + `/preview` and the module routes; + - the filters and paging that docs/plans/job-store.md's phase 2 puts in + the query of `GET /api/v1/jobs` (its decision 16). - **The OpenAPI document is generated (owner, 2026-11-30).** One route table drives both the server's routes and `docs/swagger.json`, so the document cannot describe a route the server lacks. Schemas come from the