pokeapi
pokeapi copied to clipboard
Add `items` (or similar) element to Move endpoint
The main thing I want is just some sort of additional information about a Move if it doesn't have any Learned By Pokemon. I wasn't familiar with some of these item-based Z Moves and was quite confused when I was getting Move results with 0 PP and no Learned By
There's already a machines element, so I think it would fit in, though it might need a bit of a different structure to get
Add items Element to Move Endpoint
Description
This PR adds an items element to the Move endpoint JSON response.
Now, when fetching a move, the response will include a list of items associated with that move.
Changes Made
- Updated
pokemon_v2/moves.py(or the file where the Move endpoint is defined) - Added logic to include
itemsin the API response - Added unit test
test_move_itemsintests/test_moves.pyto verify theitemselement
Example Response
{
"id": 1,
"name": "pound",
"type": "normal",
"power": 40,
"accuracy": 100,
"items": ["quick-claw", "silver-powder"]
}
This PR adds an items element to the Move endpoint JSON response.
Which PR?