Repository navigation
Description
API product implementation work · roadmap #1008 · use parent dependency order; not a separate product rank.
Part of #857. Stack rank 7 of 13. Depends on: T6 (hard blocker — the classifier must read typed structs first).
Color
The big one, chosen eyes-open: er-server/src/lib.rs has 126 handlers, 139 Json(json!(…)) sites and zero Serialize derives — the entire response layer is untyped, which is why the document can only describe envelopes. Behaviour-preserving by construction (same field names, same order → same bytes), converted in ten resource-family batches, one PR each, so a regression is bisectable and each batch's regenerated artifacts are reviewable.
Batches: jobs/tasks · orgs+datasets · reviews+merges · golden records+lineage · config versions · webhooks+schedules+keys · tags · runs+entity events · metrics+insights · steward actions+assertions.
Reuse, don't invent: for lake-backed endpoints the typed row struct already exists — a declared statement with a typed returns: column list generates <Name>Row. Those are the response types; read.rs's Vec<serde_json::Value> is type information lost upstream of the handler, not inherently absent.
Scope (per batch)
Response structs with Serialize + ToSchema, registered in ApiDoc; handlers converted; regenerate openapi.json, openapi.public.json, schema.d.ts; envelopes.json must not change (the typed spelling classifies identically after T6).
Out of scope
Changing any response's field set or envelope (that would be a breaking change the gate exists to catch). Query params (T8).
Testing (per batch)
- Byte-diff a captured response per converted endpoint against a real server before/after (needs
ER_TEST_PG_DSN/ themake check-e2eenvironment). The mock-backed tiers cannot catch an envelope change — that is exactly the W0.5b failure the ledger was built after. envelopes.jsonclean diff;make check.
Definition of done
Epic DoD per batch PR. Ticket closes when all ten batches are landed and every 200 response in the internal document carries a real schema or an explicitly recorded envelope shape. PM checkpoint at batch 3: split into per-batch sub-issues if a single ticket is unwieldy.
- jobs/tasks
- orgs+datasets
- reviews+merges
- golden records+lineage
- config versions
- webhooks+schedules+keys
- tags
- runs+entity events
- metrics+insights
- steward actions+assertions
Prioritize full shapes for the external configure/ingest/jobs/results workflow before #1013 launch acceptance; remaining resource families may follow.
Activity
athvin commentedon Nov 23, 2026
Claimed — working in #1190 (draft), batch 1 (jobs/tasks) first. Closing that PR releases the claim.
feat(api): typed response structs for the jobs/tasks handlers (#1191)
test: compare the public task list by value, not bytes
feat(api): typed response structs, batch 1 — jobs/tasks (#1190)
athvin commentedon Nov 24, 2026
Batch 1 (jobs/tasks) landed in #1190, deployed to dev and prod. Two findings that change how the remaining batches (#1192–#1200) are done:
Json(…)naming a registered type becomes a$refin the generated document. The supported forms areJson(Name { … }),Json(NameWire::from(…))andJson::<Vec<NameWire>>(…). Response envelopes that aren't entities (JobList, …) register onResponseDocinopenapi.rs, notApiDoc, so the entity-registration guards are unaffected. A handler that types some success bodies and not others fails generation.Name::from(iter)is not a readable form: build the struct literally.serde_jsonhere has nopreserve_order, so everyjson!object emits its keys sorted, while a struct emits declaration order. Values are unchanged; key order changes. Each batch therefore proves value equality per shape (seeresponse_shape_testsinlib.rs), plus byte equality where the fields can be declared in sorted order. Any test that pinned raw response bytes needs to compare parsed values instead (pg_task_instanceswas the one in batch 1).feat(api): typed response structs for the orgs+datasets handlers (#1192)
feat(api): typed response structs, batch 2 — orgs+datasets (#1201)
feat(api): typed response structs, batch 10 — assertion contradictions (
feat(api): typed response structs, batch 10 — assertion contradictions (
athvin commentedon Nov 24, 2026
Progress (2026-11-24): batches 1–10 have all landed: #1190 #1201 #1202 #1205 #1207 #1208 #1209 #1210 #1211 #1212.
The internal document now has:
$refsuccess schema{}The done-criterion ("every 200 response carries a real schema or an explicitly recorded envelope shape") is not met until those 17 are typed. They are filed as #1213, with the customer-workflow ones first:
resolve,models/*,profile,match-preview. This ticket stays open for it.Found along the way:
prepare_utoipa_schemahad been publishing every response union as{}(fixed in feat(api): typed response structs, batch 2 — orgs+datasets (#1192) #1201).Json::<Name>(value)now classifies as Scalar on GET (feat(api): typed response structs, batch 9 — metrics, insights (#1199) #1211).From.feat(docs): /docs/api — grayscale public API reference with the conne…
feat(docs): /docs/api — grayscale public API reference with the conne…