LitJson.JsonException when getting a Pokemon
The Sprites
object was updated to include dream_world
sprites. This was added as part of the json returned by the Pokemon
endpoint (pokemon: sprites->other
). The PokemonSprites struct needs to be updated to match.
This is a double post, however there seems to be no updates to the previous post. I have attempted to do this myself however everything I have tried has failed. I would appreciate any help on this issue.
Additionally the pokemon-species endpoint is outdated now as well.
LitJson.JsonException: The type PokeAPI.PokemonSpecies doesn't have the property 'is_legendary'
at LitJson.JsonMapper.ReadValue(Type inst_type, JsonData json)
at LitJson.JsonMapper.ToObject[T](JsonData json)
at PokeAPI.DataFetcher.<GetNamedApiObject>d__33`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at pkmn_idle_trainer.idlePkmn.VB$StateMachine_9_MessageReceivedAsync.MoveNext()
Thank you.
var pokemon = await DataFetcher.GetApiObject<Pokemon>(id).ConfigureAwait(false);
It only happens for this particular type but I haven't tested further.
LitJson.JsonException: The type PokeAPI.PokemonSprites doesn't have the property 'other'
at LitJson.JsonMapper.ReadValue(Type inst_type, JsonData json)
at LitJson.JsonMapper.ReadValue(Type inst_type, JsonData json)
at LitJson.JsonMapper.ToObject[T](JsonData json)
at PokeAPI.DataFetcher.GetApiObject[T](Int32 id)
Edited by -DefaulT