Skip to content

fix: remove redundant api_token param (#2) + consistent real-time volume type (#3)#8

Open
alexpipipi wants to merge 1 commit into
mainfrom
fix/openapi-issues-2-3
Open

fix: remove redundant api_token param (#2) + consistent real-time volume type (#3)#8
alexpipipi wants to merge 1 commit into
mainfrom
fix/openapi-issues-2-3

Conversation

@alexpipipi

@alexpipipi alexpipipi commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Fixes the two OpenAPI issues filed by @jogold, plus the example/format mismatches that surfaced as a CI-blocking lint error once the redundant params were removed.

#2 — Remove explicit api_token parameter (Closes #2)

The global EODHDQueryKey security scheme (apiKey, in query, name api_token) already mandates the token, but every endpoint also declared api_token as an explicit required query parameter. This forced OpenAPI code generators to require a manual api_token argument on every method call.

  • Removed the explicit api_token parameter from all 69 path files
  • Deleted the now-orphaned components/parameters/ApiToken component (it had no $ref users)
  • Auth is still enforced via the global scheme — name: api_token remains in the bundled spec only in securitySchemes.EODHDQueryKey

Proof (resolved params from the bundled spec):

/real-time/{ticker} parameters
before ticker, s, api_token, ex, fmt
after ticker, s, ex, fmt

Global security: [EODHDQueryKey: []] unchanged → codegen now injects the key via client config instead of a per-method arg.

#3 — Consistent volume type in /real-time (Closes #3)

Single-object response declared volume: integer; array variant declared [integer, null]. Made both [integer, null]. Verified against the live API (FOREX returns volume: 0, non-traded assets can be null).

Example/format corrections (required for green CI)

Removing the redundant params caused redocly lint (run by npm run validate in CI) to escalate 16 pre-existing example warnings into a blocking error. Each was corrected against the live EODHD API:

  • economic-eventsdate is not RFC3339 ('YYYY-MM-DD HH:MM:SS'); removed wrong format: date-time; example estimate: ""null
  • intraday — same datetime format correction
  • exchange-details — TradingHours times have no TZ offset; removed wrong format: time
  • eod-bulk-last-day — dividends example used "" for nullable date fields → null
  • mp/unicornbay/spglobal/list — example Dividend: "" → number

Verification

  • redocly lint: ✅ valid, 0 errors, 0 warnings (main currently has 16 warnings)
  • redocly bundle: ✅ builds clean
  • Live API tested for every changed response shape

…ume type (#3)

Closes #2: the global `EODHDQueryKey` security scheme (apiKey, in query,
name `api_token`) already mandates the token, but every endpoint also
declared `api_token` as an explicit required query parameter. This forced
OpenAPI codegen to require a manual `api_token` arg on every method call.
Removed the explicit parameter from all 69 path files and deleted the now
-orphaned `components/parameters/ApiToken` component. Auth is still enforced
via the global scheme; codegen now injects the key via client config.

Closes #3: `/real-time/{ticker}` declared `volume` as `integer` in the
single-object response but `[integer, null]` in the array variant. Made
both `[integer, null]` (verified against live API: FOREX returns volume 0,
non-traded assets can be null).

Also corrects 16 pre-existing example/format mismatches that `redocly lint`
escalated to a CI-blocking error once the redundant params were removed.
Each correction was verified against the live EODHD API:
- economic-events: `date` is not RFC3339 date-time (API returns
  'YYYY-MM-DD HH:MM:SS'); removed the wrong `format: date-time`; example
  `estimate: ""` -> null (schema is [number, null]).
- intraday: same `datetime` format correction.
- exchange-details: TradingHours times have no TZ offset; removed the
  wrong `format: time`.
- eod-bulk-last-day: dividends example used "" for nullable date fields;
  changed declaration/record/paymentDate to null.
- mp/unicornbay/spglobal/list: example `Dividend: ""` -> number.

redocly lint: valid, 0 errors, 0 warnings. Bundle builds clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

Inconsistent volume type between single and array responses in /real-time/{ticker} Remove explicit api_token parameter from individual endpoints

1 participant