massive-com / massive-com/client-go
Bug: Snapshot endpoint av field typed as integer in OpenAPI spec but API returns float
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 198
- Forks
- 59
- Avg merge
- 33m
- Merged PRs (30d)
- 2
Description
I'm using massive-com/client-go/v3 with Go's encoding/json/v2 (GOEXPERIMENT=jsonv2). The generated types for the snapshot endpoints
(/v2/snapshot/locale/us/markets/stocks/tickers/{ticker} and the batch variant) define the av (average volume) field under ticker.min as int, but the Polygon API returns it in scientific
notation (e.g. 3.0048725e+07). The v2 JSON decoder treats this as a type mismatch and fails with:
json: cannot unmarshal number 3.0048725e+07 into Go struct field .ticker.min.av of type int
The fix would be changing av from "type": "integer" to "type": "number" in the OpenAPI spec, then regenerating. The generation script already handles number + int32 → integer coercion,
so this one likely just needs the raw spec updated.
I'm working around it with raw HTTP calls for now but would love a proper fix in the next release.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Inspect the raw OpenAPI definition for the snapshot ticker and batch endpoints, then review the generation script's handling of number and int32. Update the av schema and regenerate the Go client; done means the generated snapshot types accept scientific-notation average-volume values with encoding/json/v2.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, openapi
- Domain
- api
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100