mirror of
https://github.com/PokeAPI/pokeapi
synced 2024-11-22 03:13:06 +00:00
fix: add move
schema_field definitions
This commit is contained in:
parent
928507938a
commit
e7ea8b2e8c
1 changed files with 27 additions and 1 deletions
|
@ -3542,7 +3542,33 @@ class MoveDetailSerializer(serializers.ModelSerializer):
|
|||
|
||||
return data
|
||||
|
||||
@extend_schema_field(OpenApiTypes.OBJECT)
|
||||
@extend_schema_field(field={'type': 'array',
|
||||
'items': {
|
||||
'type': 'object',
|
||||
'required': [ 'change', 'stat' ],
|
||||
'properties': {
|
||||
'change': {
|
||||
'type': 'number',
|
||||
'example': 2
|
||||
},
|
||||
'stat': {
|
||||
'type': 'object',
|
||||
'required': [ 'name', 'url' ],
|
||||
'properties': {
|
||||
'name': {
|
||||
'type': 'string',
|
||||
'example': 'attack'
|
||||
},
|
||||
'url': {
|
||||
'type': 'string',
|
||||
'format': 'uri',
|
||||
'example': 'https://pokeapi.co/api/v2/stat/1/'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
def get_move_stat_change(self, obj):
|
||||
stat_change_objects = MoveMetaStatChange.objects.filter(move=obj)
|
||||
stat_changes = MoveMetaStatChangeSerializer(
|
||||
|
|
Loading…
Reference in a new issue