docs: add Java SDK documentation#154
Conversation
|
Guiding principle for the API-section SDK examples: optimize for "look how easy this is." A reader skimming the API docs should see they can get data from us in 1–3 lines. The Java/Kotlin examples should read as minimally as the JS/Python ones next to them. Two concrete rules: 1. Use the convenience factory, not the builder, unless the example is about an optional param. // instead of
StockCandlesRequest.builder(StockResolution.DAILY, "AAPL").build()
// use
StockCandlesRequest.of(StockResolution.DAILY, "AAPL")Keep the builder only where the optional parameter is the point of the example (e.g. 2. Let the records print themselves. Every response row is a Java record with a generated candles.values().forEach(System.out::println);Blocked on the SDK: the multi-symbol examples ( Net effect — the canonical single-quote example should look like this and nothing more: try (MarketDataClient client = new MarketDataClient()) {
client.stocks().quote(StockQuoteRequest.of("AAPL")).values().forEach(System.out::println);
} |
Thanks, makes sense — applied both rules across the api/ examples: switched to the .of(...) factory (keeping the builder only where an optional param is the point), and let the records print themselves via ....values().forEach(System.out::println). For the blocked multi-symbol case, opened MarketDataApp/sdk-java#18 (closes #17), which adds the of(...) factory — those examples now use the minimal form too. |
docs: add Java SDK documentation
Adds the documentation for the Java SDK under
sdk/java/, following the samestructure and format as the existing SDK docs (Docusaurus MDX with
<Tabs>). Italso adds Java and Kotlin code examples to the existing
api/reference pages,alongside the other languages.
MarketDataApp/documentation→stagingMarketDataDev03:01_sdk_java_docsWhat's included
sdk/java/— the documentation (25 pages)index,installation,authentication,client,settingsstocks(candles, quotes, prices, news, earnings),options(lookup, expirations, strikes, quotes, chain),
funds(candles),markets(status),
utilities(status, user, headers)interop is a requirement of the SDK).
types were verified against the SDK source — the snippets compile.
api/— Java & Kotlin examples on every endpointAdds a Java tab and a Kotlin tab to every language-tab group in
api/*(alongside HTTP/JavaScript/TypeScript/Python/Go/PHP), so the REST reference shows
JVM examples too. 22 tab groups across 19 pages — coverage is complete
(Python = Java = Kotlin = 22).
each group (same symbols/variants).
api/stocks/bulkcandles: the SDK has no bulk-candles method yet, so the Javaand Kotlin tabs use the JDK
java.net.http.HttpClientdirectly with a:::note(same approach as the JS/TS/Python tabs there).
too-many-concurrent-requests) get tailored Java/Kotlin equivalents using the SDK's
real features (logging via
MARKETDATA_LOGGING_LEVEL,ServiceStatus,RateLimitErrorbackoff,Mode.LIVE+StockQuote.updated()).Shared files (flagging for review)
These touch site-wide files, not just
sdk/java/:sdk/index.mdx— adds the Java card to the SDK landing page.static/img/java-logo.svg— the Java logo for that card.docusaurus.config.js— addsjava,kotlin,groovyto PrismadditionalLanguagesso the code blocks get syntax highlighting.Docs → SDK sync (Phase 2)
Enables the existing sync pipeline for Java:
scripts/export-sdk-docs.js— addsjavatoSUPPORTED_SDKS..github/workflows/sync-sdk-docs.yml— addsjavato the triggerpaths, theworkflow_dispatchoptions, and the jobmatrix.Testing
yarn buildpasses with no broken links/anchors.api/tab coverage verified: every group that has a Python tab now has a Java anda Kotlin tab (22 / 22 / 22).
node scripts/export-sdk-docs.js --sdk javaconverts all 25sdk/java.mdx→clean
.md+.sync-manifest.txt(Tabs → headings, no leftover JSX), exit 0.Follow-up (NOT in this PR — needs org admin)
For the sync to actually publish to
MarketDataApp/sdk-java, themarketdata-docs-syncGitHub App must be granted access to thesdk-javarepo(Contents: R/W, Pull requests: R/W). Once granted, the first push to
stagingtouchingsdk/java/**opens an automated PR insdk-java.Checklist
staging(notmain)www-staging.marketdata.app/docs/sdk/java/after mergesdk-java(separate, org admin)installation.mdxmatches the published release