morpheums/Binance.API.Csharp.Client

Error passing single symbol into 24H Price Change

Closed this issue · 1 comments

Hi,

Sorry i might be doing something wrong. But when i pass a single symbol i get the following error.
It works fine if i pass nothing ( as in returns the 24hour price for all symbols)

System.AggregateException
HResult=0x80131500
Message=One or more errors occurred.
Source=mscorlib
StackTrace:
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task1.GetResultCore(Boolean waitCompletionNotification) at System.Threading.Tasks.Task1.get_Result()
at StockMonitor.Apis.BinanceAPI.Get24HourChangeInfo(String symbol)

Inner Exception 1:
JsonSerializationException: Cannot deserialize the current JSON object (e.g. {"name":"value"}) into type 'System.Collections.Generic.IEnumerable`1[Binance.API.Csharp.Client.Models.Market.PriceChangeInfo]' because the type requires a JSON array (e.g. [1,2,3]) to deserialize correctly.
To fix this error either change the JSON to a JSON array (e.g. [1,2,3]) or change the deserialized type so that it is a normal .NET type (e.g. not a primitive type like integer, not a collection type like an array or List) that can be deserialized from a JSON object. JsonObjectAttribute can also be added to the type to force it to deserialize from a JSON object.
Path 'symbol', line 1, position 10.

Issue fixed in new version! please update the nuget package to the last version (v1.4.0).