Skip to content

fix: UST endpoints have no pagination/date-range params — align spec to live API - #14

Open
alexpipipi wants to merge 2 commits into
mainfrom
fix/ust-remove-pagination-docs
Open

alexpipipi wants to merge 2 commits into
mainfrom
fix/ust-remove-pagination-docs

Conversation

@alexpipipi

Copy link
Copy Markdown
Member

What & why

The 4 US Treasury (UST) endpoints (/api/ust/{yield-rates,bill-rates,real-yield-rates,long-term-rates}) were documented with query params and a response schema that do not match the live API. Verified against production 2026-07-28.

Removed (phantom — API silently ignores them):

  • page[limit] / page[offset] — no pagination; the full dataset for the year is always returned (ties to DEV-1934)
  • from / to — date-range filtering not supported
  • fmt (csv) — fmt=csv currently returns JSON (separate API bug, flagged; dropped from spec to avoid a false promise)

Fixed response schema — was a flat array with fictitious fields (1_month, 4_weeks_bank_discount, …). Real shape is a JSON:API-style envelope:

{ "meta": { "total": <int> }, "data": [ ... ], "links": { "next": null } }

with real per-endpoint fields (yield/real-yield: date/tenor/rate; bill: date/tenor/discount/coupon/avg_discount/avg_coupon/maturity_date/cusip; long-term: date/rate_type/rate/extrapolation_factor).

Kept: filter[year] (integer, defaults to current year) — the only real filter.

Validation

  • npm run validate (redocly lint) ✓
  • npm run check (conventions) ✓ — 14 endpoint files pass

Part of a cross-repo UST doc-accuracy sweep (WordPress page, SDKs, MCP servers, plugin). Refs DEV-1934.

…to live API

The 4 US Treasury endpoints ignore page[limit]/page[offset], from/to and fmt=csv;
they return the full dataset for the selected year (filter[year], default current year).
Remove the phantom params and replace the flat-array response schema with the real
{meta:{total}, data:[...], links:{next:null}} envelope and real per-endpoint fields.
Refs DEV-1934.

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant