Skip to content

Commit e1c8162

Browse files
authored
docs: Regenerate openapi.yml spec (#1551)
1 parent 01a464c commit e1c8162

2 files changed

Lines changed: 119 additions & 1 deletion

File tree

openapi.yml

Lines changed: 60 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4077,6 +4077,7 @@ components:
40774077
- min_level
40784078
- min_move_count
40794079
- min_steps
4080+
- near_special_rock
40804081
- needs_multiplayer
40814082
- needs_overworld_rain
40824083
- party_species
@@ -4184,6 +4185,9 @@ components:
41844185
type: integer
41854186
format: int32
41864187
nullable: true
4188+
near_special_rock:
4189+
type: boolean
4190+
nullable: true
41874191
needs_multiplayer:
41884192
type: boolean
41894193
nullable: true
@@ -8152,7 +8156,62 @@ components:
81528156
$ref: '#/components/schemas/PokemonStat'
81538157
readOnly: true
81548158
past_stats:
8155-
type: string
8159+
type: array
8160+
items:
8161+
type: object
8162+
required:
8163+
- generation
8164+
- stats
8165+
properties:
8166+
generation:
8167+
type: object
8168+
required:
8169+
- name
8170+
- url
8171+
properties:
8172+
name:
8173+
type: string
8174+
examples:
8175+
- generation-vi
8176+
url:
8177+
type: string
8178+
format: uri
8179+
examples:
8180+
- https://pokeapi.co/api/v2/generation/6/
8181+
stats:
8182+
type: array
8183+
items:
8184+
type: object
8185+
required:
8186+
- base_stat
8187+
- effort
8188+
- stat
8189+
properties:
8190+
base_stat:
8191+
type: integer
8192+
format: int32
8193+
examples:
8194+
- 45
8195+
effort:
8196+
type: integer
8197+
format: int32
8198+
examples:
8199+
- 0
8200+
stat:
8201+
type: object
8202+
required:
8203+
- name
8204+
- url
8205+
properties:
8206+
name:
8207+
type: string
8208+
examples:
8209+
- speed
8210+
url:
8211+
type: string
8212+
format: uri
8213+
examples:
8214+
- https://pokeapi.co/api/v2/stat/6/
81568215
readOnly: true
81578216
types:
81588217
type: array

pokemon_v2/serializers.py

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5092,6 +5092,65 @@ def get_past_pokemon_abilities(self, obj):
50925092

50935093
return final_data
50945094

5095+
@extend_schema_field(
5096+
field={
5097+
"type": "array",
5098+
"items": {
5099+
"type": "object",
5100+
"required": ["generation", "stats"],
5101+
"properties": {
5102+
"generation": {
5103+
"type": "object",
5104+
"required": ["name", "url"],
5105+
"properties": {
5106+
"name": {"type": "string", "examples": ["generation-vi"]},
5107+
"url": {
5108+
"type": "string",
5109+
"format": "uri",
5110+
"examples": ["https://pokeapi.co/api/v2/generation/6/"],
5111+
},
5112+
},
5113+
},
5114+
"stats": {
5115+
"type": "array",
5116+
"items": {
5117+
"type": "object",
5118+
"required": ["base_stat", "effort", "stat"],
5119+
"properties": {
5120+
"base_stat": {
5121+
"type": "integer",
5122+
"format": "int32",
5123+
"examples": [45],
5124+
},
5125+
"effort": {
5126+
"type": "integer",
5127+
"format": "int32",
5128+
"examples": [0],
5129+
},
5130+
"stat": {
5131+
"type": "object",
5132+
"required": ["name", "url"],
5133+
"properties": {
5134+
"name": {
5135+
"type": "string",
5136+
"examples": ["speed"],
5137+
},
5138+
"url": {
5139+
"type": "string",
5140+
"format": "uri",
5141+
"examples": [
5142+
"https://pokeapi.co/api/v2/stat/6/"
5143+
],
5144+
},
5145+
},
5146+
},
5147+
},
5148+
},
5149+
},
5150+
},
5151+
},
5152+
}
5153+
)
50955154
def get_past_pokemon_stats(self, obj):
50965155
pokemon_past_stat_objects = PokemonStatPast.objects.filter(pokemon=obj)
50975156
pokemon_past_stats = PokemonStatPastSerializer(

0 commit comments

Comments
 (0)