add missing EvolutionDetail fields for regional-variant evolutions - #160
Open
wantaekchoi wants to merge 1 commit into
Open
add missing EvolutionDetail fields for regional-variant evolutions#160wantaekchoi wants to merge 1 commit into
wantaekchoi wants to merge 1 commit into
Conversation
Naramsim
approved these changes
Jul 26, 2026
Member
|
Hi thanks! This is due to some recent modifications to the API. @sargun can you take a look, request any changes and merge? |
Member
|
@wantaekchoi how did you find all these bugs and fix them? Did you instruct your AI to scan our repositories? Or did you find the bugs by yourself? |
Author
Hi! I pick the repos and the areas to look at, then have Claude Code read |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
EvolutionDetail(model/evolution.kt) was missing 11 fields present in the current PokeAPI schema:base_form,evolved_form,used_move,region,is_default,near_special_rock,needs_multiplayer,min_damage_taken,min_move_count,min_steps, andversion_group. BecausePokeApiJsonsetsignoreUnknownKeys = true, these fields were silently dropped during deserialization instead of causing a visible failure.This causes user-facing data loss: species with regional-variant evolutions (e.g. Wooper → Quagsire in most games, but Wooper → Clodsire in Scarlet/Violet) are only distinguishable via
version_group/base_form. Without those fields, both evolution branches decoded to structurally identicalEvolutionDetailobjects.Fix
Added the 11 fields to
EvolutionDetail, all withnull/falsedefaults per the existing style (matchingneedsOverworldRain,turnUpsideDown, etc.). PokeAPI's own schema has these as nullable foreign keys /default=Falsebooleans, so optional fields model the API correctly.I deliberately did not bump the
api-datatest-data submodule. Its pinned snapshot predates this schema (the fields are absent or null-only placeholders there), so bumping it is a much larger, separate scope; this PR is a targeted addition that a later submodule bump can supersede.Test
Since the pinned local fixture can't distinguish the two branches, I embedded a real
/api/v2/evolution-chain/96(Wooper) response, fetched live from pokeapi.co, as a JSON string and decode it directly with the library's internalPokeApiJson(the same patternEndpointTestalready uses). The test asserts the Quagsire and Clodsire branches decode to distinctEvolutionDetails that differ exactly byversionGroup/baseForm, matching real API data.Verification
Confirmed the bug reproduces (both branches collapse to the same object) when the two distinguishing fields are temporarily stripped. All 183 pre-existing tests still pass unmodified, plus the new regression test above, for 184 passing against the current submodule pin.
AI assistance disclosure: parts of this change (schema diffing, fixture verification, drafting) were done with AI assistance; all test evidence was produced by running the actual test suite.