Repository navigation
feat(stocks): request stocks/quotes and add WithQuotesFiftyTwoWeek - #28
MarketDataDev02 wants to merge 5 commits into
Conversation
Quote and Quotes, and their CSV and HTML facets, sent /v1/stocks/bulkquotes/, which is deprecated and no longer in the public API documentation. They now send /v1/stocks/quotes/?symbols=. The API routes both paths to the same handler with the same declared parameters, so the fields, types and billing a caller sees do not change, and no exported identifier changes. The OpenAPI allowlist now maps /v1/stocks/quotes/ to the stocks/quotes catalog endpoint and lists /v1/stocks/bulkquotes/ as out of scope. Its old reason for skipping /v1/stocks/quotes/ (no 52week or candle support) no longer holds. Tests, mocks, the stockterm golden file and the live wire-shape probe assert the new path. CHANGELOG promotes 2.0.1. Closes #15
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #28 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 44 44
Lines 3140 3144 +4
=========================================
+ Hits 3140 3144 +4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Lint failed on every pull request with typecheck errors inside the runner's stdlib: v2.13.1 cannot read the version 5 export data that the runner's Go 1.27.3 writes. v2.15.0 reads it and reports 0 issues on this tree under golang:1.27.3.
🟡 Needs changes — Code reviewSwitches stock Quote and Quotes requests to the canonical route, adds multi-symbol 52-week support, and updates tests and examples. Version impact: minor (2.0.0 -> 2.1.0). Runtime behavior is well exercised, but the release-note placement and public resource documentation remain incomplete. Rating patch 4/6 (works with reservations) · proof 6/6 (comprehensive) · overall 4/6 FindingsShould fix
Since last review
Reviewed |
The API derives 52weekHigh and 52weekLow for multi-symbol requests on /v1/stocks/quotes/, so Quotes now accepts WithQuotesFiftyTwoWeek and sends 52week=true. A symbol whose range the API cannot derive comes back null and keeps zero values. Quote keeps WithFiftyTwoWeek, and the two option types stay distinct. Godoc, the API catalog, the negative-compile corpus, the unit tests and a live test for two symbols follow the new option. Three example apps fetch the 52-week range with one Quotes call instead of one Quote per symbol, and the examples README states the per-symbol billing the public docs describe. CHANGELOG moves the section to 2.1.0.
The release PR promotes the section to [2.1.0] before tag-and-release runs, as RELEASE_PROCESS section 3 describes.
|
Round 2:
|
What
Stocks.QuoteandStocks.Quotes(and their CSV and HTML facets, which share the serializer informat_params.go) now request/v1/stocks/quotes/?symbols=instead of/v1/stocks/bulkquotes/. The bulkquotes path is deprecated and no longer in the public API documentation.stocks.WithQuotesFiftyTwoWeek(enabled bool) QuotesOption:Quotescan now ask for 52-week high/low data for every symbol in one request. Until now the SDK only offered it onQuote, based on a claim that the API ignored52weekon multi-symbol requests, which no longer holds.Closes #15
Version impact: minor (2.0.0 -> 2.1.0)
(*Service).Quote(*Service).Quotesstocks.WithQuotesFiftyTwoWeekfunc(enabled bool) QuotesOptionNo existing exported identifier, signature, type, default or error changed. The new option makes this a minor.
CHANGELOG.mdcarries the entries under## [Unreleased]. A separate release PR promotes them to## [2.1.0]beforetag-and-releaseruns (RELEASE_PROCESS §3).Why the response does not change
Read from the API code (
marketDataApi/stock/views.py), with no live call:/v1/stocks/quotes//v1/stocks/bulkquotes/get_stock_bulk_quotes_handlerget_stock_bulk_quotes_handlergetQuotesSchemaParameters()getQuotesSchemaParameters()resolve()givesstock-quotes,{})stock-bulk-quotes,{})MULTI_CREDIT_ENDPOINTS)The handler never branches on the path, so the fields, types and credits a caller sees are the same.
marketdata/stocks/types.go::Quotekeeps its fields. For52weekwith several symbols, the handler calls_add_52_week_columnsand never fails the request over it: a symbol whose range it cannot derive comes backnull, which the SDK decodes as zero, the same as onQuote.Other changes
Quote,Quotes,QuoteOption,QuotesOption,WithFiftyTwoWeekandWithQuotesCandleno longer says the API ignores52weekon multi-symbol requests, and points each method at its own option.QuoteandQuotespoint at/docs/api/stocks/quotes(the old URL 301s there).internal/apicatalog:/v1/stocks/quotes/maps to thestocks/quotescatalog endpoint and/v1/stocks/bulkquotes/moves tooutOfScopePathsas deprecated. The52weekrow names both options, and the reachability probe sends it throughQuotestoo.internal/negcompile: the negative case still asserts that the single-quoteWithFiftyTwoWeekdoes not compile onQuotes(the option types stay distinct). The positive case buildsQuoteswithWithQuotesFiftyTwoWeek.portfolio-monitor,watchlist-alerterandmulti-asset-dashboardget the 52-week range with oneQuotescall instead of oneQuoteper symbol.examples/README.mdused to sayQuotesandPricescost 1 credit per request; the public docs (api/stocks/quotes.mdx, credits table) bill per symbol, and so does the API, so the note now says that.modal_error.golden(regenerated with-update) and the live wire-shape probe assert the new path.Review round 1 (2026-10-30, bot review of
5aa8af1)316316fc52weekonQuotes40752ce:WithQuotesFiftyTwoWeek, catalog, godoc, unit tests, negcompile and the live testTestStocks_Quotes_With52Week8aae0e028aae0e02## [Unreleased]fdbd7301)Review round 2 (2026-10-30, bot review of
40752ce)fdbd7301## [Unreleased]27012f6. RELEASE_PROCESS §3 promotes the section "in a normal PR", so a separate release PR promotes it to## [2.1.0]beforetag-and-releaserunsba656118docs/stocks/quotes.mdin this PRdocs/.sync-manifest.txtlists the file as owned by the docs sync workflow ("do not edit them by hand"), so the next sync would overwrite an edit here. The fix goes in MarketDataApp/documentation, and the synced page has to land before the 2.1.0 tag (RELEASE_PROCESS §3, step 3)Siblings
stocks/quotes. sdk-java never used bulkquotes.52weekis not checked here.Proof
Run on the devbox from the pushed tree (
40752ce). The later commits only touchCHANGELOG.mdand revert the lint pin, so the Go code is the same:gofmt -l .go vet ./...andgo vet -tags=integration ./integration/...go test -race ./...(golang:1.24)go test -race -coverprofile ./marketdata/... ./internal/...examples/optionterm,examples/stockterm,examples/tuitest(go vet,go test -race)internal/negcompile:stocks_quotes_52week.go(negative),stocks_quotes_split.go(positive)quotePathback tostocks/bulkquotes/TestQuotePath_Params,TestQuote,TestHTMLService_Quote,TestWithAPIVersion,TestCatalogReachability)quotesPathback tostocks/bulkquotes/TestQuotesPath_Params,TestQuotes,TestGetQuotes,TestQuotes_APIError,TestQuotes_NonOkStatus)52weekfromquotesPathTestQuotesPath_FiftyTwoWeek,TestQuotes_WithQuotesFiftyTwoWeek)git grep -i bulkquoteCHANGELOG.md, theoutOfScopePathsentry and the schema fixtureopenapi_v1.jsonThe live suite runs in this PR's CI. At
40752cethe Integration Tests job passed against/v1/stocks/quotes/, including the newTestStocks_Quotes_With52Week, which asserts a non-zero 52-week range for both symbols.CI: golangci-lint pin
Lint fails on this PR until #30 merges: golangci-lint v2.13.1 cannot read the version 5 export data that Go 1.27.3 (the runner's
stable) writes, and reports typecheck errors inside the runner's stdlib. This PR carried the same bump in5aa8af1, reverted in9cc9508so that #30 owns it. Once #30 is inmain, a merge ofmaininto this branch turns Lint green.Not in this PR
The public Go SDK page for Quotes (
docs/stocks/quotes.md, synced from MarketDataApp/documentation) listsstocks.QuoteOption,stocks.WithFiftyTwoWeekandstocks.WithExtendedforQuotes, which do not compile there. It needsQuotesOption,WithQuotesFiftyTwoWeek,WithQuotesExtendedandWithQuotesCandle. That fix goes in the documentation repository, since the next sync would overwrite an edit here, and it has to sync before the 2.1.0 tag.