Closed shall-code closed 2 years ago
Hello @shall-code !
Thanks for reaching out ! You're right about the problem, and you're right as well about the fix !
If you're interested, I can let you do the fix and create a pull request. If not, I can do it myself.
Please let me know if you want to do it or not.
PR submitted! I was able to use the endpoint successfully after recompiling with this change and running the example above again. It's been fun working with this library so far, thanks for making it!
Hey !
Thanks to you, version 1.0.1 is now live ! Nice work on this one and thanks for the contribution !
No problem for the library, was fun to create. I'm glad you're enjoying it
Hi, I encountered an issue when trying to use the evolution chain endpoint. Looks like there is a problem with the json deserialization.
Example:
Result:
An error occurred : error decoding response body: invalid length 0, expected struct EvolutionDetail with 18 elements at line 1 column 57
Taking a look at the actual json output from https://pokeapi.co/api/v2/evolution-chain/2 we can see it starts with
{"baby_trigger_item":null,"chain":{"evolution_details":[],"evolves_to"
... so it is having a problem with the empty brackets value[]
.Possible fix? The
evolution_details
field in theChainLink
struct at src/model/evolution.rs#L26 is declared with the typeOption<EvolutionDetail>
and maybe it should beOption<Vec<EvolutionDetail>>
instead?