Skip to content

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

@jburdick00

Description

@jburdick00

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions