feat: markets resource#13
Merged
Merged
Conversation
|
The author of this PR, MarketDataDev03, is not an activated member of this organization on Codecov. |
MarketDataDev01
approved these changes
Jun 18, 2026
# Conflicts: # CHANGELOG.md # CLAUDE.md # Makefile # examples/consumer-test/build.gradle.kts # examples/consumer-test/src/main/java/com/marketdata/consumer/QuickstartApp.java # src/main/java/com/marketdata/sdk/MarketDataClient.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat: markets resource (
client.markets())Adds the
marketsresource on the resource-architecture the options and stocks PRs established, closing out the per-resource series for v1. Markets expose a single endpoint —GET /v1/markets/status/, the exchange open/closed calendar — and no shared layer changed at all (transport, retry, rate-limit parsing,ParallelArrays,JsonResponseParser,MarketDataDates,RequestConfigare reused untouched). ADR-007 usedMarketsResourceas its canonical façade example; this PR makes that example real.Reviewer entry point:
docs/MARKETS_REVIEW_GUIDE.md(~10 minutes, organized by flow). If you reviewed the stocks PR, the only genuinely new content is the markets-specific semantics below and the all-optional parameter surface.What's included
MarketsResource, reached viaclient.markets()):status/statusAsync(ADR-006 sync+async parity), universal-param setters (dateFormat/mode/limit/offset/columns) returning configured copies,asCsv()facet carrying the config, package-privateasHtml()(built, hidden until the backend serves HTML). Package-private constructor (ADR-007).com.marketdata.sdk.markets,@NullMarked): Builder-basedMarketStatusRequestwhere every parameter is optional — the only request in the SDK with a no-argsof()(today's status, US calendar). Window isdateXORfrom/to(inclusive) XORto+countback(positive, pairs withto), pluscountry(two-digit ISO 3166, pass-through).MarketStatusResponse(thinAbstractMarketDataResponse<List<MarketStatus>>);MarketStatus(date, status)row record with derivedisOpen()/isClosed()predicates over the verbatim wire value; wire columnsdate,statusboth required under the Option A contract;"s":"no_data"(how the backend answers non-US countries, as 404) → emptyvalues(); per-responserateLimit()(§8.2) for free from the base.SimpleModule(marketdata-markets) registered programmatically;datedecodes through the tolerantparseDateOrTimestampField(unix seconds default; date-only strings underdateformat=timestamplift toAmerica/New_Yorkmidnight).Tests & demos
MarketsResourceTest— 21 tests (749 total on the branch, all green): endpoint routing (bare request → no query params), every param translated, open/closed decoding with market-zone dates, null-cell tolerance, date-onlydatestrings,no_data/error envelopes, columns projection + both Option A failure modes, strict-by-default missing column, CSV/HTML facets, per-response rate-limit snapshot, and window validation.MarketsIntegrationTest(one-week window asserting both statuses appear — any 8-day span contains a weekend;to+countbackwindow), gated byMARKETDATA_RUN_INTEGRATION_TESTS=true.MarketsApp(make demo-markets/./gradlew runMarkets) scripts the mock server through every scenario, including the null-cell case — run green end-to-end.QuickstartAppgains its markets section.Docs
docs/MARKETS_REVIEW_GUIDE.md— the review walkthrough.CHANGELOG.md— markets entry under Unreleased/Added.CLAUDE.md— markets moved from "deliberately deferred" to wired; funds lands on its parallel branch (12_funds_resource).