fix: use correct type, add format

This commit is contained in:
indyandie 2024-03-26 23:59:57 -05:00
parent 777abcc656
commit 5e02a377cd
No known key found for this signature in database
GPG key ID: FDB83C1AED3933E1
2 changed files with 93 additions and 62 deletions

View file

@ -3049,7 +3049,8 @@ components:
type: boolean
example: true
slot:
type: number
type: integer
format: int32
example: 3
pokemon:
type: object
@ -3360,7 +3361,8 @@ components:
possible_values:
type: array
items:
type: number
type: integer
format: int32
example:
- 0
- 5
@ -3821,16 +3823,20 @@ components:
type: string
format: uri
min_affection:
type: number
type: integer
format: int32
nullable: true
min_beauty:
type: number
type: integer
format: int32
nullable: true
min_happiness:
type: number
type: integer
format: int32
nullable: true
min_level:
type: number
type: integer
format: int32
nullable: true
needs_overworld_rain:
type: boolean
@ -3999,7 +4005,8 @@ components:
- pokemon_species
properties:
rate:
type: number
type: integer
format: int32
example: 1
pokemon_species:
type: object
@ -4398,7 +4405,8 @@ components:
- version
properties:
rarity:
type: number
type: integer
format: int32
example: 5
version:
type: object
@ -4729,7 +4737,8 @@ components:
- version
properties:
rate:
type: number
type: integer
format: int32
example: 5
version:
type: object
@ -4796,7 +4805,8 @@ components:
format: uri
example: https://pokeapi.co/api/v2/version/12/
max_chance:
type: number
type: integer
format: int32
example: 60
encounter_details:
type: object
@ -4808,10 +4818,12 @@ components:
- method
properties:
min_level:
type: number
type: integer
format: int32
example: 20
max_level:
type: number
type: integer
format: int32
example: 30
condition_values:
type: object
@ -4827,7 +4839,8 @@ components:
format: uri
example: https://pokeapi.co/api/v2/encounter-condition-value/10/
chance:
type: number
type: integer
format: int32
example: 60
method:
type: object
@ -5361,7 +5374,8 @@ components:
- stat
properties:
change:
type: number
type: integer
format: int32
example: 2
stat:
type: object
@ -5867,7 +5881,8 @@ components:
- pokeathlon_stat
properties:
max_change:
type: number
type: integer
format: int32
example: 1
pokeathlon_stat:
type: object
@ -6912,7 +6927,8 @@ components:
- rate
properties:
base_score:
type: number
type: integer
format: int32
example: 50
pokemon-species:
type: object
@ -6928,7 +6944,8 @@ components:
format: uri
example: https://pokeapi.co/api/v2/pokemon-species/1/
rate:
type: number
type: integer
format: int32
example: 30
readOnly: true
required:
@ -6984,7 +7001,8 @@ components:
- nature
properties:
max_change:
type: number
type: integer
format: int32
maximum: -1
example: -1
nature:
@ -7009,7 +7027,8 @@ components:
- nature
properties:
max_change:
type: number
type: integer
format: int32
minimum: 1
example: 2
nature:
@ -7100,7 +7119,8 @@ components:
- pokemon_species
properties:
entry_number:
type: number
type: integer
format: int32
example: 1
pokemon_species:
type: object
@ -7275,7 +7295,8 @@ components:
type: boolean
example: false
slot:
type: number
type: integer
format: int32
example: 1
readOnly: true
past_abilities:
@ -7312,7 +7333,8 @@ components:
type: boolean
example: false
slot:
type: number
type: integer
format: int32
example: 1
generation:
type: object
@ -7366,7 +7388,8 @@ components:
- version
properties:
rarity:
type: number
type: integer
format: int32
example: 5
version:
type: object
@ -7417,7 +7440,8 @@ components:
- version_group
properties:
level_learned_at:
type: number
type: integer
format: int32
example: 1
move_learn_method:
type: object
@ -7499,7 +7523,8 @@ components:
- type
properties:
slot:
type: number
type: integer
format: int32
example: 1
type:
type: object
@ -7545,7 +7570,8 @@ components:
- type
properties:
slot:
type: number
type: integer
format: int32
example: 1
type:
type: object
@ -7702,7 +7728,8 @@ components:
- type
properties:
slot:
type: number
type: integer
format: int32
example: 1
type:
type: object
@ -8017,10 +8044,12 @@ components:
format: uri
example: https://pokeapi.co/api/v2/pal-park-area/2/
base_score:
type: number
type: integer
format: int32
example: 50
rate:
type: number
type: integer
format: int32
example: 30
readOnly: true
form_descriptions:
@ -8263,7 +8292,8 @@ components:
- move
properties:
change:
type: number
type: integer
format: int32
example: -1
move:
type: object
@ -8287,7 +8317,8 @@ components:
- move
properties:
change:
type: number
type: integer
format: int32
example: 5
move:
type: object

