Skip to content

Conversation

@fissionprime
Copy link
Contributor

@fissionprime fissionprime commented Jul 6, 2021

The while loop which generates the 'possible_values' field for the 'characteristic' endpoint does not allow for a value of 31 (the maximum IV value) to be added to 'possible_values'. Adjusting the value this loop compares against rectifies the issue. This specifically affects the second row in the table on https://bulbapedia.bulbagarden.net/wiki/Characteristic , which corresponds to the characteristics with IDs 7-12. Previously their 'possible_values' fields returned [1,6,11,16,21,26]. After changes, they return [1,6,11,16,21,26,31].

Also included is a new test, which tests that 'possible_values' contains the correct values for each of the 5 possible values of 'gene_modulo'.

All tests pass after changes, and when running the API locally, produces the expected results.

loop that adds values to 'possible_values' used wrong value in conditional. Created test to verify behavior is as expected.
@fissionprime
Copy link
Contributor Author

Note: this fix should close #628

@Naramsim Naramsim merged commit 802975a into PokeAPI:master Jul 6, 2021
@Naramsim
Copy link
Member

Naramsim commented Jul 6, 2021

Thanks!

@pokeapi-machine-user
Copy link

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 you will be able to review the entire API.

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

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

You can see the Pull Request deployed at our staging environment when CircleCI deploy will be finished (check the started time of the last build).

@fissionprime fissionprime deleted the characteristic-fix branch July 6, 2021 17:40
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.

3 participants