-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Added 'pokemon' field to Pokedex #1304
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
base: master
Are you sure you want to change the base?
Conversation
Hi! Thanks for the contribution! I'm checking it out locally in the next days. In the meantime, could you remove from the PR all the files that have been just formatted? So that's going to be easier for me to review all the changes |
- I used black to format the entire project while I was fighting with the CI/CD pipeline
Hi! Thank you for taking your time reviewing my PR! I just pushed the commit where I reverted the files that I had reformatted while fighting with the CI Pipeline that are not relevant to this PR |
Hi! We merged a PR that brought in a schema change and now your branch fails. Could you take a look? |
- Swapped migrations 0019 and 0020 to keep them in order of merges on master
Already on it, I was testing locally before I pushed the fix, should be working again |
Hey, just wanted to check if there are any updates? Just curious, not trying to rush |
Hi Sorry I'm extremely busy at the moment! |
No worries! Like I said, I was just curious |
What is this PR about?
This PR solves #1266 since it was something I need for my personal project as well.
In general, all I did was add a new field to PokemonDexNumber, that references a specific Pokemon as well, since there are Pokedexes (Basically every one from Gen 7 up until now) that have regional variants of Pokemon, which were not differentiated in the API up until now (There is also the Blueberry Dex from Gen 9 that has regional variants from regions that differ from the games region). The Pokemon themselves return also now contain a 'pokedex_numbers' array field, to be consistent with Pokemon Species.
How to test
Spin up a local instance of the API with the most recent migrations and request any pokedex (I recommend id 33) and observe the pokemon_entries field. Each item should now contain a fourth 'pokemon' field that references a Pokemon. Example (Omitted some fields and values for clarity):
https://<base_url>/api/v2/pokedex/33
Pokemon now also contain the 'pokedex_numbers' field, one can request any Pokemon and observe the contents of that field as well. Example (Omitted some fields and values for clarity):
https://<base_url>/api/v2/pokemon/194
What about compatibility?
Since I only added the new fields while keeping the existing ones, there should be no issues with compatibility with already existing clients.
Where did the data come from?
The data I updated the CSV with was input by hand and came from a combination of PokeWiki and the already present PokeApi.