massive-com / massive-com/client-go

Bug: Snapshot endpoint av field typed as integer in OpenAPI spec but API returns float

Open Beginner friendly
#569 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.