Problem with GetCoinMarkets - should be IReadOnlyList?
Closed this issue · 4 comments
I get the exception: Cannot deserialize the current JSON array (e.g. [1,2,3]) into type 'CoinGecko.Entities.Response.Coins.CoinMarkets' because the type requires a JSON object (e.g. {"name":"value"}) to deserialize correctly.
I think it should be public async Task<IReadOnlyList> GetCoinMarkets...
The implications could be wide ranging, for example
[JsonProperty("current_price")]
public Dictionary<string,double> CurrentPrice { get; set; }
should be double (not Dictionary)
etc, etc
Hi @GonzoKK
I changes some property and add test for that. I chaecked Roi agains and i didnt see any error. Thanks for your feedback
Thanks @tosunthex I'll test properly tomorrow.
I dont think you're handling "price_change_percentage"
Also I don't see properties for:
"price_change_percentage_14d_in_currency": 6.58975894468818,
"price_change_percentage_1h_in_currency": -0.0482369285285664,
"price_change_percentage_1y_in_currency": -63.019853096321,
"price_change_percentage_200d_in_currency": -39.4434110238681,
"price_change_percentage_24h_in_currency": -0.0905622039465634,
"price_change_percentage_30d_in_currency": 12.0946672847526,
"price_change_percentage_7d_in_currency": -2.76002154041415
[JsonProperty("price_change_percentage_14d_in_currency", NullValueHandling = NullValueHandling.Ignore)]
public double PriceChangePercentage14dInCurrency { get; set; }
ps They all require null handling