View file

@ -482,7 +482,7 @@ class CharacteristicDetailSerializer(serializers.ModelSerializer):
field={
"type": "array",
"items": {
"type": "number",
"type": "integer", "format": "int32",
},
"example": [0, 5, 10, 15, 20, 25, 30],
}
@ -710,7 +710,7 @@ class GenderDetailSerializer(serializers.ModelSerializer):
"type": "object",
"required": ["rate", "pokemon_species"],
"properties": {
"rate": {"type": "number", "example": 1},
"rate": {"type": "integer", "format": "int32", "example": 1},
"pokemon_species": {
"type": "object",
"required": ["name", "url"],
@ -1000,7 +1000,7 @@ class LocationAreaDetailSerializer(serializers.ModelSerializer):
"type": "object",
"required": ["rate", "version"],
"properties": {
"rate": {"type": "number", "example": 5},
"rate": {"type": "integer", "format": "int32", "example": 5},
"version": {
"type": "object",
"required": ["name", "url"],
@ -1104,7 +1104,7 @@ class LocationAreaDetailSerializer(serializers.ModelSerializer):
},
},
},
"max_chance": {"type": "number", "example": 60},
"max_chance": {"type": "integer", "format": "int32", "example": 60},
"encounter_details": {
"type": "object",
"required": [
@ -1115,8 +1115,8 @@ class LocationAreaDetailSerializer(serializers.ModelSerializer):
"method",
],
"properties": {
"min_level": {"type": "number", "example": 20},
"max_level": {"type": "number", "example": 30},
"min_level": {"type": "integer", "format": "int32", "example": 20},
"max_level": {"type": "integer", "format": "int32", "example": 30},
"condition_values": {
"type": "object",
"required": ["name", "url"],
@ -1132,7 +1132,7 @@ class LocationAreaDetailSerializer(serializers.ModelSerializer):
},
},
},
"chance": {"type": "number", "example": 60},
"chance": {"type": "integer", "format": "int32", "example": 60},
"method": {
"type": "object",
"required": ["name", "url"],
@ -1336,7 +1336,7 @@ class AbilityDetailSerializer(serializers.ModelSerializer):
"required": ["is_hidden", "slot", "pokemon"],
"properties": {
"is_hidden": {"type": "boolean", "example": True},
"slot": {"type": "number", "example": 3},
"slot": {"type": "integer", "format": "int32", "example": 3},
"pokemon": {
"type": "object",
"required": ["name", "url"],
@ -1414,7 +1414,7 @@ class StatDetailSerializer(serializers.ModelSerializer):
"type": "object",
"required": ["change", "move"],
"properties": {
"change": {"type": "number", "example": -1},
"change": {"type": "integer", "format": "int32", "example": -1},
"move": {
"type": "object",
"required": ["name", "url"],
@ -1439,7 +1439,7 @@ class StatDetailSerializer(serializers.ModelSerializer):
"type": "object",
"required": ["change", "move"],
"properties": {
"change": {"type": "number", "example": 5},
"change": {"type": "integer", "format": "int32", "example": 5},
"move": {
"type": "object",
"required": ["name", "url"],
@ -1863,7 +1863,7 @@ class ItemDetailSerializer(serializers.ModelSerializer):
"type": "object",
"required": ["rarity", "version"],
"properties": {
"rarity": {"type": "number", "example": 5},
"rarity": {"type": "integer", "format": "int32", "example": 5},
"version": {
"type": "object",
"required": ["name", "url"],
@ -1999,7 +1999,7 @@ class NatureDetailSerializer(serializers.ModelSerializer):
"type": "object",
"required": ["max_change", "pokeathlon_stat"],
"properties": {
"max_change": {"type": "number", "example": 1},
"max_change": {"type": "integer", "format": "int32", "example": 1},
"pokeathlon_stat": {
"type": "object",
"required": ["name", "url"],
@ -3480,7 +3480,7 @@ class MoveDetailSerializer(serializers.ModelSerializer):
"type": "object",
"required": ["change", "stat"],
"properties": {
"change": {"type": "number", "example": 2},
"change": {"type": "integer", "format": "int32", "example": 2},
"stat": {
"type": "object",
"required": ["name", "url"],
@ -3548,7 +3548,7 @@ class PalParkAreaDetailSerializer(serializers.ModelSerializer):
"type": "object",
"required": ["base_score", "pokemon-species", "rate"],
"properties": {
"base_score": {"type": "number", "example": 50},
"base_score": {"type": "integer", "format": "int32", "example": 50},
"pokemon-species": {
"type": "object",
"required": ["name", "url"],
@ -3561,7 +3561,7 @@ class PalParkAreaDetailSerializer(serializers.ModelSerializer):
},
},
},
"rate": {"type": "number", "example": 30},
"rate": {"type": "integer", "format": "int32", "example": 30},
},
},
}
@ -3768,7 +3768,7 @@ class PokemonFormDetailSerializer(serializers.ModelSerializer):
"type": "object",
"required": ["slot", "type"],
"properties": {
"slot": {"type": "number", "example": 1},
"slot": {"type": "integer", "format": "int32", "example": 1},
"type": {
"type": "object",
"required": ["name", "url"],
@ -4447,7 +4447,7 @@ class PokemonDetailSerializer(serializers.ModelSerializer):
"version_group",
],
"properties": {
"level_learned_at": {"type": "number", "example": 1},
"level_learned_at": {"type": "integer", "format": "int32", "example": 1},
"move_learn_method": {
"type": "object",
"required": ["name", "url"],
@ -4572,7 +4572,7 @@ class PokemonDetailSerializer(serializers.ModelSerializer):
"type": "object",
"required": ["rarity", "version"],
"properties": {
"rarity": {"type": "number", "example": 5},
"rarity": {"type": "integer", "format": "int32", "example": 5},
"version": {
"type": "object",
"required": ["name", "url"],
@ -4652,7 +4652,7 @@ class PokemonDetailSerializer(serializers.ModelSerializer):
},
},
"is_hidden": {"type": "boolean", "example": False},
"slot": {"type": "number", "example": 1},
"slot": {"type": "integer", "format": "int32", "example": 1},
},
},
}
@ -4715,7 +4715,7 @@ class PokemonDetailSerializer(serializers.ModelSerializer):
},
},
"is_hidden": {"type": "boolean", "example": False},
"slot": {"type": "number", "example": 1},
"slot": {"type": "integer", "format": "int32", "example": 1},
},
},
},
@ -4784,7 +4784,7 @@ class PokemonDetailSerializer(serializers.ModelSerializer):
"type": "object",
"required": ["slot", "type"],
"properties": {
"slot": {"type": "number", "example": 1},
"slot": {"type": "integer", "format": "int32", "example": 1},
"type": {
"type": "object",
"required": ["name", "url"],
@ -4854,7 +4854,7 @@ class PokemonDetailSerializer(serializers.ModelSerializer):
"type": "object",
"required": ["slot", "type"],
"properties": {
"slot": {"type": "number", "example": 1},
"slot": {"type": "integer", "format": "int32", "example": 1},
"type": {
"type": "object",
"required": ["name", "url"],
@ -5235,8 +5235,8 @@ class PokemonSpeciesDetailSerializer(serializers.ModelSerializer):
},
},
},
"base_score": {"type": "number", "example": 50},
"rate": {"type": "number", "example": 30},
"base_score": {"type": "integer", "format": "int32", "example": 50},
"rate": {"type": "integer", "format": "int32", "example": 30},
},
},
}
@ -5413,19 +5413,19 @@ class EvolutionChainDetailSerializer(serializers.ModelSerializer):
},
},
"min_affection": {
"type": "number",
"type": "integer", "format": "int32",
"nullable": True,
},
"min_beauty": {
"type": "number",
"type": "integer", "format": "int32",
"nullable": True,
},
"min_happiness": {
"type": "number",
"type": "integer", "format": "int32",
"nullable": True,
},
"min_level": {
"type": "number",
"type": "integer", "format": "int32",
"nullable": True,
},
"needs_overworld_rain": {
@ -5622,7 +5622,7 @@ class PokeathlonStatDetailSerializer(serializers.HyperlinkedModelSerializer):
"required": ["max_change", "nature"],
"properties": {
"max_change": {
"type": "number",
"type": "integer", "format": "int32",
"maximum": -1,
"example": -1,
},
@ -5648,7 +5648,7 @@ class PokeathlonStatDetailSerializer(serializers.HyperlinkedModelSerializer):
"required": ["max_change", "nature"],
"properties": {
"max_change": {
"type": "number",
"type": "integer", "format": "int32",
"minimum": 1,
"example": 2,
},
@ -5735,7 +5735,7 @@ class PokedexDetailSerializer(serializers.ModelSerializer):
"type": "object",
"required": ["entry_number", "pokemon_species"],
"properties": {
"entry_number": {"type": "number", "example": 1},
"entry_number": {"type": "integer", "format": "int32", "example": 1},
"pokemon_species": {
"type": "object",
"required": ["name", "url"],