PokeAPI / PokeAPI/pokeapi

Pokemon past abilities not returning correct data

Open
#1,265 4 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
5.4k
Forks
1.2k
Avg merge
2d 5h
Merged PRs (30d)
21

Description

When getting the details of a pokemon (pokeapi.co/api/v2/pokemon/{id}) the past_abilities are wrong and the response is always:

"past_abilities": [
  {
    "abilities": [
      {
        "ability": null,
        "is_hidden": true,
        "slot": 3
      }
    ],
    "generation": {
      "name": "generation-iv",
      "url": "https://pokeapi.co/api/v2/generation/4/"
    }
  }
]

The null ability breaks the deserialization contract because a null ability should not exist.
I've been able to reproduce the issue with the first 10 pokemon (id 1 to 10).

Steps to Reproduce:

  1. call https://pokeapi.co/api/v2/pokemon/1
  2. scroll to the past_abilities data

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by calling the documented Pokémon endpoint for IDs 1 through 10 and inspect how past_abilities is assembled in the API. Trace the source of the null ability entries, then verify that these responses no longer include null abilities and retain the correct past ability data.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.