Skip to content

fix(PRD-59): align Credit-Risk / Sanctions / Interest-Rates specs with live API - #11

Merged
otpixto7 merged 2 commits into
mainfrom
PRD-59_openapi_followup
Jul 14, 2026
Merged

otpixto7 merged 2 commits into
mainfrom
PRD-59_openapi_followup

Conversation

@otpixto7

@otpixto7 otpixto7 commented Jul 14, 2026 •

Copy link
Copy Markdown
Collaborator

Follow-up to #9 — accuracy fixes for the three new API families (Credit & Sovereign Risk, Sanctions, Interest Rates) so the spec matches the live API. Part of PRD-59.

Changes

  • Pagination bounds — page[limit] now documents maximum: 100 + default: 20 on the 7 credit-risk and 2 interest-rates endpoints. The API enforces this; the sanctions endpoints already had it, the rest didn't.
  • filter[tenor] and filter[type] (hqm-yields) — integer/enum → string. Both accept a comma-separated list (e.g. 2,5,10, par,spot), which the scalar types couldn't express and which contradicted the Postman example.
  • 422 responses — added to all 14 endpoints (the API returns 422 on validation errors — bad enum, q under 2 chars, limit over 100, from after to).
  • Missing id — added to the sanctions entities & vessels response schemas.
  • Nullable fields — sanctions entities country/remarks/listed_date marked [string, 'null'] (the API returns null for these).
  • cds-market/aggregates — documented filter[value] and filter[region] (accepted by the API, previously omitted).
  • sanctions/vessels q — added minLength: 2 (parity with entities).
  • sanctions programs/sources — removed non-functional page[offset]/page[limit] params.
  • country param — description broadened to "name or ISO Alpha-3 code" to match the examples and behaviour.

Deliberately excluded

  • meta/MetaPagination mismatch — shared, pre-existing component; tracked separately.
  • String maxLength limits (the API caps most string filters at 255/100/etc.) — the spec has never documented these on any filter; adding them belongs in a separate spec-wide pass, not selectively.
  • Widening the filter[currency] enum in reference-rates — deferred.

Verification

Every change was re-checked against the request classes, controllers and tests on prometheus-web dev, and independently reviewed (Codex + opencode) against the same. npm run validate (redocly lint) and npm run build (bundle) both pass.

🤖 Generated with Claude Code

@otpixto7
otpixto7 force-pushed the PRD-59_openapi_followup branch from 463fc69 to d6f3412 Compare July 14, 2026 15:08
Follow-up to #9 (Credit & Sovereign Risk / Sanctions / Interest Rates).
Corrects spec accuracy against the live API:

- page[limit]: add maximum 100 + default 20 on the 7 credit-risk and
  2 interest-rates endpoints (the API caps at 100 and defaults to 20;
  sanctions already documented this)
- hqm-yields filter[tenor] and filter[type]: enum/integer -> string; both
  accept a comma-separated list (e.g. "2,5,10", "par,spot"), which the
  scalar types could not express
- add 422 (validation error) response to all 14 endpoints
- sanctions entities/vessels: add missing id field
- sanctions entities: mark country/remarks/listed_date nullable (the API
  returns null for these)
- cds-market/aggregates: document filter[value] and filter[region]
- sanctions/vessels q: add minLength 2 (parity with entities)
- sanctions programs/sources: drop non-functional pagination params
- credit-risk sovereign: broaden country param description (name or ISO3)

The meta/MetaPagination mismatch and string maxLength limits are
intentionally left out (shared/pre-existing; tracked separately).

Verified against prometheus-web dev. redocly lint + bundle pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@otpixto7
otpixto7 force-pushed the PRD-59_openapi_followup branch from d6f3412 to 534ae7a Compare July 14, 2026 15:24
- .github/workflows/spec-check.yml: run redocly lint + bundle + convention
  checks on every pull_request (validation previously ran only on push to
  main during the docs deploy, so PRs weren't gated)
- scripts/check-conventions.mjs: for the credit-risk / sanctions /
  interest-rates families, enforce that every operation documents
  401/403/404/422/429 and that any page[limit] is bounded with maximum + default
- package.json: add "check" and "test" scripts

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@otpixto7
otpixto7 merged commit 786448f into main Jul 14, 2026
1 check passed
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