polygon-io / feature-requests

Feature requests for the Polgon.io Platform. Any bug reports should be opened in polygon-io/issues/issuess
0 stars 0 forks source link

Websocket data Json return inconvenience (golang) #24

Open benfrankstein opened 3 years ago

benfrankstein commented 3 years ago

Client using "github.com/gorilla/websocket" for GoLang Issue Both stock trade and stock aggregates under the stock cluster have a json return of "c". When I'm subscribed to both channels I have to use a custom json unmarshaler to determine if its a trade or aggregate before unmarshalling the rest into a struct. This is because for the trade "c" is a []int but for aggregates it is a float64. Expected Result I suggest you make all of the json returns unique for the same cluster but different channels. Screenshots

Desktop (please complete the following information): Ubuntu Cloud Server Additional context

Add any other context about the problem here.

matichenor commented 2 years ago

Hi @benfrankstein , I know this request has gathered some dust but I'd like to follow up with you on it.

I'm afraid I'm having a bit of difficulty understanding your request. The c return values for the Trades and Aggregates websocket feeds represent different values. For aggregates c represents the floating point closing price, while for c represents non-floating point trade conditions. Technically JSON does not distinguish between integers and floating point but has a single type for Number.

If this is still a problem for you, could you please clarify what you are asking for? A rename of the variables to make the objects more unique or something else?