Plan the job list as POST /api/v1/jobs/list
The job-store plan's phase 2 listed the history at GET /api/v1/jobs,
with its status and source filters and its before and limit paging in
the query. A GET takes no inputs beyond its path, and every input goes
in the JSON body, so the owner chose a POST to a fixed word,
/api/v1/jobs/list. Job IDs start with job_, so list can never be one.
Decision 16 says so. An empty body, {} or none gives the newest 50 jobs.
A bad value, an unknown field or a before no longer kept answers a new
code, invalid_body, which the reprint routes' bodies share. The body's
enum and bounds sit in its jsonschema tags, so the generator needs no
typed query parameters, and that work leaves phase 2. Its tests and the
curl check follow.
design.md's Planned next names the route, and the rule says a read that
takes inputs is a POST. No plan breaks the rule now, so it lists none.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
c60d7531b2
commit
c0d058c9ce
2 files changed
+24
-25
No files matched your search
+10
-10
@@ -506,13 +506,12 @@ client ─HTTPS─▶ Caddy ─▶ server ── validate ──▶ printqueue (
|
||||
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. Every route answers a query string with `400`
|
||||
`invalid_query`, after the token and its scope under `/api/v1`, so a
|
||||
caller that still sends one learns so instead of having it ignored. The
|
||||
module routes' body holds the module's payload, `copies` and `printer`.
|
||||
One plan breaks the rule today, and a later change makes it follow:
|
||||
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).
|
||||
inputs beyond its path, so a read that takes inputs is a `POST`, as the
|
||||
planned job list, `POST /api/v1/jobs/list`, is. Every route answers a
|
||||
query string with `400` `invalid_query`, after the token and its scope
|
||||
under `/api/v1`, so a caller that still sends one learns so instead of
|
||||
having it ignored. The module routes' body holds the module's payload,
|
||||
`copies` and `printer`.
|
||||
- **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
|
||||
@@ -716,9 +715,10 @@ before anything is built. They come in this order.
|
||||
1. **Job store and print previews**: `docs/plans/job-store.md` (written;
|
||||
the owner accepted every proposed default, 2026-12-01). The store is
|
||||
built (Decisions, "Jobs survive a restart"); what is left:
|
||||
- `GET /api/v1/jobs` lists the history, job status shows `ref`, and
|
||||
`/healthz` counts the jobs that became `uncertain` since the latest
|
||||
start, at it or during the run.
|
||||
- `POST /api/v1/jobs/list` lists the history, its filters and paging
|
||||
in the JSON body. Job status shows `ref`, and `/healthz` counts the
|
||||
jobs that became `uncertain` since the latest start, at it or
|
||||
during the run.
|
||||
- `DELETE /api/v1/jobs/{id}` cancels a waiting job, for full tokens. An
|
||||
ntfy `message_delete` cancels the waiting receipts of its
|
||||
notification (`Queue.Cancel`); `message_clear` does not, and the
|
||||
|
||||
Reference in new issue
Block a user