Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeyStat json deserialization fails on null nextdividentdate value #115

Closed
kewur opened this issue Dec 13, 2021 · 2 comments
Closed

KeyStat json deserialization fails on null nextdividentdate value #115

kewur opened this issue Dec 13, 2021 · 2 comments

Comments

@kewur
Copy link

kewur commented Dec 13, 2021

Looks like IEX changed something on their API again making the KeyStat deserialzier fail on null DateTime values

System.Text.Json.JsonException: {"companyName":"Tesla Inc","marketcap":1021367482430,"week52high":1243.49,"week52low":539.49,"week52highSplitAdjustOnly":1243.49,"week52lowSplitAdjustOnly":539.49,"week52change":0.6672896276988147,"sharesOutstanding":1004264852,"float":0,"avg10Volume":19917128,"avg30Volume":24369071,"day200MovingAvg":802.42,"day50MovingAvg":1092.68,"employees":70757,"ttmEPS":3.03,"ttmDividendRate":0,"dividendYield":0,"nextDividendDate":"","exDividendDate":"","nextEarningsDate":"2022-01-26","peRatio":294.5119614848789,"beta":1.8002951554377649,"maxChangePercent":211.8568438677271,"year5ChangePercent":25.425973081120407,"year2ChangePercent":13.137983763345192,"year1ChangePercent":0.6672896276988147,"ytdChangePercent":0.4412260688423768,"month6ChangePercent":0.667563003164505,"month3ChangePercent":0.3813275021391609,"month1ChangePercent":-0.015859960132376116,"day30ChangePercent":-0.015859960132376116,"day5ChangePercent":0.0020296166389153214} ---> System.Text.Json.JsonException: The JSON value could not be converted to System.Nullable1[System.DateTime]. Path: $.nextDividendDate | LineNumber: 0 | BytePositionInLine: 425.
---> System.FormatException: The JSON value is not in a supported DateTime format.
at System.Text.Json.Utf8JsonReader.GetDateTime()
at System.Text.Json.Serialization.Converters.DateTimeConverter.Read(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options)
at System.Text.Json.Serialization.Converters.NullableConverter1.Read(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options) 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.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](Utf8JsonReader& reader, Type returnType, JsonSerializerOptions options) at System.Text.Json.JsonSerializer.Deserialize[TValue](String json, Type returnType, JsonSerializerOptions options) at IEXSharp.Helper.ExecutorREST.ExecuteAsync[ReturnType](String urlPattern, NameValueCollection pathNVC, QueryStringBuilder qsb, Boolean forceUseSecretToken) --- End of inner exception stack trace --- at IEXSharp.Helper.ExecutorREST.ExecuteAsync[ReturnType](String urlPattern, NameValueCollection pathNVC, QueryStringBuilder qsb, Boolean forceUseSecretToken) at IEXSharp.Helper.ExecutorREST.SymbolExecuteAsync[ReturnType](String urlPattern, String symbol) at IEXSharp.Service.Cloud.CoreData.StockResearch.StockResearchService.KeyStatsAsync(String symbol)

@kewur kewur changed the title KeyStat json deserialization fails on null divident value KeyStat json deserialization fails on null nextdividentdate value Dec 13, 2021
vslee added a commit that referenced this issue Mar 17, 2022
@vslee
Copy link
Owner

vslee commented Mar 17, 2022

Is this still an issue for you? I added a test for TSLA and it passes for me.

@kewur
Copy link
Author

kewur commented Mar 18, 2022

really? surprised it does. it's possible there is some configuration in my code that might be effecting it then on my environment. I did end up implementing a new call with restsharp though so I'm not using this class anymore, we can close this issue, maybe it was my setup. I even created a unit test by checking out the current IEXSharp HEAD and that was failing as well with the same error.

@vslee vslee closed this as completed Mar 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants