MatthiWare/FinancialModelingPrep.NET

An Issue when retrieving Quartal ballance sheets for TSLA

Closed this issue · 3 comments

Hi getting ERROR when calling this:
var test = api.CompanyValuation.GetBalanceSheetStatementAsync("TSLA", MatthiWare.FinancialModelingPrep.Model.Period.Quarter, 10000).Result;

May I ask you to fix this serialization ERROR?

System.Text.Json.JsonException: The JSON value could not be converted to System.Double. Path: $[52].othertotalStockholdersEquity | LineNumber: 2904 | BytePositionInLine: 39.
---> System.InvalidOperationException: Cannot get the value of a token type 'Null' as a number.
at System.Text.Json.Utf8JsonReader.TryGetDouble(Double& value)
at System.Text.Json.Utf8JsonReader.GetDouble()
at System.Text.Json.Serialization.Converters.DoubleConverter.ReadNumberWithCustomHandling(Utf8JsonReader& reader, JsonNumberHandling handling)
at System.Text.Json.Serialization.JsonConverter1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value) at System.Text.Json.JsonPropertyInfo1.ReadJsonAndSetMember(Object obj, ReadStack& state, Utf8JsonReader& reader)
at System.Text.Json.Serialization.Converters.ObjectDefaultConverter1.OnTryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value) at System.Text.Json.Serialization.JsonConverter1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value)
at System.Text.Json.Serialization.Converters.IEnumerableDefaultConverter2.OnTryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, TCollection& value) at System.Text.Json.Serialization.JsonConverter1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value)
at System.Text.Json.Serialization.JsonConverter1.ReadCore(Utf8JsonReader& reader, JsonSerializerOptions options, ReadStack& state) --- End of inner exception stack trace --- at System.Text.Json.ThrowHelper.ReThrowWithPath(ReadStack& state, Utf8JsonReader& reader, Exception ex) at System.Text.Json.Serialization.JsonConverter1.ReadCore(Utf8JsonReader& reader, JsonSerializerOptions options, ReadStack& state)
at System.Text.Json.JsonSerializer.ReadCore[TValue](JsonConverter jsonConverter, Utf8JsonReader& reader, JsonSerializerOptions options, ReadStack& state)
at System.Text.Json.JsonSerializer.ReadCore[TValue](Utf8JsonReader& reader, Type returnType, JsonSerializerOptions options)
at System.Text.Json.JsonSerializer.Deserialize[TValue](String json, Type returnType, JsonSerializerOptions options)
at System.Text.Json.JsonSerializer.Deserialize[TValue](String json, JsonSerializerOptions options)
at MatthiWare.FinancialModelingPrep.Core.Http.FinancialModelingPrepHttpClient.GetJsonAsync[T](String urlPattern, NameValueCollection pathParams, QueryStringBuilder queryString)

Hi @JZeravik thank you for the bug report.
I can reproduce it, seems FMP is returning both othertotalStockholdersEquity and othertotalStockHoldersEquity depending on the quarter.
Note the capital H.

Hi @Matthiee I see, thanks for the picking-up :)