apilayer / marketstack

Free Real-Time, Intraday & Historical Stock Market Data API
https://marketstack.com
67 stars 14 forks source link

Recieving a bad element when calling GET eod/latest #27

Open wrbdev opened 2 years ago

wrbdev commented 2 years ago

Hi there, looks like I am receiving a bad element back from a eod/latest call which normally works fine... Seems to have just started happening. Not sure if its a bad symbol or something I am doing wrong. I am receiving a empty array for one element where I am expecting a eod object. This is breaking the standard deserializer for both RestSharp and Newtonsoft. Are there any suggestions or examples on how to handle this without iterating over each element or using a custom converter. Many thanks in advance!

Example response snip..

{ "open":408.01, "high":415.94, "low":407.6, "close":413.69, "volume":3774912.0, "adj_high":null, "adj_low":null, "adj_close":413.69, "adj_open":null, "adj_volume":null, "split_factor":1.0, "symbol":"GS", "exchange":"XNYS", "date":"2021-10-18T00:00:00+0000" }, [

  ],
  {
     "open":18.12,
     "high":20.3,
     "low":17.75,
     "close":18.66,
     "volume":3579103.0,
     "adj_high":null,
     "adj_low":null,
     "adj_close":18.66,
     "adj_open":null,
     "adj_volume":null,
     "split_factor":1.0,
     "symbol":"GWH",
     "exchange":"XNYS",
     "date":"2021-10-18T00:00:00+0000"
  },
wrbdev commented 2 years ago

Problem is with symbol GTLB.

Market stack is sending back an empty [] instead of an object {} for a particular element, which breaks deserialization,

Essentially bad JSON is being returned from MarketStack. Not a good look...