Skip to content

fix: use camelCase endDateIso in polymarket normalizer#584

Merged
realfishsam merged 1 commit into
mainfrom
fix/557-polymarket-enddateiso
May 24, 2026
Merged

fix: use camelCase endDateIso in polymarket normalizer#584
realfishsam merged 1 commit into
mainfrom
fix/557-polymarket-enddateiso

Conversation

@realfishsam
Copy link
Copy Markdown
Contributor

Fixes #557

@realfishsam
Copy link
Copy Markdown
Contributor Author

PR Review: VERIFIED

What This Does

Fixes the Polymarket normalizer fallback for resolution date: changes market.end_date_iso (snake_case) to market.endDateIso (camelCase) to match the actual Gamma API response field name confirmed in the vendor OpenAPI spec (core/specs/polymarket/PolymarketGammaAPI.yaml line 1532).

Blast Radius

  • Polymarket exchange: utils.ts (mapMarketToUnified) -- single line change in fallback path
  • Only affects markets where market.endDate is falsy and endDateIso is the only available date field
  • No SDK, OpenAPI, or type changes

Findings

  1. Vendor spec confirms camelCase -- PolymarketGammaAPI.yaml defines endDateIso (camelCase), validating this fix.
  2. Raw type interface is stale -- PolymarketRawMarket in fetcher.ts (line 55) still defines end_date_iso?: string (snake_case). This interface should be updated to endDateIso to stay consistent with the vendor spec and this fix. The field is accessed via [key: string]: unknown index signature so it works at runtime, but the typed property is now dead code.
  3. No test for this fallback path -- the endDateIso fallback is only hit when endDate is missing, which appears to be an edge case. No test was added or exists.

PMXT Pipeline Check

  • Field propagation: N/A (resolutionDate is already in all layers)
  • OpenAPI sync: N/A
  • Type safety: ISSUE -- PolymarketRawMarket.end_date_iso in fetcher.ts should be renamed to endDateIso to match

Semver Impact

patch -- bug fix for incorrect field name in fallback path

Risk

The stale end_date_iso property in PolymarketRawMarket interface is cosmetic but could mislead future contributors. Low risk since the fix is correct per the vendor spec.

@realfishsam realfishsam merged commit 7d5f609 into main May 24, 2026
11 of 12 checks passed
@realfishsam realfishsam deleted the fix/557-polymarket-enddateiso branch May 24, 2026 17:04
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.

Response drift: polymarket — end_date_iso fallback uses snake_case but live API field is camelCase endDateIso

1 participant