Skip to content

Commit 24b8ee9

Browse files
committed
fix: Rename region_id and base_form_id to region and base_form in evolution details
For consistency with other fields (e.g. trade_species_id -> trade_species), evolution detail fields should omit the _id suffix. The serializer was manually naming them with _id, diverging from the documented API response. Fixes #1396
1 parent 41cf1ff commit 24b8ee9

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

openapi.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4040,8 +4040,8 @@ components:
40404040
- trigger
40414041
- turn_upside_down
40424042
- used_move
4043-
- region_id
4044-
- base_form_id
4043+
- region
4044+
- base_form
40454045
properties:
40464046
gender:
40474047
type: object
@@ -4173,7 +4173,7 @@ components:
41734173
used_move:
41744174
type: ''
41754175
nullable: true
4176-
region_id:
4176+
region:
41774177
type: object
41784178
nullable: true
41794179
required:
@@ -4185,7 +4185,7 @@ components:
41854185
url:
41864186
type: string
41874187
format: uri
4188-
base_form_id:
4188+
base_form:
41894189
type: object
41904190
nullable: true
41914191
required:

pokemon_v2/serializers.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5637,8 +5637,8 @@ class PokemonEvolutionSerializer(serializers.ModelSerializer):
56375637
trade_species = PokemonSpeciesSummarySerializer()
56385638
location = LocationSummarySerializer()
56395639
trigger = EvolutionTriggerSummarySerializer(source="evolution_trigger")
5640-
region_id = RegionSummarySerializer(source="region")
5641-
base_form_id = PokemonSpeciesSummarySerializer(source="base_form")
5640+
region = RegionSummarySerializer()
5641+
base_form = PokemonSpeciesSummarySerializer()
56425642
used_move = MoveSummarySerializer()
56435643

56445644
class Meta:
@@ -5663,8 +5663,8 @@ class Meta:
56635663
"time_of_day",
56645664
"trade_species",
56655665
"turn_upside_down",
5666-
"region_id",
5667-
"base_form_id",
5666+
"region",
5667+
"base_form",
56685668
"used_move",
56695669
"min_move_count",
56705670
"min_steps",
@@ -5726,8 +5726,8 @@ class Meta:
57265726
"trigger",
57275727
"turn_upside_down",
57285728
"used_move",
5729-
"region_id",
5730-
"base_form_id",
5729+
"region",
5730+
"base_form",
57315731
],
57325732
"properties": {
57335733
"gender": {
@@ -5879,7 +5879,7 @@ class Meta:
58795879
"type": "",
58805880
"nullable": True,
58815881
},
5882-
"region_id": {
5882+
"region": {
58835883
"type": "object",
58845884
"nullable": True,
58855885
"required": ["name", "url"],
@@ -5891,7 +5891,7 @@ class Meta:
58915891
},
58925892
},
58935893
},
5894-
"base_form_id": {
5894+
"base_form": {
58955895
"type": "object",
58965896
"nullable": True,
58975897
"required": ["name", "url"],

0 commit comments

Comments
 (0)