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

Issue with Json values not converting (LolGameApi schema out of date) #51

Open
l-404-l opened this issue Mar 31, 2021 · 4 comments
Open

Comments

@l-404-l
Copy link

l-404-l commented Mar 31, 2021

System.AggregateException: One or more errors occurred. (The JSON value could not be converted to System.Nullable`1[System.Int32]. Path: $.activePlayer.currentGold | LineNumber: 69 | BytePositionInLine: 34.)
 ---> System.Text.Json.JsonException: The JSON value could not be converted to System.Nullable`1[System.Int32]. Path: $.activePlayer.currentGold | LineNumber: 69 | BytePositionInLine: 34.
 ---> System.FormatException: Either the JSON value is not in a supported format, or is out of bounds for an Int32.
   at System.Text.Json.Utf8JsonReader.GetInt32()
   at Camille.Core.JsonHandler.CustomIntConverter.Read(Utf8JsonReader& reader, Type type, JsonSerializerOptions options)
   at System.Text.Json.Serialization.Converters.NullableConverter`1.Read(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options)
   at System.Text.Json.JsonPropertyInfo`1.ReadJsonAndSetMember(Object obj, ReadStack& state, Utf8JsonReader& reader)
   at System.Text.Json.Serialization.Converters.ObjectDefaultConverter`1.OnTryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value)
   at System.Text.Json.Serialization.JsonConverter`1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value)
   at System.Text.Json.JsonPropertyInfo`1.ReadJsonAndSetMember(Object obj, ReadStack& state, Utf8JsonReader& reader)
   at System.Text.Json.Serialization.Converters.ObjectDefaultConverter`1.OnTryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value)
   at System.Text.Json.Serialization.JsonConverter`1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value)
   at System.Text.Json.Serialization.JsonConverter`1.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.JsonConverter`1.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 Camille.Core.JsonHandler.Deserialize[T](String content)
   at Camille.LolGame.LolGameApi.Send[T](HttpRequestMessage request, Nullable`1 token)
@MingweiSamuel
Copy link
Owner

Do you know which endpoint you were calling when this happened?
Seems likely an out-of-range int32

@l-404-l
Copy link
Author

l-404-l commented Apr 2, 2021

CurrentPlayer I believe it was

@l-404-l
Copy link
Author

l-404-l commented Apr 3, 2021

seems Camille.Lcu.LolChampSelect.ChampSelectSession is also having issues deserializing found changing actions fixes it. Changed it to [JsonPropertyName("actions")] public List<List<IDictionary<string,object>>>? Actions { get; set; } seems the be the format now

@MingweiSamuel
Copy link
Owner

Both the LCU and LolGameApi schemas are no longer up to date, I'll have to fix the job which pulls the LCU one, and write a new one for the LolGameApi, not sure when I'll have a chance to

@MingweiSamuel MingweiSamuel changed the title Issue with Json values not converting. Issue with Json values not converting (LolGameApi schema out of date) Aug 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants