Skip to content

fix(openapi): Mark Region.main_generation as nullable#1486

Merged
Naramsim merged 3 commits intoPokeAPI:masterfrom
santichausis:fix/region-main-generation-nullable
Apr 29, 2026
Merged

fix(openapi): Mark Region.main_generation as nullable#1486
Naramsim merged 3 commits intoPokeAPI:masterfrom
santichausis:fix/region-main-generation-nullable

Conversation

@santichausis
Copy link
Copy Markdown
Contributor

The Hisui region (and potentially others) have no main_generation, causing the API to return null for this field. The OpenAPI spec was incorrectly marking it as required and non-nullable.

Changes:

  • Add nullable: true to Region.main_generation
  • Remove main_generation from the required array

Fixes #1397

The Hisui region (and potentially others) have no main_generation,
causing the API to return null for this field. The OpenAPI spec was
incorrectly marking it as required and non-nullable.

Fixes PokeAPI#1397
@Naramsim
Copy link
Copy Markdown
Member

Hi, did you manually change the spec or did you run the generator?

Some regions (e.g. Hisui) have no main_generation, so the API returns
null for this field. Adding allow_null=True to the serializer field
so the generated OpenAPI spec correctly marks it as nullable.

Fixes PokeAPI#1397
@santichausis
Copy link
Copy Markdown
Contributor Author

Hi, did you manually change the spec or did you run the generator?

I manually edited the spec this time, but I've updated the PR to make the change in the serializer instead (allow_null=True on main_generation), so the spec can be regenerated from the source.

@Naramsim
Copy link
Copy Markdown
Member

Hi can you run the linter and commit the changed openapi.yml?

@santichausis
Copy link
Copy Markdown
Contributor Author

Done! Ran black on the serializer and regenerated the openapi.yml.

@Naramsim Naramsim merged commit f0093c1 into PokeAPI:master Apr 29, 2026
9 checks passed
@pokeapi-machine-user
Copy link
Copy Markdown

A PokeAPI/api-data refresh has started. In ~45 minutes the staging branch of PokeAPI/api-data will be pushed with the new generated data.

The staging branch will be deployed in our staging environment and the entire API will be ready to review.

A Pull Request (master<-staging) will be also created at PokeAPI/api-data and assigned to the PokeAPI Core team to be reviewed. If approved and merged new data will soon be available worldwide at pokeapi.co.

@pokeapi-machine-user
Copy link
Copy Markdown

The updater script has finished its job and has now opened a Pull Request towards PokeAPI/api-data with the updated data.

The Pull Request can be seen deployed in our staging environment when CircleCI deploy will be finished (check the start time of the last build).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing OpenAPI nullable annotation for Region.main_generation

3 participants