Skip to content

Typed query parameters: replace the 26 Query<HashMap> extractors with named structs #865

Done

Description

@athvin

API product implementation work · roadmap #1008 · use parent dependency order; not a separate product rank.

Part of #857. Stack rank 8 of 13. Depends on: T7 (or at minimum T2+T3; sequenced after T7 so handler churn happens once per file).

Color

26 of 28 Query<…> extractors in lib.rs are untyped HashMap<String, String> bags (only SnapshotQuery and DeliveryQuery are typed), and doc comments illustrate query strings on just 3 routes. So the spec documents no pagination, no filters, no cursors at all — and a Swagger UI without documented cursors is a toy. This is the other option's headline folded into the chosen scope, because the docs surface needs it.

Scope

  • Named Deserialize structs per handler, modelled on the two existing typed ones. Watch the axum Query semantics: a missing required field is a 400 where a HashMap lookup was a silent None — preserve today's behaviour with #[serde(default)] / Option<T> field by field.
  • er-api-spec derives OpenAPI parameters from the struct fields (same struct_fields machinery as request bodies).
  • Regenerate both documents + schema.d.ts.

Out of scope

Changing any parameter's name, type or default. New parameters.

Testing

  • Per converted route: unknown-param and missing-param behaviour unchanged (tests on the boundary cases).
  • Derived parameters hand-checked against three routes of different shapes (cursor page, filter bag, single flag).
  • make check.

Definition of done

Epic DoD, plus: zero Query<HashMap<…>> remaining in lib.rs; cursors, limits and filters visible in the public document.

Prioritize full shapes for the external configure/ingest/jobs/results workflow before #1013 launch acceptance; remaining resource families may follow.

Activity

  1. added
    rust
    mvp
    on Nov 8, 2026
  2. self-assigned this
    on Nov 25, 2026
  3. athvin commented on Nov 25, 2026

    @athvin
    OwnerAuthor

    Claimed — working in #1215 (draft). Closing that PR releases the claim.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

mvprust

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions