You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
OpenAPI spec: PokemonSprites only declares front_default, but the API returns many more fields #1710
The schema comes from PokemonSpritesSerializer in pokemon_v2/serializers.py, which currently only has front_default = serializers.CharField(allow_null=True).
The real response of /api/v2/pokemon/25/ has more keys under sprites:
and code that reads pokemon.sprites.other fails to type-check (Property 'other' does not exist on type 'PokemonSprites'), even though the field is present in the API response.
This used to be different. I generated a client from openapi.yml at 5064f1d (before the August 11 serializer/typehints work) and got:
In that version, the pokemon sprites was an inline object with front_default plus additionalProperties (string, nullable). The extra keys were not declared individually (and other was typed as string | undefined, which is not accurate either), but accessing them compiled. The schema first changes to the front_default-only version in 2bf3e19 ("feat: Add typehints to serializer.py and fix ruff lint issues", which regenerates openapi.yml, where it appears as _PokemonSpritesDetail); 83eb836 then renames it to PokemonSprites.
I don't know whether dropping those fields from the spec was intentional.
Related: #1129 reports PokemonSprites.other as undocumented in the docs; this issue is about the OpenAPI schema.
Steps to Reproduce
Download openapi.yml from master.
Generate a TypeScript client with @hey-api/openapi-ts 0.99.0 and look at PokemonSprites in types.gen.ts: it only has front_default.
Compare with curl https://pokeapi.co/api/v2/pokemon/25/ | jq '.sprites | keys', which also lists other, versions and the back_* / front_* variants.
hi @davbrito opened a pr for this #1711 can you give the openapi schema here a look if it looks fine for your case all the fields are now modeled other than versions which i left as an object due to the difference across games
Activity
Pin PokeAPI spec commit and patch PokemonSprites type
FallenDeity commentedon Nov 6, 2026
I'll give this a look it was unintended, i think we need to revisit our openapi spec generation process and see why some of them are missing
on an additional note i also noticed missing descriptions in openapi spec and mixed null handling which changed between openapi spec 3 and 3.1
FallenDeity commentedon Nov 7, 2026
hi @davbrito opened a pr for this #1711 can you give the openapi schema here a look if it looks fine for your case all the fields are now modeled other than versions which i left as an object due to the difference across games