Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

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

Open
wrbdev opened this issue Oct 19, 2021 · 1 comment
Open

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

wrbdev opened this issue Oct 19, 2021 · 1 comment

Comments

@wrbdev
Copy link

wrbdev commented Oct 19, 2021

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
Copy link
Author

wrbdev commented Oct 21, 2021

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...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant