I’m implementing v2 for pulling bar data and noticed that the json response from the call returns a format of json that is not consistent with what is detailed in the documentation.
The documentation indicates the following format:
When in fact, it returns:
Note the lack of the “symbol” key element. This makes deserialization challenging.
Short of having to parse this manually, does someone have any recommendations on how to deserialize this into a class object in c# .net core?
Thanks
I ended up using JObject and JToken objects to deserialize and parse. A bit of manual work, but it works well.
The first response is for the single-symbol request and the second one is for the multi-symbol request.
If you use C# and Newtonsoft.JSON (I assume that because you’ve mentioned JObject
and JToken
types) you can deserialize the bars
property in the second case using the Dictionary<String, List<Bar>>
type because keys will be unique per response. Or just use the official .NET SDK NuGet package that handles all these cases for you.