From 082ea57d774500c53ae07d73748dfee8d2ab8f8e Mon Sep 17 00:00:00 2001 From: Robert Williams Date: Fri, 2 Feb 2024 15:16:58 -0600 Subject: [PATCH 01/76] Updating MoveDetailSerializer to change $effect_chance to actual number --- data/v2/csv/move_effect_prose.csv | 4 +--- pokemon_v2/serializers.py | 7 ++++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/data/v2/csv/move_effect_prose.csv b/data/v2/csv/move_effect_prose.csv index 958ddbdf..3ad87559 100644 --- a/data/v2/csv/move_effect_prose.csv +++ b/data/v2/csv/move_effect_prose.csv @@ -153,9 +153,7 @@ This move cannot be copied by []{move:mimic} or []{move:mirror-move}, nor select The user takes damage instead of being healed if the target has []{ability:liquid-ooze}. []{move:rapid-spin} will remove this effect. - -This effect is passed on by []{move:baton-pass}." -86,9,Does nothing.,"Does nothing. +7,9,Has a $e. This move cannot be used while []{move:gravity} is in effect." 87,9,Disables the target's last used move for 1-8 turns.,"Disables the target's last used move, preventing its use for 4–7 turns, selected at random, or until the target leaves the [field]{mechanic:field}. If the target hasn't used a move since entering the [field]{mechanic:field}, if it tried to use a move this turn and [failed]{mechanic:failed}, if its last used move has 0 PP remaining, or if it already has a move disabled, this move will fail." diff --git a/pokemon_v2/serializers.py b/pokemon_v2/serializers.py index c7a4773c..d03858f5 100644 --- a/pokemon_v2/serializers.py +++ b/pokemon_v2/serializers.py @@ -2343,7 +2343,12 @@ class MoveDetailSerializer(serializers.ModelSerializer): data = MoveEffectEffectTextSerializer( effect_texts, many=True, context=self.context ).data - + effect_entries = data[0] + for i, k in enumerate(effect_entries): + print(i, k) + if '$effect_chance%' in effect_entries[k]: + data[0][k] = effect_entries[k].replace('$effect_chance', f'{obj.move_effect_chance}') + return data def get_effect_change_text(self, obj): From ffa89bdfc5831483a67997ebb76fa59a211f1030 Mon Sep 17 00:00:00 2001 From: Robert Williams Date: Fri, 2 Feb 2024 17:06:36 -0600 Subject: [PATCH 02/76] fixing a debugging print line --- pokemon_v2/serializers.py | 1 - 1 file changed, 1 deletion(-) diff --git a/pokemon_v2/serializers.py b/pokemon_v2/serializers.py index d03858f5..7c18d44e 100644 --- a/pokemon_v2/serializers.py +++ b/pokemon_v2/serializers.py @@ -2345,7 +2345,6 @@ class MoveDetailSerializer(serializers.ModelSerializer): ).data effect_entries = data[0] for i, k in enumerate(effect_entries): - print(i, k) if '$effect_chance%' in effect_entries[k]: data[0][k] = effect_entries[k].replace('$effect_chance', f'{obj.move_effect_chance}') From 74b4d0a0eaf22eddd78b226543b991a696057581 Mon Sep 17 00:00:00 2001 From: Robert Williams Date: Fri, 2 Feb 2024 17:24:03 -0600 Subject: [PATCH 03/76] replacing move_effect_prose.csv with original --- data/v2/csv/move_effect_prose.csv | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/data/v2/csv/move_effect_prose.csv b/data/v2/csv/move_effect_prose.csv index 3ad87559..958ddbdf 100644 --- a/data/v2/csv/move_effect_prose.csv +++ b/data/v2/csv/move_effect_prose.csv @@ -153,7 +153,9 @@ This move cannot be copied by []{move:mimic} or []{move:mirror-move}, nor select The user takes damage instead of being healed if the target has []{ability:liquid-ooze}. []{move:rapid-spin} will remove this effect. -7,9,Has a $e. + +This effect is passed on by []{move:baton-pass}." +86,9,Does nothing.,"Does nothing. This move cannot be used while []{move:gravity} is in effect." 87,9,Disables the target's last used move for 1-8 turns.,"Disables the target's last used move, preventing its use for 4–7 turns, selected at random, or until the target leaves the [field]{mechanic:field}. If the target hasn't used a move since entering the [field]{mechanic:field}, if it tried to use a move this turn and [failed]{mechanic:failed}, if its last used move has 0 PP remaining, or if it already has a move disabled, this move will fail." From 41818e4755d90437d38ffbc7fbd6461a8b22e08d Mon Sep 17 00:00:00 2001 From: Robert Williams Date: Sat, 3 Feb 2024 21:56:25 -0600 Subject: [PATCH 04/76] removing unnecessary line --- pokemon_v2/serializers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pokemon_v2/serializers.py b/pokemon_v2/serializers.py index 7c18d44e..07d21cd0 100644 --- a/pokemon_v2/serializers.py +++ b/pokemon_v2/serializers.py @@ -2343,10 +2343,10 @@ class MoveDetailSerializer(serializers.ModelSerializer): data = MoveEffectEffectTextSerializer( effect_texts, many=True, context=self.context ).data + effect_entries = data[0] for i, k in enumerate(effect_entries): - if '$effect_chance%' in effect_entries[k]: - data[0][k] = effect_entries[k].replace('$effect_chance', f'{obj.move_effect_chance}') + data[0][k] = effect_entries[k].replace('$effect_chance', f'{obj.move_effect_chance}') return data From d234ef9def4a8eb76c4159ae70fa2905b301c48b Mon Sep 17 00:00:00 2001 From: Robert Williams Date: Sat, 3 Feb 2024 22:02:23 -0600 Subject: [PATCH 05/76] that line was needed after all --- pokemon_v2/serializers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pokemon_v2/serializers.py b/pokemon_v2/serializers.py index 07d21cd0..7c18d44e 100644 --- a/pokemon_v2/serializers.py +++ b/pokemon_v2/serializers.py @@ -2343,10 +2343,10 @@ class MoveDetailSerializer(serializers.ModelSerializer): data = MoveEffectEffectTextSerializer( effect_texts, many=True, context=self.context ).data - effect_entries = data[0] for i, k in enumerate(effect_entries): - data[0][k] = effect_entries[k].replace('$effect_chance', f'{obj.move_effect_chance}') + if '$effect_chance%' in effect_entries[k]: + data[0][k] = effect_entries[k].replace('$effect_chance', f'{obj.move_effect_chance}') return data From 74bb5b28b52aa2c53906c547d35c6e98edbd48a5 Mon Sep 17 00:00:00 2001 From: Robert Williams Date: Fri, 9 Feb 2024 23:30:52 -0600 Subject: [PATCH 06/76] fixing linter issue --- pokemon_v2/serializers.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pokemon_v2/serializers.py b/pokemon_v2/serializers.py index 7c18d44e..67e181a2 100644 --- a/pokemon_v2/serializers.py +++ b/pokemon_v2/serializers.py @@ -2344,10 +2344,12 @@ class MoveDetailSerializer(serializers.ModelSerializer): effect_texts, many=True, context=self.context ).data effect_entries = data[0] - for i, k in enumerate(effect_entries): - if '$effect_chance%' in effect_entries[k]: - data[0][k] = effect_entries[k].replace('$effect_chance', f'{obj.move_effect_chance}') - + for _i, k in enumerate(effect_entries): + if "$effect_chance%" in effect_entries[k]: + data[0][k] = effect_entries[k].replace( + "$effect_chance", f"{obj.move_effect_chance}" + ) + return data def get_effect_change_text(self, obj): From 6775022635e6b9f1b4245e43e16f1596c85243e8 Mon Sep 17 00:00:00 2001 From: Robert Williams Date: Sat, 10 Feb 2024 19:56:30 -0600 Subject: [PATCH 07/76] making simonorono's suggest changes --- pokemon_v2/serializers.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pokemon_v2/serializers.py b/pokemon_v2/serializers.py index 67e181a2..cef6f6b1 100644 --- a/pokemon_v2/serializers.py +++ b/pokemon_v2/serializers.py @@ -2343,12 +2343,12 @@ class MoveDetailSerializer(serializers.ModelSerializer): data = MoveEffectEffectTextSerializer( effect_texts, many=True, context=self.context ).data - effect_entries = data[0] - for _i, k in enumerate(effect_entries): - if "$effect_chance%" in effect_entries[k]: - data[0][k] = effect_entries[k].replace( - "$effect_chance", f"{obj.move_effect_chance}" - ) + if len(data) > 0: + for key, value in data[0].items(): + if "$effect_chance%" in value: + data[0][key] = value.replace( + "$effect_chance", f"{obj.move_effect_chance}" + ) return data From 4bc132d82ca7e4131a46d661352abde8102b9b4f Mon Sep 17 00:00:00 2001 From: indyandie <1058837+Indyandie@users.noreply.github.com> Date: Sat, 24 Feb 2024 01:31:34 -0600 Subject: [PATCH 08/76] docs(openapi): add `drf-spectacular` and default settings --- config/settings.py | 11 +++++++++++ requirements.txt | 1 + 2 files changed, 12 insertions(+) diff --git a/config/settings.py b/config/settings.py index 8213dd2e..9679b799 100755 --- a/config/settings.py +++ b/config/settings.py @@ -99,6 +99,7 @@ INSTALLED_APPS = ( "corsheaders", "rest_framework", "cachalot", + 'drf_spectacular', ) + CUSTOM_APPS @@ -116,6 +117,7 @@ REST_FRAMEWORK = { "DEFAULT_PAGINATION_CLASS": "rest_framework.pagination.LimitOffsetPagination", "PAGE_SIZE": 20, "PAGINATE_BY": 20, + 'DEFAULT_SCHEMA_CLASS': 'drf_spectacular.openapi.AutoSchema', } @@ -136,3 +138,12 @@ TEMPLATES = [ ] DEFAULT_AUTO_FIELD = "django.db.models.AutoField" + +SPECTACULAR_SETTINGS = { + 'TITLE': 'Your Project API', + 'DESCRIPTION': 'Your project description', + 'VERSION': '1.0.0', + 'SERVE_INCLUDE_SCHEMA': False, + # OTHER SETTINGS +} + diff --git a/requirements.txt b/requirements.txt index c7d6d4a6..7c5ef92e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -11,3 +11,4 @@ mimeparse==0.1.3 psycopg2-binary==2.9.9 python-dateutil==2.8.2 python-mimeparse==1.6.0 +drf-spectacular==0.27.1 From 7f2d2bdf833c9b53718f68cdcd300ea0f5e61166 Mon Sep 17 00:00:00 2001 From: indyandie <1058837+Indyandie@users.noreply.github.com> Date: Sat, 24 Feb 2024 01:48:34 -0600 Subject: [PATCH 09/76] docs(openapi): update spectacular settings --- config/settings.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/config/settings.py b/config/settings.py index 9679b799..71a163d3 100755 --- a/config/settings.py +++ b/config/settings.py @@ -140,10 +140,12 @@ TEMPLATES = [ DEFAULT_AUTO_FIELD = "django.db.models.AutoField" SPECTACULAR_SETTINGS = { - 'TITLE': 'Your Project API', - 'DESCRIPTION': 'Your project description', - 'VERSION': '1.0.0', + 'TITLE': 'pokeapi', + 'DESCRIPTION': 'A RESTful API for Pokémon.', + 'SERVERS': [{'url': 'https://pokeapi.co/api/v2'}], + 'EXTERNAL_DOCS': {'url': 'https://pokeapi.co/docs/v2'}, + 'VERSION': '2.7.0', 'SERVE_INCLUDE_SCHEMA': False, - # OTHER SETTINGS + 'OAS_VERSION': '3.1.0', } From 3a1f9dbf4a483994e1abbe883b11350d12907c28 Mon Sep 17 00:00:00 2001 From: indyandie <1058837+Indyandie@users.noreply.github.com> Date: Sat, 24 Feb 2024 02:05:22 -0600 Subject: [PATCH 10/76] docs(openapi): update `SERVERS` --- config/settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/settings.py b/config/settings.py index 71a163d3..ce9b8382 100755 --- a/config/settings.py +++ b/config/settings.py @@ -142,7 +142,7 @@ DEFAULT_AUTO_FIELD = "django.db.models.AutoField" SPECTACULAR_SETTINGS = { 'TITLE': 'pokeapi', 'DESCRIPTION': 'A RESTful API for Pokémon.', - 'SERVERS': [{'url': 'https://pokeapi.co/api/v2'}], + 'SERVERS': [{'url': 'https://pokeapi.co'}], 'EXTERNAL_DOCS': {'url': 'https://pokeapi.co/docs/v2'}, 'VERSION': '2.7.0', 'SERVE_INCLUDE_SCHEMA': False, From 701f2a78b632a6b369eff2137c2faa035110325f Mon Sep 17 00:00:00 2001 From: indyandie <1058837+Indyandie@users.noreply.github.com> Date: Sat, 24 Feb 2024 02:06:23 -0600 Subject: [PATCH 11/76] docs(openapi): add `openapi.yml` --- openapi.yml | 6882 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 6882 insertions(+) create mode 100644 openapi.yml diff --git a/openapi.yml b/openapi.yml new file mode 100644 index 00000000..d09e5a43 --- /dev/null +++ b/openapi.yml @@ -0,0 +1,6882 @@ +openapi: 3.1.0 +info: + title: pokeapi + version: 2.7.0 + description: A RESTful API for Pokémon. +paths: + /api/v2/ability/: + get: + operationId: ability_list + description: |- + Mixin to allow association with separate serializers + for list or detail view. + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - ability + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedAbilitySummaryList' + description: '' + /api/v2/ability/{id}/: + get: + operationId: ability_retrieve + description: |- + Mixin to allow association with separate serializers + for list or detail view. + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this ability. + required: true + tags: + - ability + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/AbilityDetail' + description: '' + /api/v2/berry/: + get: + operationId: berry_list + description: |- + Mixin to allow association with separate serializers + for list or detail view. + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - berry + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedBerrySummaryList' + description: '' + /api/v2/berry-firmness/: + get: + operationId: berry_firmness_list + description: |- + Mixin to allow association with separate serializers + for list or detail view. + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - berry-firmness + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedBerryFirmnessSummaryList' + description: '' + /api/v2/berry-firmness/{id}/: + get: + operationId: berry_firmness_retrieve + description: |- + Mixin to allow association with separate serializers + for list or detail view. + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this berry firmness. + required: true + tags: + - berry-firmness + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/BerryFirmnessDetail' + description: '' + /api/v2/berry-flavor/: + get: + operationId: berry_flavor_list + description: |- + Mixin to allow association with separate serializers + for list or detail view. + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - berry-flavor + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedBerryFlavorSummaryList' + description: '' + /api/v2/berry-flavor/{id}/: + get: + operationId: berry_flavor_retrieve + description: |- + Mixin to allow association with separate serializers + for list or detail view. + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this berry flavor. + required: true + tags: + - berry-flavor + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/BerryFlavorDetail' + description: '' + /api/v2/berry/{id}/: + get: + operationId: berry_retrieve + description: |- + Mixin to allow association with separate serializers + for list or detail view. + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this berry. + required: true + tags: + - berry + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/BerryDetail' + description: '' + /api/v2/characteristic/: + get: + operationId: characteristic_list + description: |- + Mixin to allow association with separate serializers + for list or detail view. + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - characteristic + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedCharacteristicSummaryList' + description: '' + /api/v2/characteristic/{id}/: + get: + operationId: characteristic_retrieve + description: |- + Mixin to allow association with separate serializers + for list or detail view. + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this characteristic. + required: true + tags: + - characteristic + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/CharacteristicDetail' + description: '' + /api/v2/contest-effect/: + get: + operationId: contest_effect_list + description: |- + Mixin to allow association with separate serializers + for list or detail view. + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - contest-effect + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedContestEffectSummaryList' + description: '' + /api/v2/contest-effect/{id}/: + get: + operationId: contest_effect_retrieve + description: |- + Mixin to allow association with separate serializers + for list or detail view. + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this contest effect. + required: true + tags: + - contest-effect + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ContestEffectDetail' + description: '' + /api/v2/contest-type/: + get: + operationId: contest_type_list + description: |- + Mixin to allow association with separate serializers + for list or detail view. + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - contest-type + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedContestTypeSummaryList' + description: '' + /api/v2/contest-type/{id}/: + get: + operationId: contest_type_retrieve + description: |- + Mixin to allow association with separate serializers + for list or detail view. + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this contest type. + required: true + tags: + - contest-type + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ContestTypeDetail' + description: '' + /api/v2/egg-group/: + get: + operationId: egg_group_list + description: |- + Mixin to allow association with separate serializers + for list or detail view. + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - egg-group + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedEggGroupSummaryList' + description: '' + /api/v2/egg-group/{id}/: + get: + operationId: egg_group_retrieve + description: |- + Mixin to allow association with separate serializers + for list or detail view. + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this egg group. + required: true + tags: + - egg-group + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EggGroupDetail' + description: '' + /api/v2/encounter-condition/: + get: + operationId: encounter_condition_list + description: |- + Mixin to allow association with separate serializers + for list or detail view. + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - encounter-condition + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedEncounterConditionSummaryList' + description: '' + /api/v2/encounter-condition-value/: + get: + operationId: encounter_condition_value_list + description: |- + Mixin to allow association with separate serializers + for list or detail view. + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - encounter-condition-value + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedEncounterConditionValueSummaryList' + description: '' + /api/v2/encounter-condition-value/{id}/: + get: + operationId: encounter_condition_value_retrieve + description: |- + Mixin to allow association with separate serializers + for list or detail view. + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this encounter condition value. + required: true + tags: + - encounter-condition-value + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EncounterConditionValueDetail' + description: '' + /api/v2/encounter-condition/{id}/: + get: + operationId: encounter_condition_retrieve + description: |- + Mixin to allow association with separate serializers + for list or detail view. + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this encounter condition. + required: true + tags: + - encounter-condition + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EncounterConditionDetail' + description: '' + /api/v2/encounter-method/: + get: + operationId: encounter_method_list + description: |- + Mixin to allow association with separate serializers + for list or detail view. + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - encounter-method + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedEncounterMethodSummaryList' + description: '' + /api/v2/encounter-method/{id}/: + get: + operationId: encounter_method_retrieve + description: |- + Mixin to allow association with separate serializers + for list or detail view. + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this encounter method. + required: true + tags: + - encounter-method + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EncounterMethodDetail' + description: '' + /api/v2/evolution-chain/: + get: + operationId: evolution_chain_list + description: |- + Mixin to allow association with separate serializers + for list or detail view. + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - evolution-chain + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedEvolutionChainSummaryList' + description: '' + /api/v2/evolution-chain/{id}/: + get: + operationId: evolution_chain_retrieve + description: |- + Mixin to allow association with separate serializers + for list or detail view. + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this evolution chain. + required: true + tags: + - evolution-chain + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EvolutionChainDetail' + description: '' + /api/v2/evolution-trigger/: + get: + operationId: evolution_trigger_list + description: |- + Mixin to allow association with separate serializers + for list or detail view. + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - evolution-trigger + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedEvolutionTriggerSummaryList' + description: '' + /api/v2/evolution-trigger/{id}/: + get: + operationId: evolution_trigger_retrieve + description: |- + Mixin to allow association with separate serializers + for list or detail view. + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this evolution trigger. + required: true + tags: + - evolution-trigger + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EvolutionTriggerDetail' + description: '' + /api/v2/gender/: + get: + operationId: gender_list + description: |- + Mixin to allow association with separate serializers + for list or detail view. + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - gender + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedGenderSummaryList' + description: '' + /api/v2/gender/{id}/: + get: + operationId: gender_retrieve + description: |- + Mixin to allow association with separate serializers + for list or detail view. + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this gender. + required: true + tags: + - gender + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/GenderDetail' + description: '' + /api/v2/generation/: + get: + operationId: generation_list + description: |- + Mixin to allow association with separate serializers + for list or detail view. + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - generation + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedGenerationSummaryList' + description: '' + /api/v2/generation/{id}/: + get: + operationId: generation_retrieve + description: |- + Mixin to allow association with separate serializers + for list or detail view. + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this generation. + required: true + tags: + - generation + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/GenerationDetail' + description: '' + /api/v2/growth-rate/: + get: + operationId: growth_rate_list + description: |- + Mixin to allow association with separate serializers + for list or detail view. + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - growth-rate + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedGrowthRateSummaryList' + description: '' + /api/v2/growth-rate/{id}/: + get: + operationId: growth_rate_retrieve + description: |- + Mixin to allow association with separate serializers + for list or detail view. + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this growth rate. + required: true + tags: + - growth-rate + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/GrowthRateDetail' + description: '' + /api/v2/item/: + get: + operationId: item_list + description: |- + Mixin to allow association with separate serializers + for list or detail view. + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - item + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedItemSummaryList' + description: '' + /api/v2/item-attribute/: + get: + operationId: item_attribute_list + description: |- + Mixin to allow association with separate serializers + for list or detail view. + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - item-attribute + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedItemAttributeSummaryList' + description: '' + /api/v2/item-attribute/{id}/: + get: + operationId: item_attribute_retrieve + description: |- + Mixin to allow association with separate serializers + for list or detail view. + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this item attribute. + required: true + tags: + - item-attribute + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ItemAttributeDetail' + description: '' + /api/v2/item-category/: + get: + operationId: item_category_list + description: |- + Mixin to allow association with separate serializers + for list or detail view. + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - item-category + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedItemCategorySummaryList' + description: '' + /api/v2/item-category/{id}/: + get: + operationId: item_category_retrieve + description: |- + Mixin to allow association with separate serializers + for list or detail view. + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this item category. + required: true + tags: + - item-category + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ItemCategoryDetail' + description: '' + /api/v2/item-fling-effect/: + get: + operationId: item_fling_effect_list + description: |- + Mixin to allow association with separate serializers + for list or detail view. + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - item-fling-effect + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedItemFlingEffectSummaryList' + description: '' + /api/v2/item-fling-effect/{id}/: + get: + operationId: item_fling_effect_retrieve + description: |- + Mixin to allow association with separate serializers + for list or detail view. + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this item fling effect. + required: true + tags: + - item-fling-effect + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ItemFlingEffectDetail' + description: '' + /api/v2/item-pocket/: + get: + operationId: item_pocket_list + description: |- + Mixin to allow association with separate serializers + for list or detail view. + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - item-pocket + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedItemPocketSummaryList' + description: '' + /api/v2/item-pocket/{id}/: + get: + operationId: item_pocket_retrieve + description: |- + Mixin to allow association with separate serializers + for list or detail view. + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this item pocket. + required: true + tags: + - item-pocket + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ItemPocketDetail' + description: '' + /api/v2/item/{id}/: + get: + operationId: item_retrieve + description: |- + Mixin to allow association with separate serializers + for list or detail view. + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this item. + required: true + tags: + - item + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ItemDetail' + description: '' + /api/v2/language/: + get: + operationId: language_list + description: |- + Mixin to allow association with separate serializers + for list or detail view. + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - language + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedLanguageSummaryList' + description: '' + /api/v2/language/{id}/: + get: + operationId: language_retrieve + description: |- + Mixin to allow association with separate serializers + for list or detail view. + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this language. + required: true + tags: + - language + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/LanguageDetail' + description: '' + /api/v2/location/: + get: + operationId: location_list + description: |- + Mixin to allow association with separate serializers + for list or detail view. + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - location + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedLocationSummaryList' + description: '' + /api/v2/location-area/: + get: + operationId: location_area_list + description: |- + Mixin to allow association with separate serializers + for list or detail view. + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - location-area + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedLocationAreaSummaryList' + description: '' + /api/v2/location-area/{id}/: + get: + operationId: location_area_retrieve + description: |- + Mixin to allow association with separate serializers + for list or detail view. + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this location area. + required: true + tags: + - location-area + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/LocationAreaDetail' + description: '' + /api/v2/location/{id}/: + get: + operationId: location_retrieve + description: |- + Mixin to allow association with separate serializers + for list or detail view. + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this location. + required: true + tags: + - location + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/LocationDetail' + description: '' + /api/v2/machine/: + get: + operationId: machine_list + description: |- + Mixin to allow association with separate serializers + for list or detail view. + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - machine + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedMachineSummaryList' + description: '' + /api/v2/machine/{id}/: + get: + operationId: machine_retrieve + description: |- + Mixin to allow association with separate serializers + for list or detail view. + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this machine. + required: true + tags: + - machine + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/MachineDetail' + description: '' + /api/v2/move/: + get: + operationId: move_list + description: |- + Mixin to allow association with separate serializers + for list or detail view. + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - move + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedMoveSummaryList' + description: '' + /api/v2/move-ailment/: + get: + operationId: move_ailment_list + description: |- + Mixin to allow association with separate serializers + for list or detail view. + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - move-ailment + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedMoveMetaAilmentSummaryList' + description: '' + /api/v2/move-ailment/{id}/: + get: + operationId: move_ailment_retrieve + description: |- + Mixin to allow association with separate serializers + for list or detail view. + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this move meta ailment. + required: true + tags: + - move-ailment + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/MoveMetaAilmentDetail' + description: '' + /api/v2/move-battle-style/: + get: + operationId: move_battle_style_list + description: |- + Mixin to allow association with separate serializers + for list or detail view. + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - move-battle-style + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedMoveBattleStyleSummaryList' + description: '' + /api/v2/move-battle-style/{id}/: + get: + operationId: move_battle_style_retrieve + description: |- + Mixin to allow association with separate serializers + for list or detail view. + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this move battle style. + required: true + tags: + - move-battle-style + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/MoveBattleStyleDetail' + description: '' + /api/v2/move-category/: + get: + operationId: move_category_list + description: |- + Mixin to allow association with separate serializers + for list or detail view. + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - move-category + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedMoveMetaCategorySummaryList' + description: '' + /api/v2/move-category/{id}/: + get: + operationId: move_category_retrieve + description: |- + Mixin to allow association with separate serializers + for list or detail view. + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this move meta category. + required: true + tags: + - move-category + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/MoveMetaCategoryDetail' + description: '' + /api/v2/move-damage-class/: + get: + operationId: move_damage_class_list + description: |- + Mixin to allow association with separate serializers + for list or detail view. + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - move-damage-class + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedMoveDamageClassSummaryList' + description: '' + /api/v2/move-damage-class/{id}/: + get: + operationId: move_damage_class_retrieve + description: |- + Mixin to allow association with separate serializers + for list or detail view. + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this move damage class. + required: true + tags: + - move-damage-class + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/MoveDamageClassDetail' + description: '' + /api/v2/move-learn-method/: + get: + operationId: move_learn_method_list + description: |- + Mixin to allow association with separate serializers + for list or detail view. + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - move-learn-method + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedMoveLearnMethodSummaryList' + description: '' + /api/v2/move-learn-method/{id}/: + get: + operationId: move_learn_method_retrieve + description: |- + Mixin to allow association with separate serializers + for list or detail view. + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this move learn method. + required: true + tags: + - move-learn-method + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/MoveLearnMethodDetail' + description: '' + /api/v2/move-target/: + get: + operationId: move_target_list + description: |- + Mixin to allow association with separate serializers + for list or detail view. + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - move-target + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedMoveTargetSummaryList' + description: '' + /api/v2/move-target/{id}/: + get: + operationId: move_target_retrieve + description: |- + Mixin to allow association with separate serializers + for list or detail view. + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this move target. + required: true + tags: + - move-target + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/MoveTargetDetail' + description: '' + /api/v2/move/{id}/: + get: + operationId: move_retrieve + description: |- + Mixin to allow association with separate serializers + for list or detail view. + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this move. + required: true + tags: + - move + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/MoveDetail' + description: '' + /api/v2/nature/: + get: + operationId: nature_list + description: |- + Mixin to allow association with separate serializers + for list or detail view. + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - nature + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedNatureSummaryList' + description: '' + /api/v2/nature/{id}/: + get: + operationId: nature_retrieve + description: |- + Mixin to allow association with separate serializers + for list or detail view. + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this nature. + required: true + tags: + - nature + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/NatureDetail' + description: '' + /api/v2/pal-park-area/: + get: + operationId: pal_park_area_list + description: |- + Mixin to allow association with separate serializers + for list or detail view. + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - pal-park-area + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedPalParkAreaSummaryList' + description: '' + /api/v2/pal-park-area/{id}/: + get: + operationId: pal_park_area_retrieve + description: |- + Mixin to allow association with separate serializers + for list or detail view. + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this pal park area. + required: true + tags: + - pal-park-area + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PalParkAreaDetail' + description: '' + /api/v2/pokeathlon-stat/: + get: + operationId: pokeathlon_stat_list + description: |- + Mixin to allow association with separate serializers + for list or detail view. + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - pokeathlon-stat + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedPokeathlonStatSummaryList' + description: '' + /api/v2/pokeathlon-stat/{id}/: + get: + operationId: pokeathlon_stat_retrieve + description: |- + Mixin to allow association with separate serializers + for list or detail view. + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this pokeathlon stat. + required: true + tags: + - pokeathlon-stat + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PokeathlonStatDetail' + description: '' + /api/v2/pokedex/: + get: + operationId: pokedex_list + description: |- + Mixin to allow association with separate serializers + for list or detail view. + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - pokedex + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedPokedexSummaryList' + description: '' + /api/v2/pokedex/{id}/: + get: + operationId: pokedex_retrieve + description: |- + Mixin to allow association with separate serializers + for list or detail view. + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this pokedex. + required: true + tags: + - pokedex + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PokedexDetail' + description: '' + /api/v2/pokemon/: + get: + operationId: pokemon_list + description: |- + Mixin to allow association with separate serializers + for list or detail view. + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - pokemon + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedPokemonSummaryList' + description: '' + /api/v2/pokemon-color/: + get: + operationId: pokemon_color_list + description: |- + Mixin to allow association with separate serializers + for list or detail view. + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - pokemon-color + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedPokemonColorSummaryList' + description: '' + /api/v2/pokemon-color/{id}/: + get: + operationId: pokemon_color_retrieve + description: |- + Mixin to allow association with separate serializers + for list or detail view. + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this pokemon color. + required: true + tags: + - pokemon-color + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PokemonColorDetail' + description: '' + /api/v2/pokemon-form/: + get: + operationId: pokemon_form_list + description: |- + Mixin to allow association with separate serializers + for list or detail view. + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - pokemon-form + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedPokemonFormSummaryList' + description: '' + /api/v2/pokemon-form/{id}/: + get: + operationId: pokemon_form_retrieve + description: |- + Mixin to allow association with separate serializers + for list or detail view. + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this pokemon form. + required: true + tags: + - pokemon-form + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PokemonFormDetail' + description: '' + /api/v2/pokemon-habitat/: + get: + operationId: pokemon_habitat_list + description: |- + Mixin to allow association with separate serializers + for list or detail view. + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - pokemon-habitat + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedPokemonHabitatSummaryList' + description: '' + /api/v2/pokemon-habitat/{id}/: + get: + operationId: pokemon_habitat_retrieve + description: |- + Mixin to allow association with separate serializers + for list or detail view. + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this pokemon habitat. + required: true + tags: + - pokemon-habitat + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PokemonHabitatDetail' + description: '' + /api/v2/pokemon-shape/: + get: + operationId: pokemon_shape_list + description: |- + Mixin to allow association with separate serializers + for list or detail view. + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - pokemon-shape + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedPokemonShapeSummaryList' + description: '' + /api/v2/pokemon-shape/{id}/: + get: + operationId: pokemon_shape_retrieve + description: |- + Mixin to allow association with separate serializers + for list or detail view. + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this pokemon shape. + required: true + tags: + - pokemon-shape + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PokemonShapeDetail' + description: '' + /api/v2/pokemon-species/: + get: + operationId: pokemon_species_list + description: |- + Mixin to allow association with separate serializers + for list or detail view. + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - pokemon-species + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedPokemonSpeciesSummaryList' + description: '' + /api/v2/pokemon-species/{id}/: + get: + operationId: pokemon_species_retrieve + description: |- + Mixin to allow association with separate serializers + for list or detail view. + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this pokemon species. + required: true + tags: + - pokemon-species + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PokemonSpeciesDetail' + description: '' + /api/v2/pokemon/{id}/: + get: + operationId: pokemon_retrieve + description: |- + Mixin to allow association with separate serializers + for list or detail view. + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this pokemon. + required: true + tags: + - pokemon + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PokemonDetail' + description: '' + /api/v2/pokemon/{pokemon_id}/encounters: + get: + operationId: pokemon_encounters_retrieve + description: Handles Pokemon Encounters as a sub-resource. + parameters: + - in: path + name: pokemon_id + schema: + type: string + pattern: ^\d+$ + required: true + tags: + - pokemon + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + description: No response body + /api/v2/region/: + get: + operationId: region_list + description: |- + Mixin to allow association with separate serializers + for list or detail view. + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - region + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedRegionSummaryList' + description: '' + /api/v2/region/{id}/: + get: + operationId: region_retrieve + description: |- + Mixin to allow association with separate serializers + for list or detail view. + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this region. + required: true + tags: + - region + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/RegionDetail' + description: '' + /api/v2/stat/: + get: + operationId: stat_list + description: |- + Mixin to allow association with separate serializers + for list or detail view. + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - stat + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedStatSummaryList' + description: '' + /api/v2/stat/{id}/: + get: + operationId: stat_retrieve + description: |- + Mixin to allow association with separate serializers + for list or detail view. + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this stat. + required: true + tags: + - stat + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/StatDetail' + description: '' + /api/v2/super-contest-effect/: + get: + operationId: super_contest_effect_list + description: |- + Mixin to allow association with separate serializers + for list or detail view. + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - super-contest-effect + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedSuperContestEffectSummaryList' + description: '' + /api/v2/super-contest-effect/{id}/: + get: + operationId: super_contest_effect_retrieve + description: |- + Mixin to allow association with separate serializers + for list or detail view. + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this super contest effect. + required: true + tags: + - super-contest-effect + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/SuperContestEffectDetail' + description: '' + /api/v2/type/: + get: + operationId: type_list + description: |- + Mixin to allow association with separate serializers + for list or detail view. + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - type + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedTypeSummaryList' + description: '' + /api/v2/type/{id}/: + get: + operationId: type_retrieve + description: |- + Mixin to allow association with separate serializers + for list or detail view. + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this type. + required: true + tags: + - type + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/TypeDetail' + description: '' + /api/v2/version/: + get: + operationId: version_list + description: |- + Mixin to allow association with separate serializers + for list or detail view. + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - version + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedVersionSummaryList' + description: '' + /api/v2/version-group/: + get: + operationId: version_group_list + description: |- + Mixin to allow association with separate serializers + for list or detail view. + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - version-group + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedVersionGroupSummaryList' + description: '' + /api/v2/version-group/{id}/: + get: + operationId: version_group_retrieve + description: |- + Mixin to allow association with separate serializers + for list or detail view. + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this version group. + required: true + tags: + - version-group + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/VersionGroupDetail' + description: '' + /api/v2/version/{id}/: + get: + operationId: version_retrieve + description: |- + Mixin to allow association with separate serializers + for list or detail view. + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this version. + required: true + tags: + - version + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/VersionDetail' + description: '' +components: + schemas: + AbilityChange: + type: object + properties: + version_group: + $ref: '#/components/schemas/VersionGroupSummary' + effect_entries: + type: array + items: + $ref: '#/components/schemas/AbilityChangeEffectText' + readOnly: true + required: + - effect_entries + - version_group + AbilityChangeEffectText: + type: object + properties: + effect: + type: string + maxLength: 6000 + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - effect + - language + AbilityDetail: + type: object + properties: + id: + type: integer + readOnly: true + name: + type: string + maxLength: 100 + is_main_series: + type: boolean + generation: + $ref: '#/components/schemas/GenerationSummary' + names: + type: array + items: + $ref: '#/components/schemas/AbilityName' + readOnly: true + effect_entries: + type: array + items: + $ref: '#/components/schemas/AbilityEffectText' + readOnly: true + effect_changes: + type: array + items: + $ref: '#/components/schemas/AbilityChange' + readOnly: true + flavor_text_entries: + type: array + items: + $ref: '#/components/schemas/AbilityFlavorText' + readOnly: true + pokemon: + type: string + readOnly: true + required: + - effect_changes + - effect_entries + - flavor_text_entries + - generation + - id + - name + - names + - pokemon + AbilityEffectText: + type: object + properties: + effect: + type: string + maxLength: 6000 + short_effect: + type: string + maxLength: 300 + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - effect + - language + - short_effect + AbilityFlavorText: + type: object + properties: + flavor_text: + type: string + language: + $ref: '#/components/schemas/LanguageSummary' + version_group: + $ref: '#/components/schemas/VersionGroupSummary' + required: + - flavor_text + - language + - version_group + AbilityName: + type: object + properties: + name: + type: string + maxLength: 100 + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - language + - name + AbilitySummary: + type: object + properties: + name: + type: string + maxLength: 100 + url: + type: string + format: uri + readOnly: true + required: + - name + - url + BerryDetail: + type: object + properties: + id: + type: integer + readOnly: true + name: + type: string + maxLength: 100 + growth_time: + type: integer + maximum: 2147483647 + minimum: -2147483648 + max_harvest: + type: integer + maximum: 2147483647 + minimum: -2147483648 + natural_gift_power: + type: integer + maximum: 2147483647 + minimum: -2147483648 + size: + type: integer + maximum: 2147483647 + minimum: -2147483648 + smoothness: + type: integer + maximum: 2147483647 + minimum: -2147483648 + soil_dryness: + type: integer + maximum: 2147483647 + minimum: -2147483648 + firmness: + $ref: '#/components/schemas/BerryFirmnessSummary' + flavors: + type: string + readOnly: true + item: + $ref: '#/components/schemas/ItemSummary' + natural_gift_type: + $ref: '#/components/schemas/TypeSummary' + required: + - firmness + - flavors + - growth_time + - id + - item + - max_harvest + - name + - natural_gift_power + - natural_gift_type + - size + - smoothness + - soil_dryness + BerryFirmnessDetail: + type: object + properties: + id: + type: integer + readOnly: true + name: + type: string + maxLength: 100 + berries: + type: array + items: + $ref: '#/components/schemas/BerrySummary' + readOnly: true + names: + type: array + items: + $ref: '#/components/schemas/BerryFirmnessName' + readOnly: true + required: + - berries + - id + - name + - names + BerryFirmnessName: + type: object + properties: + name: + type: string + maxLength: 100 + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - language + - name + BerryFirmnessSummary: + type: object + properties: + name: + type: string + maxLength: 100 + url: + type: string + format: uri + readOnly: true + required: + - name + - url + BerryFlavorDetail: + type: object + properties: + id: + type: integer + readOnly: true + name: + type: string + maxLength: 100 + berries: + type: string + readOnly: true + contest_type: + $ref: '#/components/schemas/ContestTypeSummary' + names: + type: array + items: + $ref: '#/components/schemas/BerryFlavorName' + readOnly: true + required: + - berries + - contest_type + - id + - name + - names + BerryFlavorName: + type: object + properties: + name: + type: string + maxLength: 100 + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - language + - name + BerryFlavorSummary: + type: object + properties: + name: + type: string + maxLength: 100 + url: + type: string + format: uri + readOnly: true + required: + - name + - url + BerrySummary: + type: object + properties: + name: + type: string + maxLength: 100 + url: + type: string + format: uri + readOnly: true + required: + - name + - url + CharacteristicDescription: + type: object + properties: + description: + type: string + maxLength: 1000 + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - language + CharacteristicDetail: + type: object + properties: + id: + type: integer + readOnly: true + gene_modulo: + type: integer + possible_values: + type: string + readOnly: true + highest_stat: + $ref: '#/components/schemas/StatSummary' + descriptions: + type: array + items: + $ref: '#/components/schemas/CharacteristicDescription' + readOnly: true + required: + - descriptions + - gene_modulo + - highest_stat + - id + - possible_values + CharacteristicSummary: + type: object + properties: + url: + type: string + format: uri + readOnly: true + required: + - url + ContestEffectDetail: + type: object + properties: + id: + type: integer + readOnly: true + appeal: + type: integer + maximum: 2147483647 + minimum: -2147483648 + jam: + type: integer + maximum: 2147483647 + minimum: -2147483648 + effect_entries: + type: array + items: + $ref: '#/components/schemas/ContestEffectEffectText' + readOnly: true + flavor_text_entries: + type: array + items: + $ref: '#/components/schemas/ContestEffectFlavorText' + readOnly: true + required: + - appeal + - effect_entries + - flavor_text_entries + - id + - jam + ContestEffectEffectText: + type: object + properties: + effect: + type: string + maxLength: 6000 + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - effect + - language + ContestEffectFlavorText: + type: object + properties: + flavor_text: + type: string + maxLength: 500 + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - flavor_text + - language + ContestEffectSummary: + type: object + properties: + url: + type: string + format: uri + readOnly: true + required: + - url + ContestTypeDetail: + type: object + properties: + id: + type: integer + readOnly: true + name: + type: string + maxLength: 100 + berry_flavor: + allOf: + - $ref: '#/components/schemas/BerryFlavorSummary' + readOnly: true + names: + type: array + items: + $ref: '#/components/schemas/ContestTypeName' + readOnly: true + required: + - berry_flavor + - id + - name + - names + ContestTypeName: + type: object + properties: + name: + type: string + maxLength: 100 + color: + type: string + maxLength: 10 + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - color + - language + - name + ContestTypeSummary: + type: object + properties: + name: + type: string + maxLength: 100 + url: + type: string + format: uri + readOnly: true + required: + - name + - url + EggGroupDetail: + type: object + properties: + id: + type: integer + readOnly: true + name: + type: string + maxLength: 100 + names: + type: array + items: + $ref: '#/components/schemas/EggGroupName' + readOnly: true + pokemon_species: + type: string + readOnly: true + required: + - id + - name + - names + - pokemon_species + EggGroupName: + type: object + properties: + name: + type: string + maxLength: 100 + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - language + - name + EggGroupSummary: + type: object + properties: + name: + type: string + maxLength: 100 + url: + type: string + format: uri + readOnly: true + required: + - name + - url + EncounterConditionDetail: + type: object + properties: + id: + type: integer + readOnly: true + name: + type: string + maxLength: 100 + values: + type: array + items: + $ref: '#/components/schemas/EncounterConditionValueSummary' + readOnly: true + names: + type: array + items: + $ref: '#/components/schemas/EncounterConditionName' + readOnly: true + required: + - id + - name + - names + - values + EncounterConditionName: + type: object + properties: + name: + type: string + maxLength: 100 + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - language + - name + EncounterConditionSummary: + type: object + properties: + name: + type: string + maxLength: 100 + url: + type: string + format: uri + readOnly: true + required: + - name + - url + EncounterConditionValueDetail: + type: object + properties: + id: + type: integer + readOnly: true + name: + type: string + maxLength: 100 + condition: + $ref: '#/components/schemas/EncounterConditionSummary' + names: + type: array + items: + $ref: '#/components/schemas/EncounterConditionValueName' + readOnly: true + required: + - condition + - id + - name + - names + EncounterConditionValueName: + type: object + properties: + name: + type: string + maxLength: 100 + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - language + - name + EncounterConditionValueSummary: + type: object + properties: + name: + type: string + maxLength: 100 + url: + type: string + format: uri + readOnly: true + required: + - name + - url + EncounterMethodDetail: + type: object + properties: + id: + type: integer + readOnly: true + name: + type: string + maxLength: 100 + order: + type: + - integer + - 'null' + maximum: 2147483647 + minimum: -2147483648 + names: + type: array + items: + $ref: '#/components/schemas/EncounterMethodName' + readOnly: true + required: + - id + - name + - names + EncounterMethodName: + type: object + properties: + name: + type: string + maxLength: 100 + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - language + - name + EncounterMethodSummary: + type: object + properties: + name: + type: string + maxLength: 100 + url: + type: string + format: uri + readOnly: true + required: + - name + - url + EvolutionChainDetail: + type: object + properties: + id: + type: integer + readOnly: true + baby_trigger_item: + $ref: '#/components/schemas/ItemSummary' + chain: + type: string + readOnly: true + required: + - baby_trigger_item + - chain + - id + EvolutionChainSummary: + type: object + properties: + url: + type: string + format: uri + readOnly: true + required: + - url + EvolutionTriggerDetail: + type: object + properties: + id: + type: integer + readOnly: true + name: + type: string + maxLength: 100 + names: + type: array + items: + $ref: '#/components/schemas/EvolutionTriggerName' + readOnly: true + pokemon_species: + type: string + readOnly: true + required: + - id + - name + - names + - pokemon_species + EvolutionTriggerName: + type: object + properties: + name: + type: string + maxLength: 100 + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - language + - name + EvolutionTriggerSummary: + type: object + properties: + name: + type: string + maxLength: 100 + url: + type: string + format: uri + readOnly: true + required: + - name + - url + Experience: + type: object + properties: + level: + type: integer + maximum: 2147483647 + minimum: -2147483648 + experience: + type: integer + maximum: 2147483647 + minimum: -2147483648 + required: + - experience + - level + GenderDetail: + type: object + properties: + id: + type: integer + readOnly: true + name: + type: string + maxLength: 100 + pokemon_species_details: + type: string + readOnly: true + required_for_evolution: + type: string + readOnly: true + required: + - id + - name + - pokemon_species_details + - required_for_evolution + GenderSummary: + type: object + properties: + name: + type: string + maxLength: 100 + url: + type: string + format: uri + readOnly: true + required: + - name + - url + GenerationDetail: + type: object + properties: + id: + type: integer + readOnly: true + name: + type: string + maxLength: 100 + abilities: + type: array + items: + $ref: '#/components/schemas/AbilitySummary' + readOnly: true + main_region: + $ref: '#/components/schemas/RegionSummary' + moves: + type: array + items: + $ref: '#/components/schemas/MoveSummary' + readOnly: true + names: + type: array + items: + $ref: '#/components/schemas/GenerationName' + readOnly: true + pokemon_species: + type: array + items: + $ref: '#/components/schemas/PokemonSpeciesSummary' + readOnly: true + types: + type: array + items: + $ref: '#/components/schemas/TypeSummary' + readOnly: true + version_groups: + type: array + items: + $ref: '#/components/schemas/VersionGroupSummary' + readOnly: true + required: + - abilities + - id + - main_region + - moves + - name + - names + - pokemon_species + - types + - version_groups + GenerationName: + type: object + properties: + name: + type: string + maxLength: 100 + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - language + - name + GenerationSummary: + type: object + properties: + name: + type: string + maxLength: 100 + url: + type: string + format: uri + readOnly: true + required: + - name + - url + GrowthRateDescription: + type: object + properties: + description: + type: string + maxLength: 1000 + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - language + GrowthRateDetail: + type: object + properties: + id: + type: integer + readOnly: true + name: + type: string + maxLength: 100 + formula: + type: string + maxLength: 500 + descriptions: + type: array + items: + $ref: '#/components/schemas/GrowthRateDescription' + readOnly: true + levels: + type: array + items: + $ref: '#/components/schemas/Experience' + readOnly: true + pokemon_species: + type: array + items: + $ref: '#/components/schemas/PokemonSpeciesSummary' + readOnly: true + required: + - descriptions + - formula + - id + - levels + - name + - pokemon_species + GrowthRateSummary: + type: object + properties: + name: + type: string + maxLength: 100 + url: + type: string + format: uri + readOnly: true + required: + - name + - url + ItemAttributeDescription: + type: object + properties: + description: + type: string + maxLength: 1000 + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - language + ItemAttributeDetail: + type: object + properties: + id: + type: integer + readOnly: true + name: + type: string + maxLength: 100 + descriptions: + type: array + items: + $ref: '#/components/schemas/ItemAttributeDescription' + readOnly: true + items: + type: string + readOnly: true + names: + type: array + items: + $ref: '#/components/schemas/ItemAttributeName' + readOnly: true + required: + - descriptions + - id + - items + - name + - names + ItemAttributeName: + type: object + properties: + name: + type: string + maxLength: 100 + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - language + - name + ItemAttributeSummary: + type: object + properties: + name: + type: string + maxLength: 100 + url: + type: string + format: uri + readOnly: true + required: + - name + - url + ItemCategoryDetail: + type: object + properties: + id: + type: integer + readOnly: true + name: + type: string + maxLength: 100 + items: + type: array + items: + $ref: '#/components/schemas/ItemSummary' + readOnly: true + names: + type: array + items: + $ref: '#/components/schemas/ItemCategoryName' + readOnly: true + pocket: + $ref: '#/components/schemas/ItemPocketSummary' + required: + - id + - items + - name + - names + - pocket + ItemCategoryName: + type: object + properties: + name: + type: string + maxLength: 100 + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - language + - name + ItemCategorySummary: + type: object + properties: + name: + type: string + maxLength: 100 + url: + type: string + format: uri + readOnly: true + required: + - name + - url + ItemDetail: + type: object + properties: + id: + type: integer + readOnly: true + name: + type: string + maxLength: 100 + cost: + type: + - integer + - 'null' + maximum: 2147483647 + minimum: -2147483648 + fling_power: + type: + - integer + - 'null' + maximum: 2147483647 + minimum: -2147483648 + fling_effect: + $ref: '#/components/schemas/ItemFlingEffectSummary' + attributes: + type: string + readOnly: true + category: + $ref: '#/components/schemas/ItemCategorySummary' + effect_entries: + type: array + items: + $ref: '#/components/schemas/ItemEffectText' + readOnly: true + flavor_text_entries: + type: array + items: + $ref: '#/components/schemas/ItemFlavorText' + readOnly: true + game_indices: + type: array + items: + $ref: '#/components/schemas/ItemGameIndex' + readOnly: true + names: + type: array + items: + $ref: '#/components/schemas/ItemName' + readOnly: true + held_by_pokemon: + type: string + readOnly: true + sprites: + type: string + readOnly: true + baby_trigger_for: + type: string + readOnly: true + machines: + type: string + readOnly: true + required: + - attributes + - baby_trigger_for + - category + - effect_entries + - flavor_text_entries + - fling_effect + - game_indices + - held_by_pokemon + - id + - machines + - name + - names + - sprites + ItemEffectText: + type: object + properties: + effect: + type: string + maxLength: 6000 + short_effect: + type: string + maxLength: 300 + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - effect + - language + - short_effect + ItemFlavorText: + type: object + properties: + text: + type: string + version_group: + $ref: '#/components/schemas/VersionGroupSummary' + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - language + - text + - version_group + ItemFlingEffectDetail: + type: object + properties: + id: + type: integer + readOnly: true + name: + type: string + maxLength: 100 + effect_entries: + type: array + items: + $ref: '#/components/schemas/ItemFlingEffectEffectText' + readOnly: true + items: + type: array + items: + $ref: '#/components/schemas/ItemSummary' + readOnly: true + required: + - effect_entries + - id + - items + - name + ItemFlingEffectEffectText: + type: object + properties: + effect: + type: string + maxLength: 6000 + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - effect + - language + ItemFlingEffectSummary: + type: object + properties: + name: + type: string + maxLength: 100 + url: + type: string + format: uri + readOnly: true + required: + - name + - url + ItemGameIndex: + type: object + properties: + game_index: + type: integer + maximum: 2147483647 + minimum: -2147483648 + generation: + $ref: '#/components/schemas/GenerationSummary' + required: + - game_index + - generation + ItemName: + type: object + properties: + name: + type: string + maxLength: 100 + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - language + - name + ItemPocketDetail: + type: object + properties: + id: + type: integer + readOnly: true + name: + type: string + maxLength: 100 + categories: + type: array + items: + $ref: '#/components/schemas/ItemCategorySummary' + readOnly: true + names: + type: array + items: + $ref: '#/components/schemas/ItemPocketName' + readOnly: true + required: + - categories + - id + - name + - names + ItemPocketName: + type: object + properties: + name: + type: string + maxLength: 100 + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - language + - name + ItemPocketSummary: + type: object + properties: + name: + type: string + maxLength: 100 + url: + type: string + format: uri + readOnly: true + required: + - name + - url + ItemSummary: + type: object + properties: + name: + type: string + maxLength: 100 + url: + type: string + format: uri + readOnly: true + required: + - name + - url + LanguageDetail: + type: object + properties: + id: + type: integer + readOnly: true + name: + type: string + maxLength: 100 + official: + type: boolean + iso639: + type: string + maxLength: 10 + iso3166: + type: string + maxLength: 2 + names: + type: array + items: + $ref: '#/components/schemas/LanguageName' + readOnly: true + required: + - id + - iso3166 + - iso639 + - name + - names + LanguageName: + type: object + properties: + name: + type: string + maxLength: 100 + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - language + - name + LanguageSummary: + type: object + properties: + name: + type: string + maxLength: 100 + url: + type: string + format: uri + readOnly: true + required: + - name + - url + LocationAreaDetail: + type: object + properties: + id: + type: integer + readOnly: true + name: + type: string + maxLength: 100 + game_index: + type: integer + maximum: 2147483647 + minimum: -2147483648 + encounter_method_rates: + type: string + readOnly: true + location: + $ref: '#/components/schemas/LocationSummary' + names: + type: array + items: + $ref: '#/components/schemas/LocationAreaName' + readOnly: true + pokemon_encounters: + type: string + readOnly: true + required: + - encounter_method_rates + - game_index + - id + - location + - name + - names + - pokemon_encounters + LocationAreaName: + type: object + properties: + name: + type: string + maxLength: 100 + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - language + - name + LocationAreaSummary: + type: object + properties: + name: + type: string + maxLength: 100 + url: + type: string + format: uri + readOnly: true + required: + - name + - url + LocationDetail: + type: object + properties: + id: + type: integer + readOnly: true + name: + type: string + maxLength: 100 + region: + $ref: '#/components/schemas/RegionSummary' + names: + type: array + items: + $ref: '#/components/schemas/LocationName' + readOnly: true + game_indices: + type: array + items: + $ref: '#/components/schemas/LocationGameIndex' + readOnly: true + areas: + type: array + items: + $ref: '#/components/schemas/LocationAreaSummary' + readOnly: true + required: + - areas + - game_indices + - id + - name + - names + - region + LocationGameIndex: + type: object + properties: + game_index: + type: integer + maximum: 2147483647 + minimum: -2147483648 + generation: + $ref: '#/components/schemas/GenerationSummary' + required: + - game_index + - generation + LocationName: + type: object + properties: + name: + type: string + maxLength: 100 + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - language + - name + LocationSummary: + type: object + properties: + name: + type: string + maxLength: 100 + url: + type: string + format: uri + readOnly: true + required: + - name + - url + MachineDetail: + type: object + properties: + id: + type: integer + readOnly: true + item: + $ref: '#/components/schemas/ItemSummary' + version_group: + $ref: '#/components/schemas/VersionGroupSummary' + move: + $ref: '#/components/schemas/MoveSummary' + required: + - id + - item + - move + - version_group + MachineSummary: + type: object + properties: + url: + type: string + format: uri + readOnly: true + required: + - url + MoveBattleStyleDetail: + type: object + properties: + id: + type: integer + readOnly: true + name: + type: string + maxLength: 100 + names: + type: array + items: + $ref: '#/components/schemas/MoveBattleStyleName' + readOnly: true + required: + - id + - name + - names + MoveBattleStyleName: + type: object + properties: + name: + type: string + maxLength: 100 + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - language + - name + MoveBattleStyleSummary: + type: object + properties: + name: + type: string + maxLength: 100 + url: + type: string + format: uri + readOnly: true + required: + - name + - url + MoveChange: + type: object + properties: + accuracy: + type: + - integer + - 'null' + maximum: 2147483647 + minimum: -2147483648 + power: + type: + - integer + - 'null' + maximum: 2147483647 + minimum: -2147483648 + pp: + type: + - integer + - 'null' + maximum: 2147483647 + minimum: -2147483648 + effect_chance: + type: integer + effect_entries: + type: string + readOnly: true + type: + $ref: '#/components/schemas/TypeSummary' + version_group: + $ref: '#/components/schemas/VersionGroupSummary' + required: + - effect_chance + - effect_entries + - type + - version_group + MoveDamageClassDescription: + type: object + properties: + description: + type: string + maxLength: 1000 + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - language + MoveDamageClassDetail: + type: object + properties: + id: + type: integer + readOnly: true + name: + type: string + maxLength: 100 + descriptions: + type: array + items: + $ref: '#/components/schemas/MoveDamageClassDescription' + readOnly: true + moves: + type: array + items: + $ref: '#/components/schemas/MoveSummary' + readOnly: true + names: + type: array + items: + $ref: '#/components/schemas/MoveDamageClassName' + readOnly: true + required: + - descriptions + - id + - moves + - name + - names + MoveDamageClassName: + type: object + properties: + name: + type: string + maxLength: 100 + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - language + - name + MoveDamageClassSummary: + type: object + properties: + name: + type: string + maxLength: 100 + url: + type: string + format: uri + readOnly: true + required: + - name + - url + MoveDetail: + type: object + properties: + id: + type: integer + readOnly: true + name: + type: string + maxLength: 100 + accuracy: + type: + - integer + - 'null' + maximum: 2147483647 + minimum: -2147483648 + effect_chance: + type: integer + pp: + type: + - integer + - 'null' + maximum: 2147483647 + minimum: -2147483648 + priority: + type: + - integer + - 'null' + maximum: 2147483647 + minimum: -2147483648 + power: + type: + - integer + - 'null' + maximum: 2147483647 + minimum: -2147483648 + contest_combos: + type: string + readOnly: true + contest_type: + $ref: '#/components/schemas/ContestTypeSummary' + contest_effect: + $ref: '#/components/schemas/ContestEffectSummary' + damage_class: + $ref: '#/components/schemas/MoveDamageClassSummary' + effect_entries: + type: string + readOnly: true + effect_changes: + type: string + readOnly: true + generation: + $ref: '#/components/schemas/GenerationSummary' + meta: + allOf: + - $ref: '#/components/schemas/MoveMeta' + readOnly: true + names: + type: array + items: + $ref: '#/components/schemas/MoveName' + readOnly: true + past_values: + type: array + items: + $ref: '#/components/schemas/MoveChange' + readOnly: true + stat_changes: + type: string + readOnly: true + super_contest_effect: + $ref: '#/components/schemas/SuperContestEffectSummary' + target: + $ref: '#/components/schemas/MoveTargetSummary' + type: + $ref: '#/components/schemas/TypeSummary' + machines: + type: string + readOnly: true + flavor_text_entries: + type: array + items: + $ref: '#/components/schemas/MoveFlavorText' + readOnly: true + learned_by_pokemon: + type: string + readOnly: true + required: + - contest_combos + - contest_effect + - contest_type + - damage_class + - effect_chance + - effect_changes + - effect_entries + - flavor_text_entries + - generation + - id + - learned_by_pokemon + - machines + - meta + - name + - names + - past_values + - stat_changes + - super_contest_effect + - target + - type + MoveFlavorText: + type: object + properties: + flavor_text: + type: string + language: + $ref: '#/components/schemas/LanguageSummary' + version_group: + $ref: '#/components/schemas/VersionGroupSummary' + required: + - flavor_text + - language + - version_group + MoveLearnMethodDescription: + type: object + properties: + description: + type: string + maxLength: 1000 + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - language + MoveLearnMethodDetail: + type: object + properties: + id: + type: integer + readOnly: true + name: + type: string + maxLength: 100 + names: + type: array + items: + $ref: '#/components/schemas/MoveLearnMethodName' + readOnly: true + descriptions: + type: array + items: + $ref: '#/components/schemas/MoveLearnMethodDescription' + readOnly: true + version_groups: + type: string + readOnly: true + required: + - descriptions + - id + - name + - names + - version_groups + MoveLearnMethodName: + type: object + properties: + name: + type: string + maxLength: 100 + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - language + - name + MoveLearnMethodSummary: + type: object + properties: + name: + type: string + maxLength: 100 + url: + type: string + format: uri + readOnly: true + required: + - name + - url + MoveMeta: + type: object + properties: + ailment: + $ref: '#/components/schemas/MoveMetaAilmentSummary' + category: + $ref: '#/components/schemas/MoveMetaCategorySummary' + min_hits: + type: + - integer + - 'null' + maximum: 2147483647 + minimum: -2147483648 + max_hits: + type: + - integer + - 'null' + maximum: 2147483647 + minimum: -2147483648 + min_turns: + type: + - integer + - 'null' + maximum: 2147483647 + minimum: -2147483648 + max_turns: + type: + - integer + - 'null' + maximum: 2147483647 + minimum: -2147483648 + drain: + type: + - integer + - 'null' + maximum: 2147483647 + minimum: -2147483648 + healing: + type: + - integer + - 'null' + maximum: 2147483647 + minimum: -2147483648 + crit_rate: + type: + - integer + - 'null' + maximum: 2147483647 + minimum: -2147483648 + ailment_chance: + type: + - integer + - 'null' + maximum: 2147483647 + minimum: -2147483648 + flinch_chance: + type: + - integer + - 'null' + maximum: 2147483647 + minimum: -2147483648 + stat_chance: + type: + - integer + - 'null' + maximum: 2147483647 + minimum: -2147483648 + required: + - ailment + - category + MoveMetaAilmentDetail: + type: object + properties: + id: + type: integer + readOnly: true + name: + type: string + maxLength: 100 + moves: + type: string + readOnly: true + names: + type: array + items: + $ref: '#/components/schemas/MoveMetaAilmentName' + readOnly: true + required: + - id + - moves + - name + - names + MoveMetaAilmentName: + type: object + properties: + name: + type: string + maxLength: 100 + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - language + - name + MoveMetaAilmentSummary: + type: object + properties: + name: + type: string + maxLength: 100 + url: + type: string + format: uri + readOnly: true + required: + - name + - url + MoveMetaCategoryDescription: + type: object + properties: + description: + type: string + maxLength: 1000 + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - language + MoveMetaCategoryDetail: + type: object + properties: + id: + type: integer + readOnly: true + name: + type: string + maxLength: 100 + descriptions: + type: array + items: + $ref: '#/components/schemas/MoveMetaCategoryDescription' + readOnly: true + moves: + type: string + readOnly: true + required: + - descriptions + - id + - moves + - name + MoveMetaCategorySummary: + type: object + properties: + name: + type: string + maxLength: 100 + url: + type: string + format: uri + readOnly: true + required: + - name + - url + MoveName: + type: object + properties: + name: + type: string + maxLength: 100 + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - language + - name + MoveSummary: + type: object + properties: + name: + type: string + maxLength: 100 + url: + type: string + format: uri + readOnly: true + required: + - name + - url + MoveTargetDescription: + type: object + properties: + description: + type: string + maxLength: 1000 + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - language + MoveTargetDetail: + type: object + properties: + id: + type: integer + readOnly: true + name: + type: string + maxLength: 100 + descriptions: + type: array + items: + $ref: '#/components/schemas/MoveTargetDescription' + readOnly: true + moves: + type: array + items: + $ref: '#/components/schemas/MoveSummary' + readOnly: true + names: + type: array + items: + $ref: '#/components/schemas/MoveTargetName' + readOnly: true + required: + - descriptions + - id + - moves + - name + - names + MoveTargetName: + type: object + properties: + name: + type: string + maxLength: 100 + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - language + - name + MoveTargetSummary: + type: object + properties: + name: + type: string + maxLength: 100 + url: + type: string + format: uri + readOnly: true + required: + - name + - url + NatureBattleStylePreference: + type: object + properties: + low_hp_preference: + type: integer + maximum: 2147483647 + minimum: -2147483648 + high_hp_preference: + type: integer + maximum: 2147483647 + minimum: -2147483648 + move_battle_style: + $ref: '#/components/schemas/MoveBattleStyleSummary' + required: + - high_hp_preference + - low_hp_preference + - move_battle_style + NatureDetail: + type: object + properties: + id: + type: integer + readOnly: true + name: + type: string + maxLength: 100 + decreased_stat: + $ref: '#/components/schemas/StatSummary' + increased_stat: + $ref: '#/components/schemas/StatSummary' + likes_flavor: + $ref: '#/components/schemas/BerryFlavorSummary' + hates_flavor: + $ref: '#/components/schemas/BerryFlavorSummary' + berries: + type: array + items: + $ref: '#/components/schemas/BerrySummary' + readOnly: true + pokeathlon_stat_changes: + type: string + readOnly: true + move_battle_style_preferences: + type: array + items: + $ref: '#/components/schemas/NatureBattleStylePreference' + readOnly: true + names: + type: array + items: + $ref: '#/components/schemas/NatureName' + readOnly: true + required: + - berries + - decreased_stat + - hates_flavor + - id + - increased_stat + - likes_flavor + - move_battle_style_preferences + - name + - names + - pokeathlon_stat_changes + NatureName: + type: object + properties: + name: + type: string + maxLength: 100 + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - language + - name + NatureSummary: + type: object + properties: + name: + type: string + maxLength: 100 + url: + type: string + format: uri + readOnly: true + required: + - name + - url + PaginatedAbilitySummaryList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/AbilitySummary' + PaginatedBerryFirmnessSummaryList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/BerryFirmnessSummary' + PaginatedBerryFlavorSummaryList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/BerryFlavorSummary' + PaginatedBerrySummaryList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/BerrySummary' + PaginatedCharacteristicSummaryList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/CharacteristicSummary' + PaginatedContestEffectSummaryList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/ContestEffectSummary' + PaginatedContestTypeSummaryList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/ContestTypeSummary' + PaginatedEggGroupSummaryList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/EggGroupSummary' + PaginatedEncounterConditionSummaryList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/EncounterConditionSummary' + PaginatedEncounterConditionValueSummaryList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/EncounterConditionValueSummary' + PaginatedEncounterMethodSummaryList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/EncounterMethodSummary' + PaginatedEvolutionChainSummaryList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/EvolutionChainSummary' + PaginatedEvolutionTriggerSummaryList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/EvolutionTriggerSummary' + PaginatedGenderSummaryList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/GenderSummary' + PaginatedGenerationSummaryList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/GenerationSummary' + PaginatedGrowthRateSummaryList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/GrowthRateSummary' + PaginatedItemAttributeSummaryList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/ItemAttributeSummary' + PaginatedItemCategorySummaryList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/ItemCategorySummary' + PaginatedItemFlingEffectSummaryList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/ItemFlingEffectSummary' + PaginatedItemPocketSummaryList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/ItemPocketSummary' + PaginatedItemSummaryList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/ItemSummary' + PaginatedLanguageSummaryList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/LanguageSummary' + PaginatedLocationAreaSummaryList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/LocationAreaSummary' + PaginatedLocationSummaryList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/LocationSummary' + PaginatedMachineSummaryList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/MachineSummary' + PaginatedMoveBattleStyleSummaryList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/MoveBattleStyleSummary' + PaginatedMoveDamageClassSummaryList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/MoveDamageClassSummary' + PaginatedMoveLearnMethodSummaryList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/MoveLearnMethodSummary' + PaginatedMoveMetaAilmentSummaryList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/MoveMetaAilmentSummary' + PaginatedMoveMetaCategorySummaryList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/MoveMetaCategorySummary' + PaginatedMoveSummaryList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/MoveSummary' + PaginatedMoveTargetSummaryList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/MoveTargetSummary' + PaginatedNatureSummaryList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/NatureSummary' + PaginatedPalParkAreaSummaryList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/PalParkAreaSummary' + PaginatedPokeathlonStatSummaryList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/PokeathlonStatSummary' + PaginatedPokedexSummaryList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/PokedexSummary' + PaginatedPokemonColorSummaryList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/PokemonColorSummary' + PaginatedPokemonFormSummaryList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/PokemonFormSummary' + PaginatedPokemonHabitatSummaryList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/PokemonHabitatSummary' + PaginatedPokemonShapeSummaryList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/PokemonShapeSummary' + PaginatedPokemonSpeciesSummaryList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/PokemonSpeciesSummary' + PaginatedPokemonSummaryList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/PokemonSummary' + PaginatedRegionSummaryList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/RegionSummary' + PaginatedStatSummaryList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/StatSummary' + PaginatedSuperContestEffectSummaryList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/SuperContestEffectSummary' + PaginatedTypeSummaryList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/TypeSummary' + PaginatedVersionGroupSummaryList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/VersionGroupSummary' + PaginatedVersionSummaryList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/VersionSummary' + PalParkAreaDetail: + type: object + properties: + id: + type: integer + readOnly: true + name: + type: string + maxLength: 100 + names: + type: array + items: + $ref: '#/components/schemas/PalParkAreaName' + readOnly: true + pokemon_encounters: + type: string + readOnly: true + required: + - id + - name + - names + - pokemon_encounters + PalParkAreaName: + type: object + properties: + name: + type: string + maxLength: 100 + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - language + - name + PalParkAreaSummary: + type: object + properties: + name: + type: string + maxLength: 100 + url: + type: string + format: uri + readOnly: true + required: + - name + - url + PokeathlonStatDetail: + type: object + properties: + id: + type: integer + readOnly: true + name: + type: string + maxLength: 100 + affecting_natures: + type: string + readOnly: true + names: + type: array + items: + $ref: '#/components/schemas/PokeathlonStatName' + readOnly: true + required: + - affecting_natures + - id + - name + - names + PokeathlonStatName: + type: object + properties: + name: + type: string + maxLength: 100 + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - language + - name + PokeathlonStatSummary: + type: object + properties: + name: + type: string + maxLength: 100 + url: + type: string + format: uri + readOnly: true + required: + - name + - url + PokedexDescription: + type: object + properties: + description: + type: string + maxLength: 1000 + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - language + PokedexDetail: + type: object + properties: + id: + type: integer + readOnly: true + name: + type: string + maxLength: 100 + is_main_series: + type: boolean + descriptions: + type: array + items: + $ref: '#/components/schemas/PokedexDescription' + readOnly: true + names: + type: array + items: + $ref: '#/components/schemas/PokedexName' + readOnly: true + pokemon_entries: + type: string + readOnly: true + region: + $ref: '#/components/schemas/RegionSummary' + version_groups: + type: string + readOnly: true + required: + - descriptions + - id + - name + - names + - pokemon_entries + - region + - version_groups + PokedexName: + type: object + properties: + name: + type: string + maxLength: 100 + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - language + - name + PokedexSummary: + type: object + properties: + name: + type: string + maxLength: 100 + url: + type: string + format: uri + readOnly: true + required: + - name + - url + PokemonColorDetail: + type: object + properties: + id: + type: integer + readOnly: true + name: + type: string + maxLength: 100 + names: + type: array + items: + $ref: '#/components/schemas/PokemonColorName' + readOnly: true + pokemon_species: + type: array + items: + $ref: '#/components/schemas/PokemonSpeciesSummary' + readOnly: true + required: + - id + - name + - names + - pokemon_species + PokemonColorName: + type: object + properties: + name: + type: string + maxLength: 100 + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - language + - name + PokemonColorSummary: + type: object + properties: + name: + type: string + maxLength: 100 + url: + type: string + format: uri + readOnly: true + required: + - name + - url + PokemonDetail: + type: object + properties: + id: + type: integer + readOnly: true + name: + type: string + maxLength: 100 + base_experience: + type: + - integer + - 'null' + maximum: 2147483647 + minimum: -2147483648 + height: + type: + - integer + - 'null' + maximum: 2147483647 + minimum: -2147483648 + is_default: + type: boolean + order: + type: + - integer + - 'null' + maximum: 2147483647 + minimum: -2147483648 + weight: + type: + - integer + - 'null' + maximum: 2147483647 + minimum: -2147483648 + abilities: + type: string + readOnly: true + past_abilities: + type: string + readOnly: true + forms: + type: array + items: + $ref: '#/components/schemas/PokemonFormSummary' + readOnly: true + game_indices: + type: array + items: + $ref: '#/components/schemas/PokemonGameIndex' + readOnly: true + held_items: + type: string + readOnly: true + location_area_encounters: + type: string + readOnly: true + moves: + type: string + readOnly: true + species: + $ref: '#/components/schemas/PokemonSpeciesSummary' + sprites: + type: string + readOnly: true + cries: + type: string + readOnly: true + stats: + type: array + items: + $ref: '#/components/schemas/PokemonStat' + readOnly: true + types: + type: string + readOnly: true + past_types: + type: string + readOnly: true + required: + - abilities + - cries + - forms + - game_indices + - held_items + - id + - location_area_encounters + - moves + - name + - past_abilities + - past_types + - species + - sprites + - stats + - types + PokemonDexEntry: + type: object + properties: + entry_number: + type: integer + pokedex: + $ref: '#/components/schemas/PokedexSummary' + required: + - entry_number + - pokedex + PokemonFormDetail: + type: object + properties: + id: + type: integer + readOnly: true + name: + type: string + maxLength: 100 + order: + type: + - integer + - 'null' + maximum: 2147483647 + minimum: -2147483648 + form_order: + type: + - integer + - 'null' + maximum: 2147483647 + minimum: -2147483648 + is_default: + type: boolean + is_battle_only: + type: boolean + is_mega: + type: boolean + form_name: + type: string + maxLength: 30 + pokemon: + $ref: '#/components/schemas/PokemonSummary' + sprites: + type: string + readOnly: true + version_group: + $ref: '#/components/schemas/VersionGroupSummary' + form_names: + type: string + readOnly: true + names: + type: string + readOnly: true + types: + type: string + readOnly: true + required: + - form_name + - form_names + - id + - name + - names + - pokemon + - sprites + - types + - version_group + PokemonFormSummary: + type: object + properties: + name: + type: string + maxLength: 100 + url: + type: string + format: uri + readOnly: true + required: + - name + - url + PokemonGameIndex: + type: object + properties: + game_index: + type: integer + maximum: 2147483647 + minimum: -2147483648 + version: + $ref: '#/components/schemas/VersionSummary' + required: + - game_index + - version + PokemonHabitatDetail: + type: object + properties: + id: + type: integer + readOnly: true + name: + type: string + maxLength: 100 + names: + type: array + items: + $ref: '#/components/schemas/PokemonHabitatName' + readOnly: true + pokemon_species: + type: array + items: + $ref: '#/components/schemas/PokemonSpeciesSummary' + readOnly: true + required: + - id + - name + - names + - pokemon_species + PokemonHabitatName: + type: object + properties: + name: + type: string + maxLength: 100 + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - language + - name + PokemonHabitatSummary: + type: object + properties: + name: + type: string + maxLength: 100 + url: + type: string + format: uri + readOnly: true + required: + - name + - url + PokemonShapeDetail: + type: object + properties: + id: + type: integer + readOnly: true + name: + type: string + maxLength: 100 + awesome_names: + type: string + readOnly: true + names: + type: string + readOnly: true + pokemon_species: + type: array + items: + $ref: '#/components/schemas/PokemonSpeciesSummary' + readOnly: true + required: + - awesome_names + - id + - name + - names + - pokemon_species + PokemonShapeSummary: + type: object + properties: + name: + type: string + maxLength: 100 + url: + type: string + format: uri + readOnly: true + required: + - name + - url + PokemonSpeciesDescription: + type: object + properties: + description: + type: string + maxLength: 1000 + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - language + PokemonSpeciesDetail: + type: object + properties: + id: + type: integer + readOnly: true + name: + type: string + maxLength: 100 + order: + type: + - integer + - 'null' + maximum: 2147483647 + minimum: -2147483648 + gender_rate: + type: + - integer + - 'null' + maximum: 2147483647 + minimum: -2147483648 + capture_rate: + type: + - integer + - 'null' + maximum: 2147483647 + minimum: -2147483648 + base_happiness: + type: + - integer + - 'null' + maximum: 2147483647 + minimum: -2147483648 + is_baby: + type: boolean + is_legendary: + type: boolean + is_mythical: + type: boolean + hatch_counter: + type: + - integer + - 'null' + maximum: 2147483647 + minimum: -2147483648 + has_gender_differences: + type: boolean + forms_switchable: + type: boolean + growth_rate: + $ref: '#/components/schemas/GrowthRateSummary' + pokedex_numbers: + type: array + items: + $ref: '#/components/schemas/PokemonDexEntry' + readOnly: true + egg_groups: + type: string + readOnly: true + color: + $ref: '#/components/schemas/PokemonColorSummary' + shape: + $ref: '#/components/schemas/PokemonShapeSummary' + evolves_from_species: + $ref: '#/components/schemas/PokemonSpeciesSummary' + evolution_chain: + $ref: '#/components/schemas/EvolutionChainSummary' + habitat: + $ref: '#/components/schemas/PokemonHabitatSummary' + generation: + $ref: '#/components/schemas/GenerationSummary' + names: + type: string + readOnly: true + pal_park_encounters: + type: string + readOnly: true + form_descriptions: + type: array + items: + $ref: '#/components/schemas/PokemonSpeciesDescription' + readOnly: true + flavor_text_entries: + type: array + items: + $ref: '#/components/schemas/PokemonSpeciesFlavorText' + readOnly: true + genera: + type: string + readOnly: true + varieties: + type: string + readOnly: true + required: + - color + - egg_groups + - evolution_chain + - evolves_from_species + - flavor_text_entries + - form_descriptions + - genera + - generation + - growth_rate + - habitat + - id + - name + - names + - pal_park_encounters + - pokedex_numbers + - shape + - varieties + PokemonSpeciesFlavorText: + type: object + properties: + flavor_text: + type: string + language: + $ref: '#/components/schemas/LanguageSummary' + version: + $ref: '#/components/schemas/VersionSummary' + required: + - flavor_text + - language + - version + PokemonSpeciesSummary: + type: object + properties: + name: + type: string + maxLength: 100 + url: + type: string + format: uri + readOnly: true + required: + - name + - url + PokemonStat: + type: object + properties: + base_stat: + type: integer + maximum: 2147483647 + minimum: -2147483648 + effort: + type: integer + maximum: 2147483647 + minimum: -2147483648 + stat: + $ref: '#/components/schemas/StatSummary' + required: + - base_stat + - effort + - stat + PokemonSummary: + type: object + properties: + name: + type: string + maxLength: 100 + url: + type: string + format: uri + readOnly: true + required: + - name + - url + RegionDetail: + type: object + properties: + id: + type: integer + readOnly: true + name: + type: string + maxLength: 100 + locations: + type: array + items: + $ref: '#/components/schemas/LocationSummary' + readOnly: true + main_generation: + allOf: + - $ref: '#/components/schemas/GenerationSummary' + readOnly: true + names: + type: array + items: + $ref: '#/components/schemas/RegionName' + readOnly: true + pokedexes: + type: array + items: + $ref: '#/components/schemas/PokedexSummary' + readOnly: true + version_groups: + type: string + readOnly: true + required: + - id + - locations + - main_generation + - name + - names + - pokedexes + - version_groups + RegionName: + type: object + properties: + name: + type: string + maxLength: 100 + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - language + - name + RegionSummary: + type: object + properties: + name: + type: string + maxLength: 100 + url: + type: string + format: uri + readOnly: true + required: + - name + - url + StatDetail: + type: object + properties: + id: + type: integer + readOnly: true + name: + type: string + maxLength: 100 + game_index: + type: integer + maximum: 2147483647 + minimum: -2147483648 + is_battle_only: + type: boolean + affecting_moves: + type: string + readOnly: true + affecting_natures: + type: string + readOnly: true + characteristics: + type: array + items: + $ref: '#/components/schemas/CharacteristicSummary' + readOnly: true + move_damage_class: + $ref: '#/components/schemas/MoveDamageClassSummary' + names: + type: array + items: + $ref: '#/components/schemas/StatName' + readOnly: true + required: + - affecting_moves + - affecting_natures + - characteristics + - game_index + - id + - move_damage_class + - name + - names + StatName: + type: object + properties: + name: + type: string + maxLength: 100 + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - language + - name + StatSummary: + type: object + properties: + name: + type: string + maxLength: 100 + url: + type: string + format: uri + readOnly: true + required: + - name + - url + SuperContestEffectDetail: + type: object + properties: + id: + type: integer + readOnly: true + appeal: + type: integer + maximum: 2147483647 + minimum: -2147483648 + flavor_text_entries: + type: array + items: + $ref: '#/components/schemas/SuperContestEffectFlavorText' + readOnly: true + moves: + type: array + items: + $ref: '#/components/schemas/MoveSummary' + readOnly: true + required: + - appeal + - flavor_text_entries + - id + - moves + SuperContestEffectFlavorText: + type: object + properties: + flavor_text: + type: string + maxLength: 500 + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - flavor_text + - language + SuperContestEffectSummary: + type: object + properties: + url: + type: string + format: uri + readOnly: true + required: + - url + TypeDetail: + type: object + description: Serializer for the Type resource + properties: + id: + type: integer + readOnly: true + name: + type: string + maxLength: 100 + damage_relations: + type: string + readOnly: true + past_damage_relations: + type: string + readOnly: true + game_indices: + type: array + items: + $ref: '#/components/schemas/TypeGameIndex' + readOnly: true + generation: + $ref: '#/components/schemas/GenerationSummary' + move_damage_class: + $ref: '#/components/schemas/MoveDamageClassSummary' + names: + type: array + items: + $ref: '#/components/schemas/AbilityName' + readOnly: true + pokemon: + type: string + readOnly: true + moves: + type: array + items: + $ref: '#/components/schemas/MoveSummary' + readOnly: true + required: + - damage_relations + - game_indices + - generation + - id + - move_damage_class + - moves + - name + - names + - past_damage_relations + - pokemon + TypeGameIndex: + type: object + properties: + game_index: + type: integer + maximum: 2147483647 + minimum: -2147483648 + generation: + $ref: '#/components/schemas/GenerationSummary' + required: + - game_index + - generation + TypeSummary: + type: object + properties: + name: + type: string + maxLength: 100 + url: + type: string + format: uri + readOnly: true + required: + - name + - url + VersionDetail: + type: object + description: |- + Should have a link to Version Group info but the Circular + dependency and compilation order fight eachother and I'm + not sure how to add anything other than a hyperlink + properties: + id: + type: integer + readOnly: true + name: + type: string + maxLength: 100 + names: + type: array + items: + $ref: '#/components/schemas/VersionName' + readOnly: true + version_group: + $ref: '#/components/schemas/VersionGroupSummary' + required: + - id + - name + - names + - version_group + VersionGroupDetail: + type: object + properties: + id: + type: integer + readOnly: true + name: + type: string + maxLength: 100 + order: + type: + - integer + - 'null' + maximum: 2147483647 + minimum: -2147483648 + generation: + $ref: '#/components/schemas/GenerationSummary' + move_learn_methods: + type: string + readOnly: true + pokedexes: + type: string + readOnly: true + regions: + type: string + readOnly: true + versions: + type: array + items: + $ref: '#/components/schemas/VersionSummary' + readOnly: true + required: + - generation + - id + - move_learn_methods + - name + - pokedexes + - regions + - versions + VersionGroupSummary: + type: object + properties: + name: + type: string + maxLength: 100 + url: + type: string + format: uri + readOnly: true + required: + - name + - url + VersionName: + type: object + properties: + name: + type: string + maxLength: 100 + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - language + - name + VersionSummary: + type: object + properties: + name: + type: string + maxLength: 100 + url: + type: string + format: uri + readOnly: true + required: + - name + - url + securitySchemes: + basicAuth: + type: http + scheme: basic + cookieAuth: + type: apiKey + in: cookie + name: sessionid +servers: +- url: https://pokeapi.co +externalDocs: + url: https://pokeapi.co/docs/v2 From c2d34ea6376da914096e5000b6c28f75140fd248 Mon Sep 17 00:00:00 2001 From: indyandie <1058837+Indyandie@users.noreply.github.com> Date: Sat, 24 Feb 2024 02:12:51 -0600 Subject: [PATCH 12/76] ci: add `nix-shell` --- default.nix | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 default.nix diff --git a/default.nix b/default.nix new file mode 100644 index 00000000..1775fe38 --- /dev/null +++ b/default.nix @@ -0,0 +1,41 @@ +with import { }; + +let + pythonPackages = python3Packages; +in pkgs.mkShell rec { + name = "impurePythonEnv"; + venvDir = "./.venv"; + buildInputs = [ + python310Packages.python + python310Packages.venvShellHook + + # python310Packages.coverage + # python310Packages.python-mimeparse + # python310Packages.python-dateutil + # python310Packages.drf-spectacular + # python310Packages.djangorestframework + # python310Packages.django-redis + # python310Packages.django-cors-headers + + # Required dependancies + taglib + openssl + git + libxml2 + libxslt + libzip + zlib + ]; + + # Run this command, only after creating the virtual environment + postVenvCreation = '' + unset SOURCE_DATE_EPOCH + pip install -r requirements.txt + ''; + + postShellHook = '' + # allow pip to install wheels + unset SOURCE_DATE_EPOCH + ''; + +} From 0e51181c14dff155d8747b2d59feaf6b25f6b059 Mon Sep 17 00:00:00 2001 From: indyandie <1058837+Indyandie@users.noreply.github.com> Date: Sun, 25 Feb 2024 23:56:18 -0600 Subject: [PATCH 13/76] docs(openapi): add operation descriptions --- pokemon_v2/api.py | 53 ++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 50 insertions(+), 3 deletions(-) diff --git a/pokemon_v2/api.py b/pokemon_v2/api.py index 790f62b9..c2f44386 100644 --- a/pokemon_v2/api.py +++ b/pokemon_v2/api.py @@ -4,6 +4,7 @@ from rest_framework.response import Response from rest_framework.views import APIView from django.shortcuts import get_object_or_404 from django.http import Http404 +from drf_spectacular.utils import extend_schema from .models import * from .serializers import * @@ -70,298 +71,344 @@ class PokeapiCommonViewset( ########## +@extend_schema(description='Abilities provide passive effects for Pokémon in battle or in the overworld. Pokémon have multiple possible abilities but can have only one ability at a time. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Ability) for greater detail.') class AbilityResource(PokeapiCommonViewset): queryset = Ability.objects.all() serializer_class = AbilityDetailSerializer list_serializer_class = AbilitySummarySerializer +@extend_schema(description='Berries are small fruits that can provide HP and status condition restoration, stat enhancement, and even damage negation when eaten by Pokémon. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Berry) for greater detail.') class BerryResource(PokeapiCommonViewset): queryset = Berry.objects.all() serializer_class = BerryDetailSerializer list_serializer_class = BerrySummarySerializer +@extend_schema(description='Berries can be soft or hard. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Category:Berries_by_firmness) for greater detail.') class BerryFirmnessResource(PokeapiCommonViewset): queryset = BerryFirmness.objects.all() serializer_class = BerryFirmnessDetailSerializer list_serializer_class = BerryFirmnessSummarySerializer +@extend_schema(description='Flavors determine whether a Pokémon will benefit or suffer from eating a berry based on their **nature**. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Flavor) for greater detail.') class BerryFlavorResource(PokeapiCommonViewset): queryset = BerryFlavor.objects.all() serializer_class = BerryFlavorDetailSerializer list_serializer_class = BerryFlavorSummarySerializer +@extend_schema(description='Characteristics indicate which stat contains a Pokémon\'s highest IV. A Pokémon\'s Characteristic is determined by the remainder of its highest IV divided by 5 (gene_modulo). Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Characteristic) for greater detail.') class CharacteristicResource(PokeapiCommonViewset): queryset = Characteristic.objects.all() serializer_class = CharacteristicDetailSerializer list_serializer_class = CharacteristicSummarySerializer +@extend_schema(description='Contest effects refer to the effects of moves when used in contests.') class ContestEffectResource(PokeapiCommonViewset): queryset = ContestEffect.objects.all() serializer_class = ContestEffectDetailSerializer list_serializer_class = ContestEffectSummarySerializer +@extend_schema(description='Contest types are categories judges used to weigh a Pokémon\'s condition in Pokémon contests. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Contest_condition) for greater detail.') class ContestTypeResource(PokeapiCommonViewset): queryset = ContestType.objects.all() serializer_class = ContestTypeDetailSerializer list_serializer_class = ContestTypeSummarySerializer +@extend_schema(description='Egg Groups are categories which determine which Pokémon are able to interbreed. Pokémon may belong to either one or two Egg Groups. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Egg_Group) for greater detail.') class EggGroupResource(PokeapiCommonViewset): queryset = EggGroup.objects.all() serializer_class = EggGroupDetailSerializer list_serializer_class = EggGroupSummarySerializer +@extend_schema(description='Conditions which affect what pokemon might appear in the wild, e.g., day or night.') class EncounterConditionResource(PokeapiCommonViewset): queryset = EncounterCondition.objects.all() serializer_class = EncounterConditionDetailSerializer list_serializer_class = EncounterConditionSummarySerializer +@extend_schema(description='Encounter condition values are the various states that an encounter condition can have, i.e., time of day can be either day or night.') class EncounterConditionValueResource(PokeapiCommonViewset): queryset = EncounterConditionValue.objects.all() serializer_class = EncounterConditionValueDetailSerializer list_serializer_class = EncounterConditionValueSummarySerializer +@extend_schema(description='Methods by which the player might can encounter Pokémon in the wild, e.g., walking in tall grass. Check out Bulbapedia for greater detail.') class EncounterMethodResource(PokeapiCommonViewset): queryset = EncounterMethod.objects.all() serializer_class = EncounterMethodDetailSerializer list_serializer_class = EncounterMethodSummarySerializer +@extend_schema(description='Evolution chains are essentially family trees. They start with the lowest stage within a family and detail evolution conditions for each as well as Pokémon they can evolve into up through the hierarchy.') class EvolutionChainResource(PokeapiCommonViewset): queryset = EvolutionChain.objects.all() serializer_class = EvolutionChainDetailSerializer list_serializer_class = EvolutionChainSummarySerializer +@extend_schema(description='Evolution triggers are the events and conditions that cause a Pokémon to evolve. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Methods_of_evolution) for greater detail.') class EvolutionTriggerResource(PokeapiCommonViewset): queryset = EvolutionTrigger.objects.all() serializer_class = EvolutionTriggerDetailSerializer list_serializer_class = EvolutionTriggerSummarySerializer +@extend_schema(description='A generation is a grouping of the Pokémon games that separates them based on the Pokémon they include. In each generation, a new set of Pokémon, Moves, Abilities and Types that did not exist in the previous generation are released.') class GenerationResource(PokeapiCommonViewset): queryset = Generation.objects.all() serializer_class = GenerationDetailSerializer list_serializer_class = GenerationSummarySerializer +@extend_schema(description='Genders were introduced in Generation II for the purposes of breeding Pokémon but can also result in visual differences or even different evolutionary lines. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Gender) for greater detail.') class GenderResource(PokeapiCommonViewset): queryset = Gender.objects.all() serializer_class = GenderDetailSerializer list_serializer_class = GenderSummarySerializer +@extend_schema(description='Growth rates are the speed with which Pokémon gain levels through experience. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Experience) for greater detail.') class GrowthRateResource(PokeapiCommonViewset): queryset = GrowthRate.objects.all() serializer_class = GrowthRateDetailSerializer list_serializer_class = GrowthRateSummarySerializer +@extend_schema(description='An item is an object in the games which the player can pick up, keep in their bag, and use in some manner. They have various uses, including healing, powering up, helping catch Pokémon, or to access a new area.') class ItemResource(PokeapiCommonViewset): queryset = Item.objects.all() serializer_class = ItemDetailSerializer list_serializer_class = ItemSummarySerializer +@extend_schema(description='Item categories determine where items will be placed in the players bag.') class ItemCategoryResource(PokeapiCommonViewset): queryset = ItemCategory.objects.all() serializer_class = ItemCategoryDetailSerializer list_serializer_class = ItemCategorySummarySerializer +@extend_schema(description='Item attributes define particular aspects of items, e.g."usable in battle" or "consumable".') class ItemAttributeResource(PokeapiCommonViewset): queryset = ItemAttribute.objects.all() serializer_class = ItemAttributeDetailSerializer list_serializer_class = ItemAttributeSummarySerializer +@extend_schema(description='The various effects of the move"Fling" when used with different items.') class ItemFlingEffectResource(PokeapiCommonViewset): queryset = ItemFlingEffect.objects.all() serializer_class = ItemFlingEffectDetailSerializer list_serializer_class = ItemFlingEffectSummarySerializer +@extend_schema(description='Pockets within the players bag used for storing items by category.') class ItemPocketResource(PokeapiCommonViewset): queryset = ItemPocket.objects.all() serializer_class = ItemPocketDetailSerializer list_serializer_class = ItemPocketSummarySerializer +@extend_schema(description='Languages for translations of API resource information.') class LanguageResource(PokeapiCommonViewset): queryset = Language.objects.all() serializer_class = LanguageDetailSerializer list_serializer_class = LanguageSummarySerializer +@extend_schema(description='Locations that can be visited within the games. Locations make up sizable portions of regions, like cities or routes.') class LocationResource(PokeapiCommonViewset): queryset = Location.objects.all() serializer_class = LocationDetailSerializer list_serializer_class = LocationSummarySerializer +@extend_schema(description='Location areas are sections of areas, such as floors in a building or cave. Each area has its own set of possible Pokémon encounters.') class LocationAreaResource(ListOrDetailSerialRelation, viewsets.ReadOnlyModelViewSet): queryset = LocationArea.objects.all() serializer_class = LocationAreaDetailSerializer list_serializer_class = LocationAreaSummarySerializer +@extend_schema(description='Machines are the representation of items that teach moves to Pokémon. They vary from version to version, so it is not certain that one specific TM or HM corresponds to a single Machine.') class MachineResource(PokeapiCommonViewset): queryset = Machine.objects.all() serializer_class = MachineDetailSerializer list_serializer_class = MachineSummarySerializer +@extend_schema(description='Moves are the skills of Pokémon in battle. In battle, a Pokémon uses one move each turn. Some moves (including those learned by Hidden Machine) can be used outside of battle as well, usually for the purpose of removing obstacles or exploring new areas.') class MoveResource(PokeapiCommonViewset): queryset = Move.objects.all() serializer_class = MoveDetailSerializer list_serializer_class = MoveSummarySerializer +@extend_schema(description='Damage classes moves can have, e.g. physical, special, or non-damaging.') class MoveDamageClassResource(PokeapiCommonViewset): queryset = MoveDamageClass.objects.all() serializer_class = MoveDamageClassDetailSerializer list_serializer_class = MoveDamageClassSummarySerializer +@extend_schema(description='Move Ailments are status conditions caused by moves used during battle. See [Bulbapedia](https://bulbapedia.bulbagarden.net/wiki/Status_condition) for greater detail.') class MoveMetaAilmentResource(PokeapiCommonViewset): queryset = MoveMetaAilment.objects.all() serializer_class = MoveMetaAilmentDetailSerializer list_serializer_class = MoveMetaAilmentSummarySerializer +@extend_schema(description='Styles of moves when used in the Battle Palace. See [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Battle_Frontier_(Generation_III)) for greater detail.') class MoveBattleStyleResource(PokeapiCommonViewset): queryset = MoveBattleStyle.objects.all() serializer_class = MoveBattleStyleDetailSerializer list_serializer_class = MoveBattleStyleSummarySerializer +@extend_schema(description='Very general categories that loosely group move effects.') class MoveMetaCategoryResource(PokeapiCommonViewset): queryset = MoveMetaCategory.objects.all() serializer_class = MoveMetaCategoryDetailSerializer list_serializer_class = MoveMetaCategorySummarySerializer +@extend_schema(description='Methods by which Pokémon can learn moves.') class MoveLearnMethodResource(PokeapiCommonViewset): queryset = MoveLearnMethod.objects.all() serializer_class = MoveLearnMethodDetailSerializer list_serializer_class = MoveLearnMethodSummarySerializer +@extend_schema(description='Targets moves can be directed at during battle. Targets can be Pokémon, environments or even other moves.') class MoveTargetResource(PokeapiCommonViewset): queryset = MoveTarget.objects.all() serializer_class = MoveTargetDetailSerializer list_serializer_class = MoveTargetSummarySerializer +@extend_schema(description='Natures influence how a Pokémon\'s stats grow. See [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Nature) for greater detail.') class NatureResource(PokeapiCommonViewset): queryset = Nature.objects.all() serializer_class = NatureDetailSerializer list_serializer_class = NatureSummarySerializer +@extend_schema(description='Areas used for grouping Pokémon encounters in Pal Park. They\'re like habitats that are specific to Pal Park.') class PalParkAreaResource(PokeapiCommonViewset): queryset = PalParkArea.objects.all() serializer_class = PalParkAreaDetailSerializer list_serializer_class = PalParkAreaSummarySerializer +@extend_schema(description='Pokeathlon Stats are different attributes of a Pokémon\'s performance in Pokéathlons. In Pokéathlons, competitions happen on different courses; one for each of the different Pokéathlon stats. See [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Pok%C3%A9athlon) for greater detail.') class PokeathlonStatResource(PokeapiCommonViewset): queryset = PokeathlonStat.objects.all() serializer_class = PokeathlonStatDetailSerializer list_serializer_class = PokeathlonStatSummarySerializer +@extend_schema(description='A Pokédex is a handheld electronic encyclopedia device; one which is capable of recording and retaining information of the various Pokémon in a given region with the exception of the national dex and some smaller dexes related to portions of a region. See [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Pokedex) for greater detail.') class PokedexResource(PokeapiCommonViewset): queryset = Pokedex.objects.all() serializer_class = PokedexDetailSerializer list_serializer_class = PokedexSummarySerializer +@extend_schema(description='Colors used for sorting Pokémon in a Pokédex. The color listed in the Pokédex is usually the color most apparent or covering each Pokémon\'s body. No orange category exists; Pokémon that are primarily orange are listed as red or brown.') class PokemonColorResource(PokeapiCommonViewset): queryset = PokemonColor.objects.all() serializer_class = PokemonColorDetailSerializer list_serializer_class = PokemonColorSummarySerializer +@extend_schema(description='Some Pokémon may appear in one of multiple, visually different forms. These differences are purely cosmetic. For variations within a Pokémon species, which do differ in more than just visuals, the \'Pokémon\' entity is used to represent such a variety.') class PokemonFormResource(PokeapiCommonViewset): queryset = PokemonForm.objects.all() serializer_class = PokemonFormDetailSerializer list_serializer_class = PokemonFormSummarySerializer +@extend_schema(description='Habitats are generally different terrain Pokémon can be found in but can also be areas designated for rare or legendary Pokémon.') class PokemonHabitatResource(PokeapiCommonViewset): queryset = PokemonHabitat.objects.all() serializer_class = PokemonHabitatDetailSerializer list_serializer_class = PokemonHabitatSummarySerializer +@extend_schema(description='Shapes used for sorting Pokémon in a Pokédex.') class PokemonShapeResource(PokeapiCommonViewset): queryset = PokemonShape.objects.all() serializer_class = PokemonShapeDetailSerializer list_serializer_class = PokemonShapeSummarySerializer +@extend_schema(description='Pokémon are the creatures that inhabit the world of the Pokémon games. They can be caught using Pokéballs and trained by battling with other Pokémon. Each Pokémon belongs to a specific species but may take on a variant which makes it differ from other Pokémon of the same species, such as base stats, available abilities and typings. See [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Pok%C3%A9mon_(species)) for greater detail.') class PokemonResource(PokeapiCommonViewset): queryset = Pokemon.objects.all() serializer_class = PokemonDetailSerializer list_serializer_class = PokemonSummarySerializer +@extend_schema(description='A Pokémon Species forms the basis for at least one Pokémon. Attributes of a Pokémon species are shared across all varieties of Pokémon within the species. A good example is Wormadam; Wormadam is the species which can be found in three different varieties, Wormadam-Trash, Wormadam-Sandy and Wormadam-Plant.') class PokemonSpeciesResource(PokeapiCommonViewset): queryset = PokemonSpecies.objects.all().order_by("id") serializer_class = PokemonSpeciesDetailSerializer list_serializer_class = PokemonSpeciesSummarySerializer +@extend_schema(description='A region is an organized area of the Pokémon world. Most often, the main difference between regions is the species of Pokémon that can be encountered within them.') class RegionResource(PokeapiCommonViewset): queryset = Region.objects.all() serializer_class = RegionDetailSerializer list_serializer_class = RegionSummarySerializer +@extend_schema(description='Stats determine certain aspects of battles. Each Pokémon has a value for each stat which grows as they gain levels and can be altered momentarily by effects in battles.') class StatResource(PokeapiCommonViewset): queryset = Stat.objects.all() serializer_class = StatDetailSerializer list_serializer_class = StatSummarySerializer +@extend_schema(description='Super contest effects refer to the effects of moves when used in super contests.') class SuperContestEffectResource(PokeapiCommonViewset): queryset = SuperContestEffect.objects.all() serializer_class = SuperContestEffectDetailSerializer list_serializer_class = SuperContestEffectSummarySerializer +@extend_schema(description='Types are properties for Pokémon and their moves. Each type has three properties: which types of Pokémon it is super effective against, which types of Pokémon it is not very effective against, and which types of Pokémon it is completely ineffective against.') class TypeResource(PokeapiCommonViewset): queryset = Type.objects.all() serializer_class = TypeDetailSerializer list_serializer_class = TypeSummarySerializer +@extend_schema(description='Versions of the games, e.g., Red, Blue or Yellow.') class VersionResource(PokeapiCommonViewset): queryset = Version.objects.all() serializer_class = VersionDetailSerializer list_serializer_class = VersionSummarySerializer +@extend_schema(description='Version groups categorize highly similar versions of the games.') class VersionGroupResource(PokeapiCommonViewset): queryset = VersionGroup.objects.all() serializer_class = VersionGroupDetailSerializer list_serializer_class = VersionGroupSummarySerializer +@extend_schema(description='Handles Pokemon Encounters as a sub-resource.') class PokemonEncounterView(APIView): - """ - Handles Pokemon Encounters as a sub-resource. - """ def get(self, request, pokemon_id): self.context = dict(request=request) From 9085223ae41d3646d681d541f7f78211528237a1 Mon Sep 17 00:00:00 2001 From: indyandie <1058837+Indyandie@users.noreply.github.com> Date: Mon, 26 Feb 2024 00:11:49 -0600 Subject: [PATCH 14/76] docs(openapi): update `openapi.yml` --- openapi.yml | 544 +++++++++++++++++++++++++--------------------------- 1 file changed, 256 insertions(+), 288 deletions(-) diff --git a/openapi.yml b/openapi.yml index d09e5a43..69910fda 100644 --- a/openapi.yml +++ b/openapi.yml @@ -7,9 +7,10 @@ paths: /api/v2/ability/: get: operationId: ability_list - description: |- - Mixin to allow association with separate serializers - for list or detail view. + description: Abilities provide passive effects for Pokémon in battle or in the + overworld. Pokémon have multiple possible abilities but can have only one + ability at a time. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Ability) + for greater detail. parameters: - name: limit required: false @@ -39,9 +40,10 @@ paths: /api/v2/ability/{id}/: get: operationId: ability_retrieve - description: |- - Mixin to allow association with separate serializers - for list or detail view. + description: Abilities provide passive effects for Pokémon in battle or in the + overworld. Pokémon have multiple possible abilities but can have only one + ability at a time. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Ability) + for greater detail. parameters: - in: path name: id @@ -65,9 +67,10 @@ paths: /api/v2/berry/: get: operationId: berry_list - description: |- - Mixin to allow association with separate serializers - for list or detail view. + description: Berries are small fruits that can provide HP and status condition + restoration, stat enhancement, and even damage negation when eaten by Pokémon. + Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Berry) for greater + detail. parameters: - name: limit required: false @@ -97,9 +100,8 @@ paths: /api/v2/berry-firmness/: get: operationId: berry_firmness_list - description: |- - Mixin to allow association with separate serializers - for list or detail view. + description: Berries can be soft or hard. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Category:Berries_by_firmness) + for greater detail. parameters: - name: limit required: false @@ -129,9 +131,8 @@ paths: /api/v2/berry-firmness/{id}/: get: operationId: berry_firmness_retrieve - description: |- - Mixin to allow association with separate serializers - for list or detail view. + description: Berries can be soft or hard. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Category:Berries_by_firmness) + for greater detail. parameters: - in: path name: id @@ -155,9 +156,9 @@ paths: /api/v2/berry-flavor/: get: operationId: berry_flavor_list - description: |- - Mixin to allow association with separate serializers - for list or detail view. + description: Flavors determine whether a Pokémon will benefit or suffer from + eating a berry based on their **nature**. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Flavor) + for greater detail. parameters: - name: limit required: false @@ -187,9 +188,9 @@ paths: /api/v2/berry-flavor/{id}/: get: operationId: berry_flavor_retrieve - description: |- - Mixin to allow association with separate serializers - for list or detail view. + description: Flavors determine whether a Pokémon will benefit or suffer from + eating a berry based on their **nature**. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Flavor) + for greater detail. parameters: - in: path name: id @@ -213,9 +214,10 @@ paths: /api/v2/berry/{id}/: get: operationId: berry_retrieve - description: |- - Mixin to allow association with separate serializers - for list or detail view. + description: Berries are small fruits that can provide HP and status condition + restoration, stat enhancement, and even damage negation when eaten by Pokémon. + Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Berry) for greater + detail. parameters: - in: path name: id @@ -239,9 +241,10 @@ paths: /api/v2/characteristic/: get: operationId: characteristic_list - description: |- - Mixin to allow association with separate serializers - for list or detail view. + description: Characteristics indicate which stat contains a Pokémon's highest + IV. A Pokémon's Characteristic is determined by the remainder of its highest + IV divided by 5 (gene_modulo). Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Characteristic) + for greater detail. parameters: - name: limit required: false @@ -271,9 +274,10 @@ paths: /api/v2/characteristic/{id}/: get: operationId: characteristic_retrieve - description: |- - Mixin to allow association with separate serializers - for list or detail view. + description: Characteristics indicate which stat contains a Pokémon's highest + IV. A Pokémon's Characteristic is determined by the remainder of its highest + IV divided by 5 (gene_modulo). Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Characteristic) + for greater detail. parameters: - in: path name: id @@ -297,9 +301,7 @@ paths: /api/v2/contest-effect/: get: operationId: contest_effect_list - description: |- - Mixin to allow association with separate serializers - for list or detail view. + description: Contest effects refer to the effects of moves when used in contests. parameters: - name: limit required: false @@ -329,9 +331,7 @@ paths: /api/v2/contest-effect/{id}/: get: operationId: contest_effect_retrieve - description: |- - Mixin to allow association with separate serializers - for list or detail view. + description: Contest effects refer to the effects of moves when used in contests. parameters: - in: path name: id @@ -355,9 +355,9 @@ paths: /api/v2/contest-type/: get: operationId: contest_type_list - description: |- - Mixin to allow association with separate serializers - for list or detail view. + description: Contest types are categories judges used to weigh a Pokémon's condition + in Pokémon contests. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Contest_condition) + for greater detail. parameters: - name: limit required: false @@ -387,9 +387,9 @@ paths: /api/v2/contest-type/{id}/: get: operationId: contest_type_retrieve - description: |- - Mixin to allow association with separate serializers - for list or detail view. + description: Contest types are categories judges used to weigh a Pokémon's condition + in Pokémon contests. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Contest_condition) + for greater detail. parameters: - in: path name: id @@ -413,9 +413,10 @@ paths: /api/v2/egg-group/: get: operationId: egg_group_list - description: |- - Mixin to allow association with separate serializers - for list or detail view. + description: Egg Groups are categories which determine which Pokémon are able + to interbreed. Pokémon may belong to either one or two Egg Groups. Check out + [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Egg_Group) for greater + detail. parameters: - name: limit required: false @@ -445,9 +446,10 @@ paths: /api/v2/egg-group/{id}/: get: operationId: egg_group_retrieve - description: |- - Mixin to allow association with separate serializers - for list or detail view. + description: Egg Groups are categories which determine which Pokémon are able + to interbreed. Pokémon may belong to either one or two Egg Groups. Check out + [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Egg_Group) for greater + detail. parameters: - in: path name: id @@ -471,9 +473,8 @@ paths: /api/v2/encounter-condition/: get: operationId: encounter_condition_list - description: |- - Mixin to allow association with separate serializers - for list or detail view. + description: Conditions which affect what pokemon might appear in the wild, + e.g., day or night. parameters: - name: limit required: false @@ -503,9 +504,8 @@ paths: /api/v2/encounter-condition-value/: get: operationId: encounter_condition_value_list - description: |- - Mixin to allow association with separate serializers - for list or detail view. + description: Encounter condition values are the various states that an encounter + condition can have, i.e., time of day can be either day or night. parameters: - name: limit required: false @@ -535,9 +535,8 @@ paths: /api/v2/encounter-condition-value/{id}/: get: operationId: encounter_condition_value_retrieve - description: |- - Mixin to allow association with separate serializers - for list or detail view. + description: Encounter condition values are the various states that an encounter + condition can have, i.e., time of day can be either day or night. parameters: - in: path name: id @@ -561,9 +560,8 @@ paths: /api/v2/encounter-condition/{id}/: get: operationId: encounter_condition_retrieve - description: |- - Mixin to allow association with separate serializers - for list or detail view. + description: Conditions which affect what pokemon might appear in the wild, + e.g., day or night. parameters: - in: path name: id @@ -587,9 +585,8 @@ paths: /api/v2/encounter-method/: get: operationId: encounter_method_list - description: |- - Mixin to allow association with separate serializers - for list or detail view. + description: Methods by which the player might can encounter Pokémon in the + wild, e.g., walking in tall grass. Check out Bulbapedia for greater detail. parameters: - name: limit required: false @@ -619,9 +616,8 @@ paths: /api/v2/encounter-method/{id}/: get: operationId: encounter_method_retrieve - description: |- - Mixin to allow association with separate serializers - for list or detail view. + description: Methods by which the player might can encounter Pokémon in the + wild, e.g., walking in tall grass. Check out Bulbapedia for greater detail. parameters: - in: path name: id @@ -645,9 +641,9 @@ paths: /api/v2/evolution-chain/: get: operationId: evolution_chain_list - description: |- - Mixin to allow association with separate serializers - for list or detail view. + description: Evolution chains are essentially family trees. They start with + the lowest stage within a family and detail evolution conditions for each + as well as Pokémon they can evolve into up through the hierarchy. parameters: - name: limit required: false @@ -677,9 +673,9 @@ paths: /api/v2/evolution-chain/{id}/: get: operationId: evolution_chain_retrieve - description: |- - Mixin to allow association with separate serializers - for list or detail view. + description: Evolution chains are essentially family trees. They start with + the lowest stage within a family and detail evolution conditions for each + as well as Pokémon they can evolve into up through the hierarchy. parameters: - in: path name: id @@ -703,9 +699,9 @@ paths: /api/v2/evolution-trigger/: get: operationId: evolution_trigger_list - description: |- - Mixin to allow association with separate serializers - for list or detail view. + description: Evolution triggers are the events and conditions that cause a Pokémon + to evolve. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Methods_of_evolution) + for greater detail. parameters: - name: limit required: false @@ -735,9 +731,9 @@ paths: /api/v2/evolution-trigger/{id}/: get: operationId: evolution_trigger_retrieve - description: |- - Mixin to allow association with separate serializers - for list or detail view. + description: Evolution triggers are the events and conditions that cause a Pokémon + to evolve. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Methods_of_evolution) + for greater detail. parameters: - in: path name: id @@ -761,9 +757,10 @@ paths: /api/v2/gender/: get: operationId: gender_list - description: |- - Mixin to allow association with separate serializers - for list or detail view. + description: Genders were introduced in Generation II for the purposes of breeding + Pokémon but can also result in visual differences or even different evolutionary + lines. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Gender) + for greater detail. parameters: - name: limit required: false @@ -793,9 +790,10 @@ paths: /api/v2/gender/{id}/: get: operationId: gender_retrieve - description: |- - Mixin to allow association with separate serializers - for list or detail view. + description: Genders were introduced in Generation II for the purposes of breeding + Pokémon but can also result in visual differences or even different evolutionary + lines. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Gender) + for greater detail. parameters: - in: path name: id @@ -819,9 +817,10 @@ paths: /api/v2/generation/: get: operationId: generation_list - description: |- - Mixin to allow association with separate serializers - for list or detail view. + description: A generation is a grouping of the Pokémon games that separates + them based on the Pokémon they include. In each generation, a new set of Pokémon, + Moves, Abilities and Types that did not exist in the previous generation are + released. parameters: - name: limit required: false @@ -851,9 +850,10 @@ paths: /api/v2/generation/{id}/: get: operationId: generation_retrieve - description: |- - Mixin to allow association with separate serializers - for list or detail view. + description: A generation is a grouping of the Pokémon games that separates + them based on the Pokémon they include. In each generation, a new set of Pokémon, + Moves, Abilities and Types that did not exist in the previous generation are + released. parameters: - in: path name: id @@ -877,9 +877,9 @@ paths: /api/v2/growth-rate/: get: operationId: growth_rate_list - description: |- - Mixin to allow association with separate serializers - for list or detail view. + description: Growth rates are the speed with which Pokémon gain levels through + experience. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Experience) + for greater detail. parameters: - name: limit required: false @@ -909,9 +909,9 @@ paths: /api/v2/growth-rate/{id}/: get: operationId: growth_rate_retrieve - description: |- - Mixin to allow association with separate serializers - for list or detail view. + description: Growth rates are the speed with which Pokémon gain levels through + experience. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Experience) + for greater detail. parameters: - in: path name: id @@ -935,9 +935,9 @@ paths: /api/v2/item/: get: operationId: item_list - description: |- - Mixin to allow association with separate serializers - for list or detail view. + description: An item is an object in the games which the player can pick up, + keep in their bag, and use in some manner. They have various uses, including + healing, powering up, helping catch Pokémon, or to access a new area. parameters: - name: limit required: false @@ -967,9 +967,8 @@ paths: /api/v2/item-attribute/: get: operationId: item_attribute_list - description: |- - Mixin to allow association with separate serializers - for list or detail view. + description: Item attributes define particular aspects of items, e.g."usable + in battle" or "consumable". parameters: - name: limit required: false @@ -999,9 +998,8 @@ paths: /api/v2/item-attribute/{id}/: get: operationId: item_attribute_retrieve - description: |- - Mixin to allow association with separate serializers - for list or detail view. + description: Item attributes define particular aspects of items, e.g."usable + in battle" or "consumable". parameters: - in: path name: id @@ -1025,9 +1023,8 @@ paths: /api/v2/item-category/: get: operationId: item_category_list - description: |- - Mixin to allow association with separate serializers - for list or detail view. + description: Item categories determine where items will be placed in the players + bag. parameters: - name: limit required: false @@ -1057,9 +1054,8 @@ paths: /api/v2/item-category/{id}/: get: operationId: item_category_retrieve - description: |- - Mixin to allow association with separate serializers - for list or detail view. + description: Item categories determine where items will be placed in the players + bag. parameters: - in: path name: id @@ -1083,9 +1079,8 @@ paths: /api/v2/item-fling-effect/: get: operationId: item_fling_effect_list - description: |- - Mixin to allow association with separate serializers - for list or detail view. + description: The various effects of the move"Fling" when used with different + items. parameters: - name: limit required: false @@ -1115,9 +1110,8 @@ paths: /api/v2/item-fling-effect/{id}/: get: operationId: item_fling_effect_retrieve - description: |- - Mixin to allow association with separate serializers - for list or detail view. + description: The various effects of the move"Fling" when used with different + items. parameters: - in: path name: id @@ -1141,9 +1135,7 @@ paths: /api/v2/item-pocket/: get: operationId: item_pocket_list - description: |- - Mixin to allow association with separate serializers - for list or detail view. + description: Pockets within the players bag used for storing items by category. parameters: - name: limit required: false @@ -1173,9 +1165,7 @@ paths: /api/v2/item-pocket/{id}/: get: operationId: item_pocket_retrieve - description: |- - Mixin to allow association with separate serializers - for list or detail view. + description: Pockets within the players bag used for storing items by category. parameters: - in: path name: id @@ -1199,9 +1189,9 @@ paths: /api/v2/item/{id}/: get: operationId: item_retrieve - description: |- - Mixin to allow association with separate serializers - for list or detail view. + description: An item is an object in the games which the player can pick up, + keep in their bag, and use in some manner. They have various uses, including + healing, powering up, helping catch Pokémon, or to access a new area. parameters: - in: path name: id @@ -1225,9 +1215,7 @@ paths: /api/v2/language/: get: operationId: language_list - description: |- - Mixin to allow association with separate serializers - for list or detail view. + description: Languages for translations of API resource information. parameters: - name: limit required: false @@ -1257,9 +1245,7 @@ paths: /api/v2/language/{id}/: get: operationId: language_retrieve - description: |- - Mixin to allow association with separate serializers - for list or detail view. + description: Languages for translations of API resource information. parameters: - in: path name: id @@ -1283,9 +1269,8 @@ paths: /api/v2/location/: get: operationId: location_list - description: |- - Mixin to allow association with separate serializers - for list or detail view. + description: Locations that can be visited within the games. Locations make + up sizable portions of regions, like cities or routes. parameters: - name: limit required: false @@ -1315,9 +1300,8 @@ paths: /api/v2/location-area/: get: operationId: location_area_list - description: |- - Mixin to allow association with separate serializers - for list or detail view. + description: Location areas are sections of areas, such as floors in a building + or cave. Each area has its own set of possible Pokémon encounters. parameters: - name: limit required: false @@ -1347,9 +1331,8 @@ paths: /api/v2/location-area/{id}/: get: operationId: location_area_retrieve - description: |- - Mixin to allow association with separate serializers - for list or detail view. + description: Location areas are sections of areas, such as floors in a building + or cave. Each area has its own set of possible Pokémon encounters. parameters: - in: path name: id @@ -1373,9 +1356,8 @@ paths: /api/v2/location/{id}/: get: operationId: location_retrieve - description: |- - Mixin to allow association with separate serializers - for list or detail view. + description: Locations that can be visited within the games. Locations make + up sizable portions of regions, like cities or routes. parameters: - in: path name: id @@ -1399,9 +1381,9 @@ paths: /api/v2/machine/: get: operationId: machine_list - description: |- - Mixin to allow association with separate serializers - for list or detail view. + description: Machines are the representation of items that teach moves to Pokémon. + They vary from version to version, so it is not certain that one specific + TM or HM corresponds to a single Machine. parameters: - name: limit required: false @@ -1431,9 +1413,9 @@ paths: /api/v2/machine/{id}/: get: operationId: machine_retrieve - description: |- - Mixin to allow association with separate serializers - for list or detail view. + description: Machines are the representation of items that teach moves to Pokémon. + They vary from version to version, so it is not certain that one specific + TM or HM corresponds to a single Machine. parameters: - in: path name: id @@ -1457,9 +1439,10 @@ paths: /api/v2/move/: get: operationId: move_list - description: |- - Mixin to allow association with separate serializers - for list or detail view. + description: Moves are the skills of Pokémon in battle. In battle, a Pokémon + uses one move each turn. Some moves (including those learned by Hidden Machine) + can be used outside of battle as well, usually for the purpose of removing + obstacles or exploring new areas. parameters: - name: limit required: false @@ -1489,9 +1472,9 @@ paths: /api/v2/move-ailment/: get: operationId: move_ailment_list - description: |- - Mixin to allow association with separate serializers - for list or detail view. + description: Move Ailments are status conditions caused by moves used during + battle. See [Bulbapedia](https://bulbapedia.bulbagarden.net/wiki/Status_condition) + for greater detail. parameters: - name: limit required: false @@ -1521,9 +1504,9 @@ paths: /api/v2/move-ailment/{id}/: get: operationId: move_ailment_retrieve - description: |- - Mixin to allow association with separate serializers - for list or detail view. + description: Move Ailments are status conditions caused by moves used during + battle. See [Bulbapedia](https://bulbapedia.bulbagarden.net/wiki/Status_condition) + for greater detail. parameters: - in: path name: id @@ -1547,9 +1530,8 @@ paths: /api/v2/move-battle-style/: get: operationId: move_battle_style_list - description: |- - Mixin to allow association with separate serializers - for list or detail view. + description: Styles of moves when used in the Battle Palace. See [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Battle_Frontier_(Generation_III)) + for greater detail. parameters: - name: limit required: false @@ -1579,9 +1561,8 @@ paths: /api/v2/move-battle-style/{id}/: get: operationId: move_battle_style_retrieve - description: |- - Mixin to allow association with separate serializers - for list or detail view. + description: Styles of moves when used in the Battle Palace. See [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Battle_Frontier_(Generation_III)) + for greater detail. parameters: - in: path name: id @@ -1605,9 +1586,7 @@ paths: /api/v2/move-category/: get: operationId: move_category_list - description: |- - Mixin to allow association with separate serializers - for list or detail view. + description: Very general categories that loosely group move effects. parameters: - name: limit required: false @@ -1637,9 +1616,7 @@ paths: /api/v2/move-category/{id}/: get: operationId: move_category_retrieve - description: |- - Mixin to allow association with separate serializers - for list or detail view. + description: Very general categories that loosely group move effects. parameters: - in: path name: id @@ -1663,9 +1640,7 @@ paths: /api/v2/move-damage-class/: get: operationId: move_damage_class_list - description: |- - Mixin to allow association with separate serializers - for list or detail view. + description: Damage classes moves can have, e.g. physical, special, or non-damaging. parameters: - name: limit required: false @@ -1695,9 +1670,7 @@ paths: /api/v2/move-damage-class/{id}/: get: operationId: move_damage_class_retrieve - description: |- - Mixin to allow association with separate serializers - for list or detail view. + description: Damage classes moves can have, e.g. physical, special, or non-damaging. parameters: - in: path name: id @@ -1721,9 +1694,7 @@ paths: /api/v2/move-learn-method/: get: operationId: move_learn_method_list - description: |- - Mixin to allow association with separate serializers - for list or detail view. + description: Methods by which Pokémon can learn moves. parameters: - name: limit required: false @@ -1753,9 +1724,7 @@ paths: /api/v2/move-learn-method/{id}/: get: operationId: move_learn_method_retrieve - description: |- - Mixin to allow association with separate serializers - for list or detail view. + description: Methods by which Pokémon can learn moves. parameters: - in: path name: id @@ -1779,9 +1748,8 @@ paths: /api/v2/move-target/: get: operationId: move_target_list - description: |- - Mixin to allow association with separate serializers - for list or detail view. + description: Targets moves can be directed at during battle. Targets can be + Pokémon, environments or even other moves. parameters: - name: limit required: false @@ -1811,9 +1779,8 @@ paths: /api/v2/move-target/{id}/: get: operationId: move_target_retrieve - description: |- - Mixin to allow association with separate serializers - for list or detail view. + description: Targets moves can be directed at during battle. Targets can be + Pokémon, environments or even other moves. parameters: - in: path name: id @@ -1837,9 +1804,10 @@ paths: /api/v2/move/{id}/: get: operationId: move_retrieve - description: |- - Mixin to allow association with separate serializers - for list or detail view. + description: Moves are the skills of Pokémon in battle. In battle, a Pokémon + uses one move each turn. Some moves (including those learned by Hidden Machine) + can be used outside of battle as well, usually for the purpose of removing + obstacles or exploring new areas. parameters: - in: path name: id @@ -1863,9 +1831,8 @@ paths: /api/v2/nature/: get: operationId: nature_list - description: |- - Mixin to allow association with separate serializers - for list or detail view. + description: Natures influence how a Pokémon's stats grow. See [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Nature) + for greater detail. parameters: - name: limit required: false @@ -1895,9 +1862,8 @@ paths: /api/v2/nature/{id}/: get: operationId: nature_retrieve - description: |- - Mixin to allow association with separate serializers - for list or detail view. + description: Natures influence how a Pokémon's stats grow. See [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Nature) + for greater detail. parameters: - in: path name: id @@ -1921,9 +1887,8 @@ paths: /api/v2/pal-park-area/: get: operationId: pal_park_area_list - description: |- - Mixin to allow association with separate serializers - for list or detail view. + description: Areas used for grouping Pokémon encounters in Pal Park. They're + like habitats that are specific to Pal Park. parameters: - name: limit required: false @@ -1953,9 +1918,8 @@ paths: /api/v2/pal-park-area/{id}/: get: operationId: pal_park_area_retrieve - description: |- - Mixin to allow association with separate serializers - for list or detail view. + description: Areas used for grouping Pokémon encounters in Pal Park. They're + like habitats that are specific to Pal Park. parameters: - in: path name: id @@ -1979,9 +1943,10 @@ paths: /api/v2/pokeathlon-stat/: get: operationId: pokeathlon_stat_list - description: |- - Mixin to allow association with separate serializers - for list or detail view. + description: Pokeathlon Stats are different attributes of a Pokémon's performance + in Pokéathlons. In Pokéathlons, competitions happen on different courses; + one for each of the different Pokéathlon stats. See [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Pok%C3%A9athlon) + for greater detail. parameters: - name: limit required: false @@ -2011,9 +1976,10 @@ paths: /api/v2/pokeathlon-stat/{id}/: get: operationId: pokeathlon_stat_retrieve - description: |- - Mixin to allow association with separate serializers - for list or detail view. + description: Pokeathlon Stats are different attributes of a Pokémon's performance + in Pokéathlons. In Pokéathlons, competitions happen on different courses; + one for each of the different Pokéathlon stats. See [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Pok%C3%A9athlon) + for greater detail. parameters: - in: path name: id @@ -2037,9 +2003,11 @@ paths: /api/v2/pokedex/: get: operationId: pokedex_list - description: |- - Mixin to allow association with separate serializers - for list or detail view. + description: A Pokédex is a handheld electronic encyclopedia device; one which + is capable of recording and retaining information of the various Pokémon in + a given region with the exception of the national dex and some smaller dexes + related to portions of a region. See [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Pokedex) + for greater detail. parameters: - name: limit required: false @@ -2069,9 +2037,11 @@ paths: /api/v2/pokedex/{id}/: get: operationId: pokedex_retrieve - description: |- - Mixin to allow association with separate serializers - for list or detail view. + description: A Pokédex is a handheld electronic encyclopedia device; one which + is capable of recording and retaining information of the various Pokémon in + a given region with the exception of the national dex and some smaller dexes + related to portions of a region. See [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Pokedex) + for greater detail. parameters: - in: path name: id @@ -2095,9 +2065,12 @@ paths: /api/v2/pokemon/: get: operationId: pokemon_list - description: |- - Mixin to allow association with separate serializers - for list or detail view. + description: Pokémon are the creatures that inhabit the world of the Pokémon + games. They can be caught using Pokéballs and trained by battling with other + Pokémon. Each Pokémon belongs to a specific species but may take on a variant + which makes it differ from other Pokémon of the same species, such as base + stats, available abilities and typings. See [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Pok%C3%A9mon_(species)) + for greater detail. parameters: - name: limit required: false @@ -2127,9 +2100,10 @@ paths: /api/v2/pokemon-color/: get: operationId: pokemon_color_list - description: |- - Mixin to allow association with separate serializers - for list or detail view. + description: Colors used for sorting Pokémon in a Pokédex. The color listed + in the Pokédex is usually the color most apparent or covering each Pokémon's + body. No orange category exists; Pokémon that are primarily orange are listed + as red or brown. parameters: - name: limit required: false @@ -2159,9 +2133,10 @@ paths: /api/v2/pokemon-color/{id}/: get: operationId: pokemon_color_retrieve - description: |- - Mixin to allow association with separate serializers - for list or detail view. + description: Colors used for sorting Pokémon in a Pokédex. The color listed + in the Pokédex is usually the color most apparent or covering each Pokémon's + body. No orange category exists; Pokémon that are primarily orange are listed + as red or brown. parameters: - in: path name: id @@ -2185,9 +2160,10 @@ paths: /api/v2/pokemon-form/: get: operationId: pokemon_form_list - description: |- - Mixin to allow association with separate serializers - for list or detail view. + description: Some Pokémon may appear in one of multiple, visually different + forms. These differences are purely cosmetic. For variations within a Pokémon + species, which do differ in more than just visuals, the 'Pokémon' entity is + used to represent such a variety. parameters: - name: limit required: false @@ -2217,9 +2193,10 @@ paths: /api/v2/pokemon-form/{id}/: get: operationId: pokemon_form_retrieve - description: |- - Mixin to allow association with separate serializers - for list or detail view. + description: Some Pokémon may appear in one of multiple, visually different + forms. These differences are purely cosmetic. For variations within a Pokémon + species, which do differ in more than just visuals, the 'Pokémon' entity is + used to represent such a variety. parameters: - in: path name: id @@ -2243,9 +2220,8 @@ paths: /api/v2/pokemon-habitat/: get: operationId: pokemon_habitat_list - description: |- - Mixin to allow association with separate serializers - for list or detail view. + description: Habitats are generally different terrain Pokémon can be found in + but can also be areas designated for rare or legendary Pokémon. parameters: - name: limit required: false @@ -2275,9 +2251,8 @@ paths: /api/v2/pokemon-habitat/{id}/: get: operationId: pokemon_habitat_retrieve - description: |- - Mixin to allow association with separate serializers - for list or detail view. + description: Habitats are generally different terrain Pokémon can be found in + but can also be areas designated for rare or legendary Pokémon. parameters: - in: path name: id @@ -2301,9 +2276,7 @@ paths: /api/v2/pokemon-shape/: get: operationId: pokemon_shape_list - description: |- - Mixin to allow association with separate serializers - for list or detail view. + description: Shapes used for sorting Pokémon in a Pokédex. parameters: - name: limit required: false @@ -2333,9 +2306,7 @@ paths: /api/v2/pokemon-shape/{id}/: get: operationId: pokemon_shape_retrieve - description: |- - Mixin to allow association with separate serializers - for list or detail view. + description: Shapes used for sorting Pokémon in a Pokédex. parameters: - in: path name: id @@ -2359,9 +2330,10 @@ paths: /api/v2/pokemon-species/: get: operationId: pokemon_species_list - description: |- - Mixin to allow association with separate serializers - for list or detail view. + description: A Pokémon Species forms the basis for at least one Pokémon. Attributes + of a Pokémon species are shared across all varieties of Pokémon within the + species. A good example is Wormadam; Wormadam is the species which can be + found in three different varieties, Wormadam-Trash, Wormadam-Sandy and Wormadam-Plant. parameters: - name: limit required: false @@ -2391,9 +2363,10 @@ paths: /api/v2/pokemon-species/{id}/: get: operationId: pokemon_species_retrieve - description: |- - Mixin to allow association with separate serializers - for list or detail view. + description: A Pokémon Species forms the basis for at least one Pokémon. Attributes + of a Pokémon species are shared across all varieties of Pokémon within the + species. A good example is Wormadam; Wormadam is the species which can be + found in three different varieties, Wormadam-Trash, Wormadam-Sandy and Wormadam-Plant. parameters: - in: path name: id @@ -2417,9 +2390,12 @@ paths: /api/v2/pokemon/{id}/: get: operationId: pokemon_retrieve - description: |- - Mixin to allow association with separate serializers - for list or detail view. + description: Pokémon are the creatures that inhabit the world of the Pokémon + games. They can be caught using Pokéballs and trained by battling with other + Pokémon. Each Pokémon belongs to a specific species but may take on a variant + which makes it differ from other Pokémon of the same species, such as base + stats, available abilities and typings. See [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Pok%C3%A9mon_(species)) + for greater detail. parameters: - in: path name: id @@ -2463,9 +2439,9 @@ paths: /api/v2/region/: get: operationId: region_list - description: |- - Mixin to allow association with separate serializers - for list or detail view. + description: A region is an organized area of the Pokémon world. Most often, + the main difference between regions is the species of Pokémon that can be + encountered within them. parameters: - name: limit required: false @@ -2495,9 +2471,9 @@ paths: /api/v2/region/{id}/: get: operationId: region_retrieve - description: |- - Mixin to allow association with separate serializers - for list or detail view. + description: A region is an organized area of the Pokémon world. Most often, + the main difference between regions is the species of Pokémon that can be + encountered within them. parameters: - in: path name: id @@ -2521,9 +2497,9 @@ paths: /api/v2/stat/: get: operationId: stat_list - description: |- - Mixin to allow association with separate serializers - for list or detail view. + description: Stats determine certain aspects of battles. Each Pokémon has a + value for each stat which grows as they gain levels and can be altered momentarily + by effects in battles. parameters: - name: limit required: false @@ -2553,9 +2529,9 @@ paths: /api/v2/stat/{id}/: get: operationId: stat_retrieve - description: |- - Mixin to allow association with separate serializers - for list or detail view. + description: Stats determine certain aspects of battles. Each Pokémon has a + value for each stat which grows as they gain levels and can be altered momentarily + by effects in battles. parameters: - in: path name: id @@ -2579,9 +2555,8 @@ paths: /api/v2/super-contest-effect/: get: operationId: super_contest_effect_list - description: |- - Mixin to allow association with separate serializers - for list or detail view. + description: Super contest effects refer to the effects of moves when used in + super contests. parameters: - name: limit required: false @@ -2611,9 +2586,8 @@ paths: /api/v2/super-contest-effect/{id}/: get: operationId: super_contest_effect_retrieve - description: |- - Mixin to allow association with separate serializers - for list or detail view. + description: Super contest effects refer to the effects of moves when used in + super contests. parameters: - in: path name: id @@ -2637,9 +2611,10 @@ paths: /api/v2/type/: get: operationId: type_list - description: |- - Mixin to allow association with separate serializers - for list or detail view. + description: 'Types are properties for Pokémon and their moves. Each type has + three properties: which types of Pokémon it is super effective against, which + types of Pokémon it is not very effective against, and which types of Pokémon + it is completely ineffective against.' parameters: - name: limit required: false @@ -2669,9 +2644,10 @@ paths: /api/v2/type/{id}/: get: operationId: type_retrieve - description: |- - Mixin to allow association with separate serializers - for list or detail view. + description: 'Types are properties for Pokémon and their moves. Each type has + three properties: which types of Pokémon it is super effective against, which + types of Pokémon it is not very effective against, and which types of Pokémon + it is completely ineffective against.' parameters: - in: path name: id @@ -2695,9 +2671,7 @@ paths: /api/v2/version/: get: operationId: version_list - description: |- - Mixin to allow association with separate serializers - for list or detail view. + description: Versions of the games, e.g., Red, Blue or Yellow. parameters: - name: limit required: false @@ -2727,9 +2701,7 @@ paths: /api/v2/version-group/: get: operationId: version_group_list - description: |- - Mixin to allow association with separate serializers - for list or detail view. + description: Version groups categorize highly similar versions of the games. parameters: - name: limit required: false @@ -2759,9 +2731,7 @@ paths: /api/v2/version-group/{id}/: get: operationId: version_group_retrieve - description: |- - Mixin to allow association with separate serializers - for list or detail view. + description: Version groups categorize highly similar versions of the games. parameters: - in: path name: id @@ -2785,9 +2755,7 @@ paths: /api/v2/version/{id}/: get: operationId: version_retrieve - description: |- - Mixin to allow association with separate serializers - for list or detail view. + description: Versions of the games, e.g., Red, Blue or Yellow. parameters: - in: path name: id From 5e1c02b07ab9cc9f38f224ec8a1c307869a83719 Mon Sep 17 00:00:00 2001 From: indyandie <1058837+Indyandie@users.noreply.github.com> Date: Mon, 26 Feb 2024 02:10:24 -0600 Subject: [PATCH 15/76] docs(openapi): add tags (groups) --- openapi.yml | 186 +++++++++++++++++------------------ pokemon_v2/api.py | 245 ++++++++++++++++++++++++++++++++++++---------- 2 files changed, 289 insertions(+), 142 deletions(-) diff --git a/openapi.yml b/openapi.yml index 69910fda..34c3c277 100644 --- a/openapi.yml +++ b/openapi.yml @@ -25,7 +25,7 @@ paths: schema: type: integer tags: - - ability + - pokemon security: - cookieAuth: [] - basicAuth: [] @@ -52,7 +52,7 @@ paths: description: A unique integer value identifying this ability. required: true tags: - - ability + - pokemon security: - cookieAuth: [] - basicAuth: [] @@ -85,7 +85,7 @@ paths: schema: type: integer tags: - - berry + - berries security: - cookieAuth: [] - basicAuth: [] @@ -116,7 +116,7 @@ paths: schema: type: integer tags: - - berry-firmness + - berries security: - cookieAuth: [] - basicAuth: [] @@ -141,7 +141,7 @@ paths: description: A unique integer value identifying this berry firmness. required: true tags: - - berry-firmness + - berries security: - cookieAuth: [] - basicAuth: [] @@ -173,7 +173,7 @@ paths: schema: type: integer tags: - - berry-flavor + - berries security: - cookieAuth: [] - basicAuth: [] @@ -199,7 +199,7 @@ paths: description: A unique integer value identifying this berry flavor. required: true tags: - - berry-flavor + - berries security: - cookieAuth: [] - basicAuth: [] @@ -226,7 +226,7 @@ paths: description: A unique integer value identifying this berry. required: true tags: - - berry + - berries security: - cookieAuth: [] - basicAuth: [] @@ -259,7 +259,7 @@ paths: schema: type: integer tags: - - characteristic + - pokemon security: - cookieAuth: [] - basicAuth: [] @@ -286,7 +286,7 @@ paths: description: A unique integer value identifying this characteristic. required: true tags: - - characteristic + - pokemon security: - cookieAuth: [] - basicAuth: [] @@ -316,7 +316,7 @@ paths: schema: type: integer tags: - - contest-effect + - contests security: - cookieAuth: [] - basicAuth: [] @@ -340,7 +340,7 @@ paths: description: A unique integer value identifying this contest effect. required: true tags: - - contest-effect + - contests security: - cookieAuth: [] - basicAuth: [] @@ -372,7 +372,7 @@ paths: schema: type: integer tags: - - contest-type + - contests security: - cookieAuth: [] - basicAuth: [] @@ -398,7 +398,7 @@ paths: description: A unique integer value identifying this contest type. required: true tags: - - contest-type + - contests security: - cookieAuth: [] - basicAuth: [] @@ -431,7 +431,7 @@ paths: schema: type: integer tags: - - egg-group + - pokemon security: - cookieAuth: [] - basicAuth: [] @@ -458,7 +458,7 @@ paths: description: A unique integer value identifying this egg group. required: true tags: - - egg-group + - pokemon security: - cookieAuth: [] - basicAuth: [] @@ -489,7 +489,7 @@ paths: schema: type: integer tags: - - encounter-condition + - encounters security: - cookieAuth: [] - basicAuth: [] @@ -520,7 +520,7 @@ paths: schema: type: integer tags: - - encounter-condition-value + - encounters security: - cookieAuth: [] - basicAuth: [] @@ -545,7 +545,7 @@ paths: description: A unique integer value identifying this encounter condition value. required: true tags: - - encounter-condition-value + - encounters security: - cookieAuth: [] - basicAuth: [] @@ -570,7 +570,7 @@ paths: description: A unique integer value identifying this encounter condition. required: true tags: - - encounter-condition + - encounters security: - cookieAuth: [] - basicAuth: [] @@ -601,7 +601,7 @@ paths: schema: type: integer tags: - - encounter-method + - encounters security: - cookieAuth: [] - basicAuth: [] @@ -626,7 +626,7 @@ paths: description: A unique integer value identifying this encounter method. required: true tags: - - encounter-method + - encounters security: - cookieAuth: [] - basicAuth: [] @@ -658,7 +658,7 @@ paths: schema: type: integer tags: - - evolution-chain + - evolution security: - cookieAuth: [] - basicAuth: [] @@ -684,7 +684,7 @@ paths: description: A unique integer value identifying this evolution chain. required: true tags: - - evolution-chain + - evolution security: - cookieAuth: [] - basicAuth: [] @@ -716,7 +716,7 @@ paths: schema: type: integer tags: - - evolution-trigger + - evolution security: - cookieAuth: [] - basicAuth: [] @@ -742,7 +742,7 @@ paths: description: A unique integer value identifying this evolution trigger. required: true tags: - - evolution-trigger + - evolution security: - cookieAuth: [] - basicAuth: [] @@ -775,7 +775,7 @@ paths: schema: type: integer tags: - - gender + - pokemon security: - cookieAuth: [] - basicAuth: [] @@ -802,7 +802,7 @@ paths: description: A unique integer value identifying this gender. required: true tags: - - gender + - pokemon security: - cookieAuth: [] - basicAuth: [] @@ -835,7 +835,7 @@ paths: schema: type: integer tags: - - generation + - games security: - cookieAuth: [] - basicAuth: [] @@ -862,7 +862,7 @@ paths: description: A unique integer value identifying this generation. required: true tags: - - generation + - games security: - cookieAuth: [] - basicAuth: [] @@ -894,7 +894,7 @@ paths: schema: type: integer tags: - - growth-rate + - pokemon security: - cookieAuth: [] - basicAuth: [] @@ -920,7 +920,7 @@ paths: description: A unique integer value identifying this growth rate. required: true tags: - - growth-rate + - pokemon security: - cookieAuth: [] - basicAuth: [] @@ -952,7 +952,7 @@ paths: schema: type: integer tags: - - item + - items security: - cookieAuth: [] - basicAuth: [] @@ -983,7 +983,7 @@ paths: schema: type: integer tags: - - item-attribute + - items security: - cookieAuth: [] - basicAuth: [] @@ -1008,7 +1008,7 @@ paths: description: A unique integer value identifying this item attribute. required: true tags: - - item-attribute + - items security: - cookieAuth: [] - basicAuth: [] @@ -1039,7 +1039,7 @@ paths: schema: type: integer tags: - - item-category + - items security: - cookieAuth: [] - basicAuth: [] @@ -1064,7 +1064,7 @@ paths: description: A unique integer value identifying this item category. required: true tags: - - item-category + - items security: - cookieAuth: [] - basicAuth: [] @@ -1095,7 +1095,7 @@ paths: schema: type: integer tags: - - item-fling-effect + - items security: - cookieAuth: [] - basicAuth: [] @@ -1120,7 +1120,7 @@ paths: description: A unique integer value identifying this item fling effect. required: true tags: - - item-fling-effect + - items security: - cookieAuth: [] - basicAuth: [] @@ -1150,7 +1150,7 @@ paths: schema: type: integer tags: - - item-pocket + - items security: - cookieAuth: [] - basicAuth: [] @@ -1174,7 +1174,7 @@ paths: description: A unique integer value identifying this item pocket. required: true tags: - - item-pocket + - items security: - cookieAuth: [] - basicAuth: [] @@ -1200,7 +1200,7 @@ paths: description: A unique integer value identifying this item. required: true tags: - - item + - items security: - cookieAuth: [] - basicAuth: [] @@ -1230,7 +1230,7 @@ paths: schema: type: integer tags: - - language + - utility security: - cookieAuth: [] - basicAuth: [] @@ -1254,7 +1254,7 @@ paths: description: A unique integer value identifying this language. required: true tags: - - language + - utility security: - cookieAuth: [] - basicAuth: [] @@ -1316,7 +1316,7 @@ paths: schema: type: integer tags: - - location-area + - location security: - cookieAuth: [] - basicAuth: [] @@ -1341,7 +1341,7 @@ paths: description: A unique integer value identifying this location area. required: true tags: - - location-area + - location security: - cookieAuth: [] - basicAuth: [] @@ -1398,7 +1398,7 @@ paths: schema: type: integer tags: - - machine + - machines security: - cookieAuth: [] - basicAuth: [] @@ -1424,7 +1424,7 @@ paths: description: A unique integer value identifying this machine. required: true tags: - - machine + - machines security: - cookieAuth: [] - basicAuth: [] @@ -1457,7 +1457,7 @@ paths: schema: type: integer tags: - - move + - moves security: - cookieAuth: [] - basicAuth: [] @@ -1489,7 +1489,7 @@ paths: schema: type: integer tags: - - move-ailment + - moves security: - cookieAuth: [] - basicAuth: [] @@ -1515,7 +1515,7 @@ paths: description: A unique integer value identifying this move meta ailment. required: true tags: - - move-ailment + - moves security: - cookieAuth: [] - basicAuth: [] @@ -1546,7 +1546,7 @@ paths: schema: type: integer tags: - - move-battle-style + - moves security: - cookieAuth: [] - basicAuth: [] @@ -1571,7 +1571,7 @@ paths: description: A unique integer value identifying this move battle style. required: true tags: - - move-battle-style + - moves security: - cookieAuth: [] - basicAuth: [] @@ -1601,7 +1601,7 @@ paths: schema: type: integer tags: - - move-category + - moves security: - cookieAuth: [] - basicAuth: [] @@ -1625,7 +1625,7 @@ paths: description: A unique integer value identifying this move meta category. required: true tags: - - move-category + - moves security: - cookieAuth: [] - basicAuth: [] @@ -1655,7 +1655,7 @@ paths: schema: type: integer tags: - - move-damage-class + - pokemon security: - cookieAuth: [] - basicAuth: [] @@ -1679,7 +1679,7 @@ paths: description: A unique integer value identifying this move damage class. required: true tags: - - move-damage-class + - pokemon security: - cookieAuth: [] - basicAuth: [] @@ -1709,7 +1709,7 @@ paths: schema: type: integer tags: - - move-learn-method + - moves security: - cookieAuth: [] - basicAuth: [] @@ -1733,7 +1733,7 @@ paths: description: A unique integer value identifying this move learn method. required: true tags: - - move-learn-method + - moves security: - cookieAuth: [] - basicAuth: [] @@ -1764,7 +1764,7 @@ paths: schema: type: integer tags: - - move-target + - moves security: - cookieAuth: [] - basicAuth: [] @@ -1789,7 +1789,7 @@ paths: description: A unique integer value identifying this move target. required: true tags: - - move-target + - moves security: - cookieAuth: [] - basicAuth: [] @@ -1816,7 +1816,7 @@ paths: description: A unique integer value identifying this move. required: true tags: - - move + - moves security: - cookieAuth: [] - basicAuth: [] @@ -1847,7 +1847,7 @@ paths: schema: type: integer tags: - - nature + - pokemon security: - cookieAuth: [] - basicAuth: [] @@ -1872,7 +1872,7 @@ paths: description: A unique integer value identifying this nature. required: true tags: - - nature + - pokemon security: - cookieAuth: [] - basicAuth: [] @@ -1903,7 +1903,7 @@ paths: schema: type: integer tags: - - pal-park-area + - location security: - cookieAuth: [] - basicAuth: [] @@ -1928,7 +1928,7 @@ paths: description: A unique integer value identifying this pal park area. required: true tags: - - pal-park-area + - location security: - cookieAuth: [] - basicAuth: [] @@ -1961,7 +1961,7 @@ paths: schema: type: integer tags: - - pokeathlon-stat + - pokemon security: - cookieAuth: [] - basicAuth: [] @@ -1988,7 +1988,7 @@ paths: description: A unique integer value identifying this pokeathlon stat. required: true tags: - - pokeathlon-stat + - pokemon security: - cookieAuth: [] - basicAuth: [] @@ -2022,7 +2022,7 @@ paths: schema: type: integer tags: - - pokedex + - games security: - cookieAuth: [] - basicAuth: [] @@ -2050,7 +2050,7 @@ paths: description: A unique integer value identifying this pokedex. required: true tags: - - pokedex + - games security: - cookieAuth: [] - basicAuth: [] @@ -2118,7 +2118,7 @@ paths: schema: type: integer tags: - - pokemon-color + - pokemon security: - cookieAuth: [] - basicAuth: [] @@ -2145,7 +2145,7 @@ paths: description: A unique integer value identifying this pokemon color. required: true tags: - - pokemon-color + - pokemon security: - cookieAuth: [] - basicAuth: [] @@ -2178,7 +2178,7 @@ paths: schema: type: integer tags: - - pokemon-form + - pokemon security: - cookieAuth: [] - basicAuth: [] @@ -2205,7 +2205,7 @@ paths: description: A unique integer value identifying this pokemon form. required: true tags: - - pokemon-form + - pokemon security: - cookieAuth: [] - basicAuth: [] @@ -2236,7 +2236,7 @@ paths: schema: type: integer tags: - - pokemon-habitat + - pokemon security: - cookieAuth: [] - basicAuth: [] @@ -2261,7 +2261,7 @@ paths: description: A unique integer value identifying this pokemon habitat. required: true tags: - - pokemon-habitat + - pokemon security: - cookieAuth: [] - basicAuth: [] @@ -2291,7 +2291,7 @@ paths: schema: type: integer tags: - - pokemon-shape + - pokemon security: - cookieAuth: [] - basicAuth: [] @@ -2315,7 +2315,7 @@ paths: description: A unique integer value identifying this pokemon shape. required: true tags: - - pokemon-shape + - pokemon security: - cookieAuth: [] - basicAuth: [] @@ -2348,7 +2348,7 @@ paths: schema: type: integer tags: - - pokemon-species + - pokemon security: - cookieAuth: [] - basicAuth: [] @@ -2375,7 +2375,7 @@ paths: description: A unique integer value identifying this pokemon species. required: true tags: - - pokemon-species + - pokemon security: - cookieAuth: [] - basicAuth: [] @@ -2428,7 +2428,7 @@ paths: pattern: ^\d+$ required: true tags: - - pokemon + - encounters security: - cookieAuth: [] - basicAuth: [] @@ -2456,7 +2456,7 @@ paths: schema: type: integer tags: - - region + - location security: - cookieAuth: [] - basicAuth: [] @@ -2482,7 +2482,7 @@ paths: description: A unique integer value identifying this region. required: true tags: - - region + - location security: - cookieAuth: [] - basicAuth: [] @@ -2514,7 +2514,7 @@ paths: schema: type: integer tags: - - stat + - pokemon security: - cookieAuth: [] - basicAuth: [] @@ -2540,7 +2540,7 @@ paths: description: A unique integer value identifying this stat. required: true tags: - - stat + - pokemon security: - cookieAuth: [] - basicAuth: [] @@ -2571,7 +2571,7 @@ paths: schema: type: integer tags: - - super-contest-effect + - contests security: - cookieAuth: [] - basicAuth: [] @@ -2596,7 +2596,7 @@ paths: description: A unique integer value identifying this super contest effect. required: true tags: - - super-contest-effect + - contests security: - cookieAuth: [] - basicAuth: [] @@ -2629,7 +2629,7 @@ paths: schema: type: integer tags: - - type + - pokemon security: - cookieAuth: [] - basicAuth: [] @@ -2656,7 +2656,7 @@ paths: description: A unique integer value identifying this type. required: true tags: - - type + - pokemon security: - cookieAuth: [] - basicAuth: [] @@ -2686,7 +2686,7 @@ paths: schema: type: integer tags: - - version + - games security: - cookieAuth: [] - basicAuth: [] @@ -2716,7 +2716,7 @@ paths: schema: type: integer tags: - - version-group + - games security: - cookieAuth: [] - basicAuth: [] @@ -2740,7 +2740,7 @@ paths: description: A unique integer value identifying this version group. required: true tags: - - version-group + - games security: - cookieAuth: [] - basicAuth: [] @@ -2764,7 +2764,7 @@ paths: description: A unique integer value identifying this version. required: true tags: - - version + - games security: - cookieAuth: [] - basicAuth: [] diff --git a/pokemon_v2/api.py b/pokemon_v2/api.py index c2f44386..8dcd1c1f 100644 --- a/pokemon_v2/api.py +++ b/pokemon_v2/api.py @@ -71,343 +71,490 @@ class PokeapiCommonViewset( ########## -@extend_schema(description='Abilities provide passive effects for Pokémon in battle or in the overworld. Pokémon have multiple possible abilities but can have only one ability at a time. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Ability) for greater detail.') +@extend_schema( + description='Abilities provide passive effects for Pokémon in battle or in the overworld. Pokémon have multiple possible abilities but can have only one ability at a time. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Ability) for greater detail.', + tags=[ 'pokemon' ] + ) class AbilityResource(PokeapiCommonViewset): queryset = Ability.objects.all() serializer_class = AbilityDetailSerializer list_serializer_class = AbilitySummarySerializer -@extend_schema(description='Berries are small fruits that can provide HP and status condition restoration, stat enhancement, and even damage negation when eaten by Pokémon. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Berry) for greater detail.') +@extend_schema( + description='Berries are small fruits that can provide HP and status condition restoration, stat enhancement, and even damage negation when eaten by Pokémon. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Berry) for greater detail.', + tags=[ 'berries' ] + ) class BerryResource(PokeapiCommonViewset): queryset = Berry.objects.all() serializer_class = BerryDetailSerializer list_serializer_class = BerrySummarySerializer -@extend_schema(description='Berries can be soft or hard. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Category:Berries_by_firmness) for greater detail.') +@extend_schema( + description='Berries can be soft or hard. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Category:Berries_by_firmness) for greater detail.', + tags=[ 'berries' ] + ) class BerryFirmnessResource(PokeapiCommonViewset): queryset = BerryFirmness.objects.all() serializer_class = BerryFirmnessDetailSerializer list_serializer_class = BerryFirmnessSummarySerializer -@extend_schema(description='Flavors determine whether a Pokémon will benefit or suffer from eating a berry based on their **nature**. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Flavor) for greater detail.') +@extend_schema( + description='Flavors determine whether a Pokémon will benefit or suffer from eating a berry based on their **nature**. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Flavor) for greater detail.', + tags=[ 'berries' ] + ) class BerryFlavorResource(PokeapiCommonViewset): queryset = BerryFlavor.objects.all() serializer_class = BerryFlavorDetailSerializer list_serializer_class = BerryFlavorSummarySerializer -@extend_schema(description='Characteristics indicate which stat contains a Pokémon\'s highest IV. A Pokémon\'s Characteristic is determined by the remainder of its highest IV divided by 5 (gene_modulo). Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Characteristic) for greater detail.') +@extend_schema( + description='Characteristics indicate which stat contains a Pokémon\'s highest IV. A Pokémon\'s Characteristic is determined by the remainder of its highest IV divided by 5 (gene_modulo). Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Characteristic) for greater detail.', + tags=[ 'pokemon' ] + ) class CharacteristicResource(PokeapiCommonViewset): queryset = Characteristic.objects.all() serializer_class = CharacteristicDetailSerializer list_serializer_class = CharacteristicSummarySerializer -@extend_schema(description='Contest effects refer to the effects of moves when used in contests.') +@extend_schema( + description='Contest effects refer to the effects of moves when used in contests.', + tags=[ 'contests' ] + ) class ContestEffectResource(PokeapiCommonViewset): queryset = ContestEffect.objects.all() serializer_class = ContestEffectDetailSerializer list_serializer_class = ContestEffectSummarySerializer -@extend_schema(description='Contest types are categories judges used to weigh a Pokémon\'s condition in Pokémon contests. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Contest_condition) for greater detail.') +@extend_schema( + description='Contest types are categories judges used to weigh a Pokémon\'s condition in Pokémon contests. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Contest_condition) for greater detail.', + tags=[ 'contests' ] + ) class ContestTypeResource(PokeapiCommonViewset): queryset = ContestType.objects.all() serializer_class = ContestTypeDetailSerializer list_serializer_class = ContestTypeSummarySerializer -@extend_schema(description='Egg Groups are categories which determine which Pokémon are able to interbreed. Pokémon may belong to either one or two Egg Groups. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Egg_Group) for greater detail.') +@extend_schema( + description='Egg Groups are categories which determine which Pokémon are able to interbreed. Pokémon may belong to either one or two Egg Groups. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Egg_Group) for greater detail.', + tags=[ 'pokemon' ] + ) class EggGroupResource(PokeapiCommonViewset): queryset = EggGroup.objects.all() serializer_class = EggGroupDetailSerializer list_serializer_class = EggGroupSummarySerializer -@extend_schema(description='Conditions which affect what pokemon might appear in the wild, e.g., day or night.') +@extend_schema( + description='Conditions which affect what pokemon might appear in the wild, e.g., day or night.', + tags=[ 'encounters' ] + ) class EncounterConditionResource(PokeapiCommonViewset): queryset = EncounterCondition.objects.all() serializer_class = EncounterConditionDetailSerializer list_serializer_class = EncounterConditionSummarySerializer -@extend_schema(description='Encounter condition values are the various states that an encounter condition can have, i.e., time of day can be either day or night.') +@extend_schema( + description='Encounter condition values are the various states that an encounter condition can have, i.e., time of day can be either day or night.', + tags=[ 'encounters' ] + ) class EncounterConditionValueResource(PokeapiCommonViewset): queryset = EncounterConditionValue.objects.all() serializer_class = EncounterConditionValueDetailSerializer list_serializer_class = EncounterConditionValueSummarySerializer -@extend_schema(description='Methods by which the player might can encounter Pokémon in the wild, e.g., walking in tall grass. Check out Bulbapedia for greater detail.') +@extend_schema( + description='Methods by which the player might can encounter Pokémon in the wild, e.g., walking in tall grass. Check out Bulbapedia for greater detail.', + tags=[ 'encounters' ] + ) class EncounterMethodResource(PokeapiCommonViewset): queryset = EncounterMethod.objects.all() serializer_class = EncounterMethodDetailSerializer list_serializer_class = EncounterMethodSummarySerializer -@extend_schema(description='Evolution chains are essentially family trees. They start with the lowest stage within a family and detail evolution conditions for each as well as Pokémon they can evolve into up through the hierarchy.') +@extend_schema( + description='Evolution chains are essentially family trees. They start with the lowest stage within a family and detail evolution conditions for each as well as Pokémon they can evolve into up through the hierarchy.', + tags=[ 'evolution' ] + ) class EvolutionChainResource(PokeapiCommonViewset): queryset = EvolutionChain.objects.all() serializer_class = EvolutionChainDetailSerializer list_serializer_class = EvolutionChainSummarySerializer -@extend_schema(description='Evolution triggers are the events and conditions that cause a Pokémon to evolve. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Methods_of_evolution) for greater detail.') +@extend_schema( + description='Evolution triggers are the events and conditions that cause a Pokémon to evolve. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Methods_of_evolution) for greater detail.', + tags=[ 'evolution' ] + ) class EvolutionTriggerResource(PokeapiCommonViewset): queryset = EvolutionTrigger.objects.all() serializer_class = EvolutionTriggerDetailSerializer list_serializer_class = EvolutionTriggerSummarySerializer -@extend_schema(description='A generation is a grouping of the Pokémon games that separates them based on the Pokémon they include. In each generation, a new set of Pokémon, Moves, Abilities and Types that did not exist in the previous generation are released.') +@extend_schema( + description='A generation is a grouping of the Pokémon games that separates them based on the Pokémon they include. In each generation, a new set of Pokémon, Moves, Abilities and Types that did not exist in the previous generation are released.', + tags=[ 'games' ] + ) class GenerationResource(PokeapiCommonViewset): queryset = Generation.objects.all() serializer_class = GenerationDetailSerializer list_serializer_class = GenerationSummarySerializer -@extend_schema(description='Genders were introduced in Generation II for the purposes of breeding Pokémon but can also result in visual differences or even different evolutionary lines. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Gender) for greater detail.') +@extend_schema( + description='Genders were introduced in Generation II for the purposes of breeding Pokémon but can also result in visual differences or even different evolutionary lines. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Gender) for greater detail.', + tags=[ 'pokemon' ] + ) class GenderResource(PokeapiCommonViewset): queryset = Gender.objects.all() serializer_class = GenderDetailSerializer list_serializer_class = GenderSummarySerializer -@extend_schema(description='Growth rates are the speed with which Pokémon gain levels through experience. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Experience) for greater detail.') +@extend_schema( + description='Growth rates are the speed with which Pokémon gain levels through experience. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Experience) for greater detail.', + tags=[ 'pokemon' ] + ) class GrowthRateResource(PokeapiCommonViewset): queryset = GrowthRate.objects.all() serializer_class = GrowthRateDetailSerializer list_serializer_class = GrowthRateSummarySerializer -@extend_schema(description='An item is an object in the games which the player can pick up, keep in their bag, and use in some manner. They have various uses, including healing, powering up, helping catch Pokémon, or to access a new area.') +@extend_schema( + description='An item is an object in the games which the player can pick up, keep in their bag, and use in some manner. They have various uses, including healing, powering up, helping catch Pokémon, or to access a new area.', + tags=[ 'items' ] + ) class ItemResource(PokeapiCommonViewset): queryset = Item.objects.all() serializer_class = ItemDetailSerializer list_serializer_class = ItemSummarySerializer -@extend_schema(description='Item categories determine where items will be placed in the players bag.') +@extend_schema( + description='Item categories determine where items will be placed in the players bag.', + tags=[ 'items' ] + ) class ItemCategoryResource(PokeapiCommonViewset): queryset = ItemCategory.objects.all() serializer_class = ItemCategoryDetailSerializer list_serializer_class = ItemCategorySummarySerializer -@extend_schema(description='Item attributes define particular aspects of items, e.g."usable in battle" or "consumable".') +@extend_schema( + description='Item attributes define particular aspects of items, e.g."usable in battle" or "consumable".', + tags=[ 'items' ] + ) class ItemAttributeResource(PokeapiCommonViewset): queryset = ItemAttribute.objects.all() serializer_class = ItemAttributeDetailSerializer list_serializer_class = ItemAttributeSummarySerializer -@extend_schema(description='The various effects of the move"Fling" when used with different items.') +@extend_schema( + description='The various effects of the move"Fling" when used with different items.', + tags=[ 'items' ] + ) class ItemFlingEffectResource(PokeapiCommonViewset): queryset = ItemFlingEffect.objects.all() serializer_class = ItemFlingEffectDetailSerializer list_serializer_class = ItemFlingEffectSummarySerializer -@extend_schema(description='Pockets within the players bag used for storing items by category.') +@extend_schema( + description='Pockets within the players bag used for storing items by category.', + tags=[ 'items' ] + ) class ItemPocketResource(PokeapiCommonViewset): queryset = ItemPocket.objects.all() serializer_class = ItemPocketDetailSerializer list_serializer_class = ItemPocketSummarySerializer -@extend_schema(description='Languages for translations of API resource information.') +@extend_schema( + description='Languages for translations of API resource information.', + tags=[ 'utility' ] + ) class LanguageResource(PokeapiCommonViewset): queryset = Language.objects.all() serializer_class = LanguageDetailSerializer list_serializer_class = LanguageSummarySerializer -@extend_schema(description='Locations that can be visited within the games. Locations make up sizable portions of regions, like cities or routes.') +@extend_schema( + description='Locations that can be visited within the games. Locations make up sizable portions of regions, like cities or routes.', + tags=[ 'location' ] + ) class LocationResource(PokeapiCommonViewset): queryset = Location.objects.all() serializer_class = LocationDetailSerializer list_serializer_class = LocationSummarySerializer -@extend_schema(description='Location areas are sections of areas, such as floors in a building or cave. Each area has its own set of possible Pokémon encounters.') +@extend_schema( + description='Location areas are sections of areas, such as floors in a building or cave. Each area has its own set of possible Pokémon encounters.', + tags=[ 'location' ] + ) class LocationAreaResource(ListOrDetailSerialRelation, viewsets.ReadOnlyModelViewSet): queryset = LocationArea.objects.all() serializer_class = LocationAreaDetailSerializer list_serializer_class = LocationAreaSummarySerializer -@extend_schema(description='Machines are the representation of items that teach moves to Pokémon. They vary from version to version, so it is not certain that one specific TM or HM corresponds to a single Machine.') +@extend_schema( + description='Machines are the representation of items that teach moves to Pokémon. They vary from version to version, so it is not certain that one specific TM or HM corresponds to a single Machine.', + tags=[ 'machines' ] + ) class MachineResource(PokeapiCommonViewset): queryset = Machine.objects.all() serializer_class = MachineDetailSerializer list_serializer_class = MachineSummarySerializer -@extend_schema(description='Moves are the skills of Pokémon in battle. In battle, a Pokémon uses one move each turn. Some moves (including those learned by Hidden Machine) can be used outside of battle as well, usually for the purpose of removing obstacles or exploring new areas.') +@extend_schema( + description='Moves are the skills of Pokémon in battle. In battle, a Pokémon uses one move each turn. Some moves (including those learned by Hidden Machine) can be used outside of battle as well, usually for the purpose of removing obstacles or exploring new areas.', + tags=[ 'moves' ] + ) class MoveResource(PokeapiCommonViewset): queryset = Move.objects.all() serializer_class = MoveDetailSerializer list_serializer_class = MoveSummarySerializer -@extend_schema(description='Damage classes moves can have, e.g. physical, special, or non-damaging.') +@extend_schema( + description='Damage classes moves can have, e.g. physical, special, or non-damaging.', + tags=[ 'pokemon' ] + ) class MoveDamageClassResource(PokeapiCommonViewset): queryset = MoveDamageClass.objects.all() serializer_class = MoveDamageClassDetailSerializer list_serializer_class = MoveDamageClassSummarySerializer -@extend_schema(description='Move Ailments are status conditions caused by moves used during battle. See [Bulbapedia](https://bulbapedia.bulbagarden.net/wiki/Status_condition) for greater detail.') +@extend_schema( + description='Move Ailments are status conditions caused by moves used during battle. See [Bulbapedia](https://bulbapedia.bulbagarden.net/wiki/Status_condition) for greater detail.', + tags=[ 'moves' ] + ) class MoveMetaAilmentResource(PokeapiCommonViewset): queryset = MoveMetaAilment.objects.all() serializer_class = MoveMetaAilmentDetailSerializer list_serializer_class = MoveMetaAilmentSummarySerializer -@extend_schema(description='Styles of moves when used in the Battle Palace. See [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Battle_Frontier_(Generation_III)) for greater detail.') +@extend_schema( + description='Styles of moves when used in the Battle Palace. See [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Battle_Frontier_(Generation_III)) for greater detail.', + tags=[ 'moves' ] + ) class MoveBattleStyleResource(PokeapiCommonViewset): queryset = MoveBattleStyle.objects.all() serializer_class = MoveBattleStyleDetailSerializer list_serializer_class = MoveBattleStyleSummarySerializer -@extend_schema(description='Very general categories that loosely group move effects.') +@extend_schema( + description='Very general categories that loosely group move effects.', + tags=[ 'moves' ] + ) class MoveMetaCategoryResource(PokeapiCommonViewset): queryset = MoveMetaCategory.objects.all() serializer_class = MoveMetaCategoryDetailSerializer list_serializer_class = MoveMetaCategorySummarySerializer -@extend_schema(description='Methods by which Pokémon can learn moves.') +@extend_schema( + description='Methods by which Pokémon can learn moves.', + tags=[ 'moves' ] + ) class MoveLearnMethodResource(PokeapiCommonViewset): queryset = MoveLearnMethod.objects.all() serializer_class = MoveLearnMethodDetailSerializer list_serializer_class = MoveLearnMethodSummarySerializer -@extend_schema(description='Targets moves can be directed at during battle. Targets can be Pokémon, environments or even other moves.') +@extend_schema( + description='Targets moves can be directed at during battle. Targets can be Pokémon, environments or even other moves.', + tags=[ 'moves' ] + ) class MoveTargetResource(PokeapiCommonViewset): queryset = MoveTarget.objects.all() serializer_class = MoveTargetDetailSerializer list_serializer_class = MoveTargetSummarySerializer -@extend_schema(description='Natures influence how a Pokémon\'s stats grow. See [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Nature) for greater detail.') +@extend_schema( + description='Natures influence how a Pokémon\'s stats grow. See [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Nature) for greater detail.', + tags=[ 'pokemon' ] + ) class NatureResource(PokeapiCommonViewset): queryset = Nature.objects.all() serializer_class = NatureDetailSerializer list_serializer_class = NatureSummarySerializer -@extend_schema(description='Areas used for grouping Pokémon encounters in Pal Park. They\'re like habitats that are specific to Pal Park.') +@extend_schema( + description='Areas used for grouping Pokémon encounters in Pal Park. They\'re like habitats that are specific to Pal Park.', + tags=[ 'location' ] + ) class PalParkAreaResource(PokeapiCommonViewset): queryset = PalParkArea.objects.all() serializer_class = PalParkAreaDetailSerializer list_serializer_class = PalParkAreaSummarySerializer -@extend_schema(description='Pokeathlon Stats are different attributes of a Pokémon\'s performance in Pokéathlons. In Pokéathlons, competitions happen on different courses; one for each of the different Pokéathlon stats. See [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Pok%C3%A9athlon) for greater detail.') +@extend_schema( + description='Pokeathlon Stats are different attributes of a Pokémon\'s performance in Pokéathlons. In Pokéathlons, competitions happen on different courses; one for each of the different Pokéathlon stats. See [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Pok%C3%A9athlon) for greater detail.', + tags=[ 'pokemon' ] + ) class PokeathlonStatResource(PokeapiCommonViewset): queryset = PokeathlonStat.objects.all() serializer_class = PokeathlonStatDetailSerializer list_serializer_class = PokeathlonStatSummarySerializer -@extend_schema(description='A Pokédex is a handheld electronic encyclopedia device; one which is capable of recording and retaining information of the various Pokémon in a given region with the exception of the national dex and some smaller dexes related to portions of a region. See [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Pokedex) for greater detail.') +@extend_schema( + description='A Pokédex is a handheld electronic encyclopedia device; one which is capable of recording and retaining information of the various Pokémon in a given region with the exception of the national dex and some smaller dexes related to portions of a region. See [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Pokedex) for greater detail.', + tags=[ 'games' ] + ) class PokedexResource(PokeapiCommonViewset): queryset = Pokedex.objects.all() serializer_class = PokedexDetailSerializer list_serializer_class = PokedexSummarySerializer -@extend_schema(description='Colors used for sorting Pokémon in a Pokédex. The color listed in the Pokédex is usually the color most apparent or covering each Pokémon\'s body. No orange category exists; Pokémon that are primarily orange are listed as red or brown.') +@extend_schema( + description='Colors used for sorting Pokémon in a Pokédex. The color listed in the Pokédex is usually the color most apparent or covering each Pokémon\'s body. No orange category exists; Pokémon that are primarily orange are listed as red or brown.', + tags=[ 'pokemon' ] + ) class PokemonColorResource(PokeapiCommonViewset): queryset = PokemonColor.objects.all() serializer_class = PokemonColorDetailSerializer list_serializer_class = PokemonColorSummarySerializer -@extend_schema(description='Some Pokémon may appear in one of multiple, visually different forms. These differences are purely cosmetic. For variations within a Pokémon species, which do differ in more than just visuals, the \'Pokémon\' entity is used to represent such a variety.') +@extend_schema( + description='Some Pokémon may appear in one of multiple, visually different forms. These differences are purely cosmetic. For variations within a Pokémon species, which do differ in more than just visuals, the \'Pokémon\' entity is used to represent such a variety.', + tags=[ 'pokemon' ] + ) class PokemonFormResource(PokeapiCommonViewset): queryset = PokemonForm.objects.all() serializer_class = PokemonFormDetailSerializer list_serializer_class = PokemonFormSummarySerializer -@extend_schema(description='Habitats are generally different terrain Pokémon can be found in but can also be areas designated for rare or legendary Pokémon.') +@extend_schema( + description='Habitats are generally different terrain Pokémon can be found in but can also be areas designated for rare or legendary Pokémon.', + tags=[ 'pokemon' ] + ) class PokemonHabitatResource(PokeapiCommonViewset): queryset = PokemonHabitat.objects.all() serializer_class = PokemonHabitatDetailSerializer list_serializer_class = PokemonHabitatSummarySerializer -@extend_schema(description='Shapes used for sorting Pokémon in a Pokédex.') +@extend_schema( + description='Shapes used for sorting Pokémon in a Pokédex.', + tags=[ 'pokemon' ] + ) class PokemonShapeResource(PokeapiCommonViewset): queryset = PokemonShape.objects.all() serializer_class = PokemonShapeDetailSerializer list_serializer_class = PokemonShapeSummarySerializer -@extend_schema(description='Pokémon are the creatures that inhabit the world of the Pokémon games. They can be caught using Pokéballs and trained by battling with other Pokémon. Each Pokémon belongs to a specific species but may take on a variant which makes it differ from other Pokémon of the same species, such as base stats, available abilities and typings. See [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Pok%C3%A9mon_(species)) for greater detail.') +@extend_schema( + description='Pokémon are the creatures that inhabit the world of the Pokémon games. They can be caught using Pokéballs and trained by battling with other Pokémon. Each Pokémon belongs to a specific species but may take on a variant which makes it differ from other Pokémon of the same species, such as base stats, available abilities and typings. See [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Pok%C3%A9mon_(species)) for greater detail.', + tags=[ 'pokemon' ] + ) class PokemonResource(PokeapiCommonViewset): queryset = Pokemon.objects.all() serializer_class = PokemonDetailSerializer list_serializer_class = PokemonSummarySerializer -@extend_schema(description='A Pokémon Species forms the basis for at least one Pokémon. Attributes of a Pokémon species are shared across all varieties of Pokémon within the species. A good example is Wormadam; Wormadam is the species which can be found in three different varieties, Wormadam-Trash, Wormadam-Sandy and Wormadam-Plant.') +@extend_schema( + description='A Pokémon Species forms the basis for at least one Pokémon. Attributes of a Pokémon species are shared across all varieties of Pokémon within the species. A good example is Wormadam; Wormadam is the species which can be found in three different varieties, Wormadam-Trash, Wormadam-Sandy and Wormadam-Plant.', + tags=[ 'pokemon' ] + ) class PokemonSpeciesResource(PokeapiCommonViewset): queryset = PokemonSpecies.objects.all().order_by("id") serializer_class = PokemonSpeciesDetailSerializer list_serializer_class = PokemonSpeciesSummarySerializer -@extend_schema(description='A region is an organized area of the Pokémon world. Most often, the main difference between regions is the species of Pokémon that can be encountered within them.') +@extend_schema( + description='A region is an organized area of the Pokémon world. Most often, the main difference between regions is the species of Pokémon that can be encountered within them.', + tags=[ 'location' ] + ) class RegionResource(PokeapiCommonViewset): queryset = Region.objects.all() serializer_class = RegionDetailSerializer list_serializer_class = RegionSummarySerializer -@extend_schema(description='Stats determine certain aspects of battles. Each Pokémon has a value for each stat which grows as they gain levels and can be altered momentarily by effects in battles.') +@extend_schema( + description='Stats determine certain aspects of battles. Each Pokémon has a value for each stat which grows as they gain levels and can be altered momentarily by effects in battles.', + tags=[ 'pokemon' ] + ) class StatResource(PokeapiCommonViewset): queryset = Stat.objects.all() serializer_class = StatDetailSerializer list_serializer_class = StatSummarySerializer -@extend_schema(description='Super contest effects refer to the effects of moves when used in super contests.') +@extend_schema( + description='Super contest effects refer to the effects of moves when used in super contests.', + tags=[ 'contests' ] + ) class SuperContestEffectResource(PokeapiCommonViewset): queryset = SuperContestEffect.objects.all() serializer_class = SuperContestEffectDetailSerializer list_serializer_class = SuperContestEffectSummarySerializer -@extend_schema(description='Types are properties for Pokémon and their moves. Each type has three properties: which types of Pokémon it is super effective against, which types of Pokémon it is not very effective against, and which types of Pokémon it is completely ineffective against.') +@extend_schema( + description='Types are properties for Pokémon and their moves. Each type has three properties: which types of Pokémon it is super effective against, which types of Pokémon it is not very effective against, and which types of Pokémon it is completely ineffective against.', + tags=[ 'pokemon' ] + ) class TypeResource(PokeapiCommonViewset): queryset = Type.objects.all() serializer_class = TypeDetailSerializer list_serializer_class = TypeSummarySerializer -@extend_schema(description='Versions of the games, e.g., Red, Blue or Yellow.') +@extend_schema( + description='Versions of the games, e.g., Red, Blue or Yellow.', + tags=[ 'games' ] + ) class VersionResource(PokeapiCommonViewset): queryset = Version.objects.all() serializer_class = VersionDetailSerializer list_serializer_class = VersionSummarySerializer -@extend_schema(description='Version groups categorize highly similar versions of the games.') +@extend_schema( + description='Version groups categorize highly similar versions of the games.', + tags=[ 'games' ] + ) class VersionGroupResource(PokeapiCommonViewset): queryset = VersionGroup.objects.all() serializer_class = VersionGroupDetailSerializer list_serializer_class = VersionGroupSummarySerializer -@extend_schema(description='Handles Pokemon Encounters as a sub-resource.') +@extend_schema( + description='Handles Pokemon Encounters as a sub-resource.', + tags=[ 'encounters' ] + ) class PokemonEncounterView(APIView): def get(self, request, pokemon_id): From 07471047c5b7a59d4aea264c7919749e16b41a4c Mon Sep 17 00:00:00 2001 From: indyandie <1058837+Indyandie@users.noreply.github.com> Date: Wed, 28 Feb 2024 00:26:18 -0600 Subject: [PATCH 16/76] docs(openapi): add path summary --- openapi.yml | 95 ++++++++++++ pokemon_v2/api.py | 388 ++++++++++++++++++++++++++++++++++++++++------ 2 files changed, 433 insertions(+), 50 deletions(-) diff --git a/openapi.yml b/openapi.yml index 34c3c277..d75c2553 100644 --- a/openapi.yml +++ b/openapi.yml @@ -71,6 +71,7 @@ paths: restoration, stat enhancement, and even damage negation when eaten by Pokémon. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Berry) for greater detail. + summary: List berries parameters: - name: limit required: false @@ -102,6 +103,7 @@ paths: operationId: berry_firmness_list description: Berries can be soft or hard. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Category:Berries_by_firmness) for greater detail. + summary: List berry firmness parameters: - name: limit required: false @@ -133,6 +135,7 @@ paths: operationId: berry_firmness_retrieve description: Berries can be soft or hard. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Category:Berries_by_firmness) for greater detail. + summary: Get berry by firmness parameters: - in: path name: id @@ -159,6 +162,7 @@ paths: description: Flavors determine whether a Pokémon will benefit or suffer from eating a berry based on their **nature**. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Flavor) for greater detail. + summary: List berry flavors parameters: - name: limit required: false @@ -191,6 +195,7 @@ paths: description: Flavors determine whether a Pokémon will benefit or suffer from eating a berry based on their **nature**. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Flavor) for greater detail. + summary: Get berries by flavor parameters: - in: path name: id @@ -218,6 +223,7 @@ paths: restoration, stat enhancement, and even damage negation when eaten by Pokémon. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Berry) for greater detail. + summary: Get a berry parameters: - in: path name: id @@ -245,6 +251,7 @@ paths: IV. A Pokémon's Characteristic is determined by the remainder of its highest IV divided by 5 (gene_modulo). Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Characteristic) for greater detail. + summary: List charecterictics parameters: - name: limit required: false @@ -278,6 +285,7 @@ paths: IV. A Pokémon's Characteristic is determined by the remainder of its highest IV divided by 5 (gene_modulo). Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Characteristic) for greater detail. + summary: Get charecterictic parameters: - in: path name: id @@ -302,6 +310,7 @@ paths: get: operationId: contest_effect_list description: Contest effects refer to the effects of moves when used in contests. + summary: List contest effects parameters: - name: limit required: false @@ -332,6 +341,7 @@ paths: get: operationId: contest_effect_retrieve description: Contest effects refer to the effects of moves when used in contests. + summary: Get contest effect parameters: - in: path name: id @@ -358,6 +368,7 @@ paths: description: Contest types are categories judges used to weigh a Pokémon's condition in Pokémon contests. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Contest_condition) for greater detail. + summary: List contest types parameters: - name: limit required: false @@ -390,6 +401,7 @@ paths: description: Contest types are categories judges used to weigh a Pokémon's condition in Pokémon contests. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Contest_condition) for greater detail. + summary: Get contest type parameters: - in: path name: id @@ -417,6 +429,7 @@ paths: to interbreed. Pokémon may belong to either one or two Egg Groups. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Egg_Group) for greater detail. + summary: List egg groups parameters: - name: limit required: false @@ -450,6 +463,7 @@ paths: to interbreed. Pokémon may belong to either one or two Egg Groups. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Egg_Group) for greater detail. + summary: Get egg group parameters: - in: path name: id @@ -475,6 +489,7 @@ paths: operationId: encounter_condition_list description: Conditions which affect what pokemon might appear in the wild, e.g., day or night. + summary: List encounter conditions parameters: - name: limit required: false @@ -506,6 +521,7 @@ paths: operationId: encounter_condition_value_list description: Encounter condition values are the various states that an encounter condition can have, i.e., time of day can be either day or night. + summary: List encounter condition values parameters: - name: limit required: false @@ -537,6 +553,7 @@ paths: operationId: encounter_condition_value_retrieve description: Encounter condition values are the various states that an encounter condition can have, i.e., time of day can be either day or night. + summary: Get encounter condition value parameters: - in: path name: id @@ -562,6 +579,7 @@ paths: operationId: encounter_condition_retrieve description: Conditions which affect what pokemon might appear in the wild, e.g., day or night. + summary: Get encounter condition parameters: - in: path name: id @@ -587,6 +605,7 @@ paths: operationId: encounter_method_list description: Methods by which the player might can encounter Pokémon in the wild, e.g., walking in tall grass. Check out Bulbapedia for greater detail. + summary: List encounter methods parameters: - name: limit required: false @@ -618,6 +637,7 @@ paths: operationId: encounter_method_retrieve description: Methods by which the player might can encounter Pokémon in the wild, e.g., walking in tall grass. Check out Bulbapedia for greater detail. + summary: Get encounter method parameters: - in: path name: id @@ -644,6 +664,7 @@ paths: description: Evolution chains are essentially family trees. They start with the lowest stage within a family and detail evolution conditions for each as well as Pokémon they can evolve into up through the hierarchy. + summary: List evolution chains parameters: - name: limit required: false @@ -676,6 +697,7 @@ paths: description: Evolution chains are essentially family trees. They start with the lowest stage within a family and detail evolution conditions for each as well as Pokémon they can evolve into up through the hierarchy. + summary: Get evolution chain parameters: - in: path name: id @@ -702,6 +724,7 @@ paths: description: Evolution triggers are the events and conditions that cause a Pokémon to evolve. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Methods_of_evolution) for greater detail. + summary: List evolution triggers parameters: - name: limit required: false @@ -734,6 +757,7 @@ paths: description: Evolution triggers are the events and conditions that cause a Pokémon to evolve. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Methods_of_evolution) for greater detail. + summary: Get evolution trigger parameters: - in: path name: id @@ -761,6 +785,7 @@ paths: Pokémon but can also result in visual differences or even different evolutionary lines. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Gender) for greater detail. + summary: List genders parameters: - name: limit required: false @@ -794,6 +819,7 @@ paths: Pokémon but can also result in visual differences or even different evolutionary lines. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Gender) for greater detail. + summary: Get gender parameters: - in: path name: id @@ -821,6 +847,7 @@ paths: them based on the Pokémon they include. In each generation, a new set of Pokémon, Moves, Abilities and Types that did not exist in the previous generation are released. + summary: List genrations parameters: - name: limit required: false @@ -854,6 +881,7 @@ paths: them based on the Pokémon they include. In each generation, a new set of Pokémon, Moves, Abilities and Types that did not exist in the previous generation are released. + summary: Get genration parameters: - in: path name: id @@ -880,6 +908,7 @@ paths: description: Growth rates are the speed with which Pokémon gain levels through experience. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Experience) for greater detail. + summary: List growth rates parameters: - name: limit required: false @@ -912,6 +941,7 @@ paths: description: Growth rates are the speed with which Pokémon gain levels through experience. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Experience) for greater detail. + summary: Get growth rate parameters: - in: path name: id @@ -938,6 +968,7 @@ paths: description: An item is an object in the games which the player can pick up, keep in their bag, and use in some manner. They have various uses, including healing, powering up, helping catch Pokémon, or to access a new area. + summary: List items parameters: - name: limit required: false @@ -969,6 +1000,7 @@ paths: operationId: item_attribute_list description: Item attributes define particular aspects of items, e.g."usable in battle" or "consumable". + summary: List item attributes parameters: - name: limit required: false @@ -1000,6 +1032,7 @@ paths: operationId: item_attribute_retrieve description: Item attributes define particular aspects of items, e.g."usable in battle" or "consumable". + summary: Get item attribute parameters: - in: path name: id @@ -1025,6 +1058,7 @@ paths: operationId: item_category_list description: Item categories determine where items will be placed in the players bag. + summary: List item categories parameters: - name: limit required: false @@ -1056,6 +1090,7 @@ paths: operationId: item_category_retrieve description: Item categories determine where items will be placed in the players bag. + summary: Get item category parameters: - in: path name: id @@ -1081,6 +1116,7 @@ paths: operationId: item_fling_effect_list description: The various effects of the move"Fling" when used with different items. + summary: List item fling effects parameters: - name: limit required: false @@ -1112,6 +1148,7 @@ paths: operationId: item_fling_effect_retrieve description: The various effects of the move"Fling" when used with different items. + summary: Get item fling effect parameters: - in: path name: id @@ -1136,6 +1173,7 @@ paths: get: operationId: item_pocket_list description: Pockets within the players bag used for storing items by category. + summary: List item pockets parameters: - name: limit required: false @@ -1166,6 +1204,7 @@ paths: get: operationId: item_pocket_retrieve description: Pockets within the players bag used for storing items by category. + summary: Get item pocket parameters: - in: path name: id @@ -1192,6 +1231,7 @@ paths: description: An item is an object in the games which the player can pick up, keep in their bag, and use in some manner. They have various uses, including healing, powering up, helping catch Pokémon, or to access a new area. + summary: Get item parameters: - in: path name: id @@ -1216,6 +1256,7 @@ paths: get: operationId: language_list description: Languages for translations of API resource information. + summary: List languages parameters: - name: limit required: false @@ -1246,6 +1287,7 @@ paths: get: operationId: language_retrieve description: Languages for translations of API resource information. + summary: Get language parameters: - in: path name: id @@ -1271,6 +1313,7 @@ paths: operationId: location_list description: Locations that can be visited within the games. Locations make up sizable portions of regions, like cities or routes. + summary: List locations parameters: - name: limit required: false @@ -1302,6 +1345,7 @@ paths: operationId: location_area_list description: Location areas are sections of areas, such as floors in a building or cave. Each area has its own set of possible Pokémon encounters. + summary: List location areas parameters: - name: limit required: false @@ -1333,6 +1377,7 @@ paths: operationId: location_area_retrieve description: Location areas are sections of areas, such as floors in a building or cave. Each area has its own set of possible Pokémon encounters. + summary: Get location area parameters: - in: path name: id @@ -1358,6 +1403,7 @@ paths: operationId: location_retrieve description: Locations that can be visited within the games. Locations make up sizable portions of regions, like cities or routes. + summary: Get location parameters: - in: path name: id @@ -1384,6 +1430,7 @@ paths: description: Machines are the representation of items that teach moves to Pokémon. They vary from version to version, so it is not certain that one specific TM or HM corresponds to a single Machine. + summary: List machines parameters: - name: limit required: false @@ -1416,6 +1463,7 @@ paths: description: Machines are the representation of items that teach moves to Pokémon. They vary from version to version, so it is not certain that one specific TM or HM corresponds to a single Machine. + summary: Get machine parameters: - in: path name: id @@ -1443,6 +1491,7 @@ paths: uses one move each turn. Some moves (including those learned by Hidden Machine) can be used outside of battle as well, usually for the purpose of removing obstacles or exploring new areas. + summary: List moves parameters: - name: limit required: false @@ -1475,6 +1524,7 @@ paths: description: Move Ailments are status conditions caused by moves used during battle. See [Bulbapedia](https://bulbapedia.bulbagarden.net/wiki/Status_condition) for greater detail. + summary: List move meta ailments parameters: - name: limit required: false @@ -1507,6 +1557,7 @@ paths: description: Move Ailments are status conditions caused by moves used during battle. See [Bulbapedia](https://bulbapedia.bulbagarden.net/wiki/Status_condition) for greater detail. + summary: Get move meta ailment parameters: - in: path name: id @@ -1532,6 +1583,7 @@ paths: operationId: move_battle_style_list description: Styles of moves when used in the Battle Palace. See [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Battle_Frontier_(Generation_III)) for greater detail. + summary: List move battle styles parameters: - name: limit required: false @@ -1563,6 +1615,7 @@ paths: operationId: move_battle_style_retrieve description: Styles of moves when used in the Battle Palace. See [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Battle_Frontier_(Generation_III)) for greater detail. + summary: Get move battle style parameters: - in: path name: id @@ -1587,6 +1640,7 @@ paths: get: operationId: move_category_list description: Very general categories that loosely group move effects. + summary: List move meta categories parameters: - name: limit required: false @@ -1617,6 +1671,7 @@ paths: get: operationId: move_category_retrieve description: Very general categories that loosely group move effects. + summary: Get move meta category parameters: - in: path name: id @@ -1641,6 +1696,7 @@ paths: get: operationId: move_damage_class_list description: Damage classes moves can have, e.g. physical, special, or non-damaging. + summary: List move damage classes parameters: - name: limit required: false @@ -1671,6 +1727,7 @@ paths: get: operationId: move_damage_class_retrieve description: Damage classes moves can have, e.g. physical, special, or non-damaging. + summary: Get move damage class parameters: - in: path name: id @@ -1695,6 +1752,7 @@ paths: get: operationId: move_learn_method_list description: Methods by which Pokémon can learn moves. + summary: List move learn methods parameters: - name: limit required: false @@ -1725,6 +1783,7 @@ paths: get: operationId: move_learn_method_retrieve description: Methods by which Pokémon can learn moves. + summary: Get move learn method parameters: - in: path name: id @@ -1750,6 +1809,7 @@ paths: operationId: move_target_list description: Targets moves can be directed at during battle. Targets can be Pokémon, environments or even other moves. + summary: List move targets parameters: - name: limit required: false @@ -1781,6 +1841,7 @@ paths: operationId: move_target_retrieve description: Targets moves can be directed at during battle. Targets can be Pokémon, environments or even other moves. + summary: Get move target parameters: - in: path name: id @@ -1808,6 +1869,7 @@ paths: uses one move each turn. Some moves (including those learned by Hidden Machine) can be used outside of battle as well, usually for the purpose of removing obstacles or exploring new areas. + summary: Get move parameters: - in: path name: id @@ -1833,6 +1895,7 @@ paths: operationId: nature_list description: Natures influence how a Pokémon's stats grow. See [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Nature) for greater detail. + summary: List natures parameters: - name: limit required: false @@ -1864,6 +1927,7 @@ paths: operationId: nature_retrieve description: Natures influence how a Pokémon's stats grow. See [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Nature) for greater detail. + summary: Get nature parameters: - in: path name: id @@ -1889,6 +1953,7 @@ paths: operationId: pal_park_area_list description: Areas used for grouping Pokémon encounters in Pal Park. They're like habitats that are specific to Pal Park. + summary: List pal park areas parameters: - name: limit required: false @@ -1920,6 +1985,7 @@ paths: operationId: pal_park_area_retrieve description: Areas used for grouping Pokémon encounters in Pal Park. They're like habitats that are specific to Pal Park. + summary: Get pal park area parameters: - in: path name: id @@ -1947,6 +2013,7 @@ paths: in Pokéathlons. In Pokéathlons, competitions happen on different courses; one for each of the different Pokéathlon stats. See [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Pok%C3%A9athlon) for greater detail. + summary: List pokeathlon stats parameters: - name: limit required: false @@ -1980,6 +2047,7 @@ paths: in Pokéathlons. In Pokéathlons, competitions happen on different courses; one for each of the different Pokéathlon stats. See [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Pok%C3%A9athlon) for greater detail. + summary: Get pokeathlon stat parameters: - in: path name: id @@ -2008,6 +2076,7 @@ paths: a given region with the exception of the national dex and some smaller dexes related to portions of a region. See [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Pokedex) for greater detail. + summary: List pokedex parameters: - name: limit required: false @@ -2042,6 +2111,7 @@ paths: a given region with the exception of the national dex and some smaller dexes related to portions of a region. See [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Pokedex) for greater detail. + summary: Get pokedex parameters: - in: path name: id @@ -2071,6 +2141,7 @@ paths: which makes it differ from other Pokémon of the same species, such as base stats, available abilities and typings. See [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Pok%C3%A9mon_(species)) for greater detail. + summary: List pokemon parameters: - name: limit required: false @@ -2104,6 +2175,7 @@ paths: in the Pokédex is usually the color most apparent or covering each Pokémon's body. No orange category exists; Pokémon that are primarily orange are listed as red or brown. + summary: List pokemon colors parameters: - name: limit required: false @@ -2137,6 +2209,7 @@ paths: in the Pokédex is usually the color most apparent or covering each Pokémon's body. No orange category exists; Pokémon that are primarily orange are listed as red or brown. + summary: Get pokemon color parameters: - in: path name: id @@ -2164,6 +2237,7 @@ paths: forms. These differences are purely cosmetic. For variations within a Pokémon species, which do differ in more than just visuals, the 'Pokémon' entity is used to represent such a variety. + summary: List pokemon forms parameters: - name: limit required: false @@ -2197,6 +2271,7 @@ paths: forms. These differences are purely cosmetic. For variations within a Pokémon species, which do differ in more than just visuals, the 'Pokémon' entity is used to represent such a variety. + summary: Get pokemon form parameters: - in: path name: id @@ -2222,6 +2297,7 @@ paths: operationId: pokemon_habitat_list description: Habitats are generally different terrain Pokémon can be found in but can also be areas designated for rare or legendary Pokémon. + summary: List pokemom habitas parameters: - name: limit required: false @@ -2253,6 +2329,7 @@ paths: operationId: pokemon_habitat_retrieve description: Habitats are generally different terrain Pokémon can be found in but can also be areas designated for rare or legendary Pokémon. + summary: Get pokemom habita parameters: - in: path name: id @@ -2277,6 +2354,7 @@ paths: get: operationId: pokemon_shape_list description: Shapes used for sorting Pokémon in a Pokédex. + summary: List pokemon shapes parameters: - name: limit required: false @@ -2307,6 +2385,7 @@ paths: get: operationId: pokemon_shape_retrieve description: Shapes used for sorting Pokémon in a Pokédex. + summary: Get pokemon shape parameters: - in: path name: id @@ -2334,6 +2413,7 @@ paths: of a Pokémon species are shared across all varieties of Pokémon within the species. A good example is Wormadam; Wormadam is the species which can be found in three different varieties, Wormadam-Trash, Wormadam-Sandy and Wormadam-Plant. + summary: List pokemon specs parameters: - name: limit required: false @@ -2367,6 +2447,7 @@ paths: of a Pokémon species are shared across all varieties of Pokémon within the species. A good example is Wormadam; Wormadam is the species which can be found in three different varieties, Wormadam-Trash, Wormadam-Sandy and Wormadam-Plant. + summary: Get pokemon spec parameters: - in: path name: id @@ -2396,6 +2477,7 @@ paths: which makes it differ from other Pokémon of the same species, such as base stats, available abilities and typings. See [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Pok%C3%A9mon_(species)) for greater detail. + summary: Get pokemon parameters: - in: path name: id @@ -2420,6 +2502,7 @@ paths: get: operationId: pokemon_encounters_retrieve description: Handles Pokemon Encounters as a sub-resource. + summary: Get pokemon encounter parameters: - in: path name: pokemon_id @@ -2442,6 +2525,7 @@ paths: description: A region is an organized area of the Pokémon world. Most often, the main difference between regions is the species of Pokémon that can be encountered within them. + summary: List regions parameters: - name: limit required: false @@ -2474,6 +2558,7 @@ paths: description: A region is an organized area of the Pokémon world. Most often, the main difference between regions is the species of Pokémon that can be encountered within them. + summary: Get region parameters: - in: path name: id @@ -2500,6 +2585,7 @@ paths: description: Stats determine certain aspects of battles. Each Pokémon has a value for each stat which grows as they gain levels and can be altered momentarily by effects in battles. + summary: List stats parameters: - name: limit required: false @@ -2532,6 +2618,7 @@ paths: description: Stats determine certain aspects of battles. Each Pokémon has a value for each stat which grows as they gain levels and can be altered momentarily by effects in battles. + summary: Get stat parameters: - in: path name: id @@ -2557,6 +2644,7 @@ paths: operationId: super_contest_effect_list description: Super contest effects refer to the effects of moves when used in super contests. + summary: List super contest effects parameters: - name: limit required: false @@ -2588,6 +2676,7 @@ paths: operationId: super_contest_effect_retrieve description: Super contest effects refer to the effects of moves when used in super contests. + summary: Get super contest effect parameters: - in: path name: id @@ -2615,6 +2704,7 @@ paths: three properties: which types of Pokémon it is super effective against, which types of Pokémon it is not very effective against, and which types of Pokémon it is completely ineffective against.' + summary: List types parameters: - name: limit required: false @@ -2648,6 +2738,7 @@ paths: three properties: which types of Pokémon it is super effective against, which types of Pokémon it is not very effective against, and which types of Pokémon it is completely ineffective against.' + summary: List types parameters: - in: path name: id @@ -2672,6 +2763,7 @@ paths: get: operationId: version_list description: Versions of the games, e.g., Red, Blue or Yellow. + summary: List versions parameters: - name: limit required: false @@ -2702,6 +2794,7 @@ paths: get: operationId: version_group_list description: Version groups categorize highly similar versions of the games. + summary: List version groups parameters: - name: limit required: false @@ -2732,6 +2825,7 @@ paths: get: operationId: version_group_retrieve description: Version groups categorize highly similar versions of the games. + summary: Get version group parameters: - in: path name: id @@ -2756,6 +2850,7 @@ paths: get: operationId: version_retrieve description: Versions of the games, e.g., Red, Blue or Yellow. + summary: Get version parameters: - in: path name: id diff --git a/pokemon_v2/api.py b/pokemon_v2/api.py index 8dcd1c1f..1737680a 100644 --- a/pokemon_v2/api.py +++ b/pokemon_v2/api.py @@ -4,7 +4,7 @@ from rest_framework.response import Response from rest_framework.views import APIView from django.shortcuts import get_object_or_404 from django.http import Http404 -from drf_spectacular.utils import extend_schema +from drf_spectacular.utils import extend_schema, extend_schema_serializer, extend_schema_view from .models import * from .serializers import * @@ -73,7 +73,7 @@ class PokeapiCommonViewset( @extend_schema( description='Abilities provide passive effects for Pokémon in battle or in the overworld. Pokémon have multiple possible abilities but can have only one ability at a time. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Ability) for greater detail.', - tags=[ 'pokemon' ] + tags=[ 'pokemon' ], ) class AbilityResource(PokeapiCommonViewset): queryset = Ability.objects.all() @@ -83,8 +83,14 @@ class AbilityResource(PokeapiCommonViewset): @extend_schema( description='Berries are small fruits that can provide HP and status condition restoration, stat enhancement, and even damage negation when eaten by Pokémon. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Berry) for greater detail.', - tags=[ 'berries' ] + tags=[ 'berries' ], + summary='Get a berry', ) +@extend_schema_view( + list=extend_schema( + summary='List berries', + ) +) class BerryResource(PokeapiCommonViewset): queryset = Berry.objects.all() serializer_class = BerryDetailSerializer @@ -93,8 +99,14 @@ class BerryResource(PokeapiCommonViewset): @extend_schema( description='Berries can be soft or hard. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Category:Berries_by_firmness) for greater detail.', - tags=[ 'berries' ] + tags=[ 'berries' ], + summary='Get berry by firmness', ) +@extend_schema_view( + list=extend_schema( + summary='List berry firmness', + ) +) class BerryFirmnessResource(PokeapiCommonViewset): queryset = BerryFirmness.objects.all() serializer_class = BerryFirmnessDetailSerializer @@ -103,8 +115,14 @@ class BerryFirmnessResource(PokeapiCommonViewset): @extend_schema( description='Flavors determine whether a Pokémon will benefit or suffer from eating a berry based on their **nature**. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Flavor) for greater detail.', - tags=[ 'berries' ] + summary='Get berries by flavor', + tags=[ 'berries' ], ) +@extend_schema_view( + list=extend_schema( + summary='List berry flavors', + ) +) class BerryFlavorResource(PokeapiCommonViewset): queryset = BerryFlavor.objects.all() serializer_class = BerryFlavorDetailSerializer @@ -113,8 +131,14 @@ class BerryFlavorResource(PokeapiCommonViewset): @extend_schema( description='Characteristics indicate which stat contains a Pokémon\'s highest IV. A Pokémon\'s Characteristic is determined by the remainder of its highest IV divided by 5 (gene_modulo). Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Characteristic) for greater detail.', - tags=[ 'pokemon' ] + summary='Get charecterictic', + tags=[ 'pokemon' ], ) +@extend_schema_view( + list=extend_schema( + summary='List charecterictics', + ) +) class CharacteristicResource(PokeapiCommonViewset): queryset = Characteristic.objects.all() serializer_class = CharacteristicDetailSerializer @@ -123,8 +147,14 @@ class CharacteristicResource(PokeapiCommonViewset): @extend_schema( description='Contest effects refer to the effects of moves when used in contests.', - tags=[ 'contests' ] + tags=[ 'contests' ], + summary='Get contest effect', ) +@extend_schema_view( + list=extend_schema( + summary='List contest effects', + ) +) class ContestEffectResource(PokeapiCommonViewset): queryset = ContestEffect.objects.all() serializer_class = ContestEffectDetailSerializer @@ -133,8 +163,14 @@ class ContestEffectResource(PokeapiCommonViewset): @extend_schema( description='Contest types are categories judges used to weigh a Pokémon\'s condition in Pokémon contests. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Contest_condition) for greater detail.', - tags=[ 'contests' ] + summary='Get contest type', + tags=[ 'contests' ], ) +@extend_schema_view( + list=extend_schema( + summary='List contest types', + ) +) class ContestTypeResource(PokeapiCommonViewset): queryset = ContestType.objects.all() serializer_class = ContestTypeDetailSerializer @@ -143,8 +179,14 @@ class ContestTypeResource(PokeapiCommonViewset): @extend_schema( description='Egg Groups are categories which determine which Pokémon are able to interbreed. Pokémon may belong to either one or two Egg Groups. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Egg_Group) for greater detail.', - tags=[ 'pokemon' ] + summary='Get egg group', + tags=[ 'pokemon' ], ) +@extend_schema_view( + list=extend_schema( + summary='List egg groups', + ) +) class EggGroupResource(PokeapiCommonViewset): queryset = EggGroup.objects.all() serializer_class = EggGroupDetailSerializer @@ -153,8 +195,14 @@ class EggGroupResource(PokeapiCommonViewset): @extend_schema( description='Conditions which affect what pokemon might appear in the wild, e.g., day or night.', - tags=[ 'encounters' ] + summary='Get encounter condition', + tags=[ 'encounters' ], ) +@extend_schema_view( + list=extend_schema( + summary='List encounter conditions', + ) +) class EncounterConditionResource(PokeapiCommonViewset): queryset = EncounterCondition.objects.all() serializer_class = EncounterConditionDetailSerializer @@ -163,8 +211,14 @@ class EncounterConditionResource(PokeapiCommonViewset): @extend_schema( description='Encounter condition values are the various states that an encounter condition can have, i.e., time of day can be either day or night.', - tags=[ 'encounters' ] + summary='Get encounter condition value', + tags=[ 'encounters' ], ) +@extend_schema_view( + list=extend_schema( + summary='List encounter condition values', + ) +) class EncounterConditionValueResource(PokeapiCommonViewset): queryset = EncounterConditionValue.objects.all() serializer_class = EncounterConditionValueDetailSerializer @@ -173,8 +227,14 @@ class EncounterConditionValueResource(PokeapiCommonViewset): @extend_schema( description='Methods by which the player might can encounter Pokémon in the wild, e.g., walking in tall grass. Check out Bulbapedia for greater detail.', - tags=[ 'encounters' ] + summary='Get encounter method', + tags=[ 'encounters' ], ) +@extend_schema_view( + list=extend_schema( + summary='List encounter methods', + ) +) class EncounterMethodResource(PokeapiCommonViewset): queryset = EncounterMethod.objects.all() serializer_class = EncounterMethodDetailSerializer @@ -183,8 +243,14 @@ class EncounterMethodResource(PokeapiCommonViewset): @extend_schema( description='Evolution chains are essentially family trees. They start with the lowest stage within a family and detail evolution conditions for each as well as Pokémon they can evolve into up through the hierarchy.', - tags=[ 'evolution' ] + summary='Get evolution chain', + tags=[ 'evolution' ], ) +@extend_schema_view( + list=extend_schema( + summary='List evolution chains', + ) +) class EvolutionChainResource(PokeapiCommonViewset): queryset = EvolutionChain.objects.all() serializer_class = EvolutionChainDetailSerializer @@ -193,8 +259,14 @@ class EvolutionChainResource(PokeapiCommonViewset): @extend_schema( description='Evolution triggers are the events and conditions that cause a Pokémon to evolve. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Methods_of_evolution) for greater detail.', - tags=[ 'evolution' ] + summary='Get evolution trigger', + tags=[ 'evolution' ], ) +@extend_schema_view( + list=extend_schema( + summary='List evolution triggers', + ) +) class EvolutionTriggerResource(PokeapiCommonViewset): queryset = EvolutionTrigger.objects.all() serializer_class = EvolutionTriggerDetailSerializer @@ -203,8 +275,14 @@ class EvolutionTriggerResource(PokeapiCommonViewset): @extend_schema( description='A generation is a grouping of the Pokémon games that separates them based on the Pokémon they include. In each generation, a new set of Pokémon, Moves, Abilities and Types that did not exist in the previous generation are released.', - tags=[ 'games' ] + summary='Get genration', + tags=[ 'games' ], ) +@extend_schema_view( + list=extend_schema( + summary='List genrations', + ) +) class GenerationResource(PokeapiCommonViewset): queryset = Generation.objects.all() serializer_class = GenerationDetailSerializer @@ -213,8 +291,14 @@ class GenerationResource(PokeapiCommonViewset): @extend_schema( description='Genders were introduced in Generation II for the purposes of breeding Pokémon but can also result in visual differences or even different evolutionary lines. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Gender) for greater detail.', - tags=[ 'pokemon' ] + summary='Get gender', + tags=[ 'pokemon' ], ) +@extend_schema_view( + list=extend_schema( + summary='List genders', + ) +) class GenderResource(PokeapiCommonViewset): queryset = Gender.objects.all() serializer_class = GenderDetailSerializer @@ -223,8 +307,14 @@ class GenderResource(PokeapiCommonViewset): @extend_schema( description='Growth rates are the speed with which Pokémon gain levels through experience. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Experience) for greater detail.', - tags=[ 'pokemon' ] + summary='Get growth rate', + tags=[ 'pokemon' ], ) +@extend_schema_view( + list=extend_schema( + summary='List growth rates', + ) +) class GrowthRateResource(PokeapiCommonViewset): queryset = GrowthRate.objects.all() serializer_class = GrowthRateDetailSerializer @@ -233,8 +323,14 @@ class GrowthRateResource(PokeapiCommonViewset): @extend_schema( description='An item is an object in the games which the player can pick up, keep in their bag, and use in some manner. They have various uses, including healing, powering up, helping catch Pokémon, or to access a new area.', - tags=[ 'items' ] + summary='Get item', + tags=[ 'items' ], ) +@extend_schema_view( + list=extend_schema( + summary='List items', + ) +) class ItemResource(PokeapiCommonViewset): queryset = Item.objects.all() serializer_class = ItemDetailSerializer @@ -243,8 +339,14 @@ class ItemResource(PokeapiCommonViewset): @extend_schema( description='Item categories determine where items will be placed in the players bag.', - tags=[ 'items' ] + summary='Get item category', + tags=[ 'items' ], ) +@extend_schema_view( + list=extend_schema( + summary='List item categories', + ) +) class ItemCategoryResource(PokeapiCommonViewset): queryset = ItemCategory.objects.all() serializer_class = ItemCategoryDetailSerializer @@ -253,8 +355,14 @@ class ItemCategoryResource(PokeapiCommonViewset): @extend_schema( description='Item attributes define particular aspects of items, e.g."usable in battle" or "consumable".', - tags=[ 'items' ] + summary='Get item attribute', + tags=[ 'items' ], ) +@extend_schema_view( + list=extend_schema( + summary='List item attributes', + ) +) class ItemAttributeResource(PokeapiCommonViewset): queryset = ItemAttribute.objects.all() serializer_class = ItemAttributeDetailSerializer @@ -263,8 +371,14 @@ class ItemAttributeResource(PokeapiCommonViewset): @extend_schema( description='The various effects of the move"Fling" when used with different items.', - tags=[ 'items' ] + summary='Get item fling effect', + tags=[ 'items' ], ) +@extend_schema_view( + list=extend_schema( + summary='List item fling effects', + ) +) class ItemFlingEffectResource(PokeapiCommonViewset): queryset = ItemFlingEffect.objects.all() serializer_class = ItemFlingEffectDetailSerializer @@ -273,8 +387,14 @@ class ItemFlingEffectResource(PokeapiCommonViewset): @extend_schema( description='Pockets within the players bag used for storing items by category.', - tags=[ 'items' ] + summary='Get item pocket', + tags=[ 'items' ], ) +@extend_schema_view( + list=extend_schema( + summary='List item pockets', + ) +) class ItemPocketResource(PokeapiCommonViewset): queryset = ItemPocket.objects.all() serializer_class = ItemPocketDetailSerializer @@ -283,8 +403,14 @@ class ItemPocketResource(PokeapiCommonViewset): @extend_schema( description='Languages for translations of API resource information.', - tags=[ 'utility' ] + summary='Get language', + tags=[ 'utility' ], ) +@extend_schema_view( + list=extend_schema( + summary='List languages', + ) +) class LanguageResource(PokeapiCommonViewset): queryset = Language.objects.all() serializer_class = LanguageDetailSerializer @@ -293,8 +419,14 @@ class LanguageResource(PokeapiCommonViewset): @extend_schema( description='Locations that can be visited within the games. Locations make up sizable portions of regions, like cities or routes.', - tags=[ 'location' ] + summary='Get location', + tags=[ 'location' ], ) +@extend_schema_view( + list=extend_schema( + summary='List locations', + ) +) class LocationResource(PokeapiCommonViewset): queryset = Location.objects.all() serializer_class = LocationDetailSerializer @@ -303,8 +435,14 @@ class LocationResource(PokeapiCommonViewset): @extend_schema( description='Location areas are sections of areas, such as floors in a building or cave. Each area has its own set of possible Pokémon encounters.', - tags=[ 'location' ] + summary='Get location area', + tags=[ 'location' ], ) +@extend_schema_view( + list=extend_schema( + summary='List location areas', + ) +) class LocationAreaResource(ListOrDetailSerialRelation, viewsets.ReadOnlyModelViewSet): queryset = LocationArea.objects.all() serializer_class = LocationAreaDetailSerializer @@ -313,8 +451,14 @@ class LocationAreaResource(ListOrDetailSerialRelation, viewsets.ReadOnlyModelVie @extend_schema( description='Machines are the representation of items that teach moves to Pokémon. They vary from version to version, so it is not certain that one specific TM or HM corresponds to a single Machine.', - tags=[ 'machines' ] + summary='Get machine', + tags=[ 'machines' ], ) +@extend_schema_view( + list=extend_schema( + summary='List machines', + ) +) class MachineResource(PokeapiCommonViewset): queryset = Machine.objects.all() serializer_class = MachineDetailSerializer @@ -323,8 +467,14 @@ class MachineResource(PokeapiCommonViewset): @extend_schema( description='Moves are the skills of Pokémon in battle. In battle, a Pokémon uses one move each turn. Some moves (including those learned by Hidden Machine) can be used outside of battle as well, usually for the purpose of removing obstacles or exploring new areas.', - tags=[ 'moves' ] + summary='Get move', + tags=[ 'moves' ], ) +@extend_schema_view( + list=extend_schema( + summary='List moves', + ) +) class MoveResource(PokeapiCommonViewset): queryset = Move.objects.all() serializer_class = MoveDetailSerializer @@ -333,8 +483,14 @@ class MoveResource(PokeapiCommonViewset): @extend_schema( description='Damage classes moves can have, e.g. physical, special, or non-damaging.', - tags=[ 'pokemon' ] + summary='Get move damage class', + tags=[ 'pokemon' ], ) +@extend_schema_view( + list=extend_schema( + summary='List move damage classes', + ) +) class MoveDamageClassResource(PokeapiCommonViewset): queryset = MoveDamageClass.objects.all() serializer_class = MoveDamageClassDetailSerializer @@ -343,8 +499,14 @@ class MoveDamageClassResource(PokeapiCommonViewset): @extend_schema( description='Move Ailments are status conditions caused by moves used during battle. See [Bulbapedia](https://bulbapedia.bulbagarden.net/wiki/Status_condition) for greater detail.', - tags=[ 'moves' ] + summary='Get move meta ailment', + tags=[ 'moves' ], ) +@extend_schema_view( + list=extend_schema( + summary='List move meta ailments', + ) +) class MoveMetaAilmentResource(PokeapiCommonViewset): queryset = MoveMetaAilment.objects.all() serializer_class = MoveMetaAilmentDetailSerializer @@ -353,8 +515,14 @@ class MoveMetaAilmentResource(PokeapiCommonViewset): @extend_schema( description='Styles of moves when used in the Battle Palace. See [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Battle_Frontier_(Generation_III)) for greater detail.', - tags=[ 'moves' ] + summary='Get move battle style', + tags=[ 'moves' ], ) +@extend_schema_view( + list=extend_schema( + summary='List move battle styles', + ) +) class MoveBattleStyleResource(PokeapiCommonViewset): queryset = MoveBattleStyle.objects.all() serializer_class = MoveBattleStyleDetailSerializer @@ -363,8 +531,14 @@ class MoveBattleStyleResource(PokeapiCommonViewset): @extend_schema( description='Very general categories that loosely group move effects.', - tags=[ 'moves' ] + summary='Get move meta category', + tags=[ 'moves' ], ) +@extend_schema_view( + list=extend_schema( + summary='List move meta categories', + ) +) class MoveMetaCategoryResource(PokeapiCommonViewset): queryset = MoveMetaCategory.objects.all() serializer_class = MoveMetaCategoryDetailSerializer @@ -373,8 +547,14 @@ class MoveMetaCategoryResource(PokeapiCommonViewset): @extend_schema( description='Methods by which Pokémon can learn moves.', - tags=[ 'moves' ] + summary='Get move learn method', + tags=[ 'moves' ], ) +@extend_schema_view( + list=extend_schema( + summary='List move learn methods', + ) +) class MoveLearnMethodResource(PokeapiCommonViewset): queryset = MoveLearnMethod.objects.all() serializer_class = MoveLearnMethodDetailSerializer @@ -383,8 +563,14 @@ class MoveLearnMethodResource(PokeapiCommonViewset): @extend_schema( description='Targets moves can be directed at during battle. Targets can be Pokémon, environments or even other moves.', - tags=[ 'moves' ] + summary='Get move target', + tags=[ 'moves' ], ) +@extend_schema_view( + list=extend_schema( + summary='List move targets', + ) +) class MoveTargetResource(PokeapiCommonViewset): queryset = MoveTarget.objects.all() serializer_class = MoveTargetDetailSerializer @@ -393,8 +579,14 @@ class MoveTargetResource(PokeapiCommonViewset): @extend_schema( description='Natures influence how a Pokémon\'s stats grow. See [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Nature) for greater detail.', - tags=[ 'pokemon' ] + summary='Get nature', + tags=[ 'pokemon' ], ) +@extend_schema_view( + list=extend_schema( + summary='List natures', + ) +) class NatureResource(PokeapiCommonViewset): queryset = Nature.objects.all() serializer_class = NatureDetailSerializer @@ -403,8 +595,14 @@ class NatureResource(PokeapiCommonViewset): @extend_schema( description='Areas used for grouping Pokémon encounters in Pal Park. They\'re like habitats that are specific to Pal Park.', - tags=[ 'location' ] + summary='Get pal park area', + tags=[ 'location' ], ) +@extend_schema_view( + list=extend_schema( + summary='List pal park areas', + ) +) class PalParkAreaResource(PokeapiCommonViewset): queryset = PalParkArea.objects.all() serializer_class = PalParkAreaDetailSerializer @@ -413,8 +611,14 @@ class PalParkAreaResource(PokeapiCommonViewset): @extend_schema( description='Pokeathlon Stats are different attributes of a Pokémon\'s performance in Pokéathlons. In Pokéathlons, competitions happen on different courses; one for each of the different Pokéathlon stats. See [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Pok%C3%A9athlon) for greater detail.', - tags=[ 'pokemon' ] + summary='Get pokeathlon stat', + tags=[ 'pokemon' ], ) +@extend_schema_view( + list=extend_schema( + summary='List pokeathlon stats', + ) +) class PokeathlonStatResource(PokeapiCommonViewset): queryset = PokeathlonStat.objects.all() serializer_class = PokeathlonStatDetailSerializer @@ -423,8 +627,14 @@ class PokeathlonStatResource(PokeapiCommonViewset): @extend_schema( description='A Pokédex is a handheld electronic encyclopedia device; one which is capable of recording and retaining information of the various Pokémon in a given region with the exception of the national dex and some smaller dexes related to portions of a region. See [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Pokedex) for greater detail.', - tags=[ 'games' ] + summary='Get pokedex', + tags=[ 'games' ], ) +@extend_schema_view( + list=extend_schema( + summary='List pokedex', + ) +) class PokedexResource(PokeapiCommonViewset): queryset = Pokedex.objects.all() serializer_class = PokedexDetailSerializer @@ -433,8 +643,14 @@ class PokedexResource(PokeapiCommonViewset): @extend_schema( description='Colors used for sorting Pokémon in a Pokédex. The color listed in the Pokédex is usually the color most apparent or covering each Pokémon\'s body. No orange category exists; Pokémon that are primarily orange are listed as red or brown.', - tags=[ 'pokemon' ] + summary='Get pokemon color', + tags=[ 'pokemon' ], ) +@extend_schema_view( + list=extend_schema( + summary='List pokemon colors', + ) +) class PokemonColorResource(PokeapiCommonViewset): queryset = PokemonColor.objects.all() serializer_class = PokemonColorDetailSerializer @@ -443,8 +659,14 @@ class PokemonColorResource(PokeapiCommonViewset): @extend_schema( description='Some Pokémon may appear in one of multiple, visually different forms. These differences are purely cosmetic. For variations within a Pokémon species, which do differ in more than just visuals, the \'Pokémon\' entity is used to represent such a variety.', - tags=[ 'pokemon' ] + summary='Get pokemon form', + tags=[ 'pokemon' ], ) +@extend_schema_view( + list=extend_schema( + summary='List pokemon forms', + ) +) class PokemonFormResource(PokeapiCommonViewset): queryset = PokemonForm.objects.all() serializer_class = PokemonFormDetailSerializer @@ -453,8 +675,14 @@ class PokemonFormResource(PokeapiCommonViewset): @extend_schema( description='Habitats are generally different terrain Pokémon can be found in but can also be areas designated for rare or legendary Pokémon.', - tags=[ 'pokemon' ] + summary='Get pokemom habita', + tags=[ 'pokemon' ], ) +@extend_schema_view( + list=extend_schema( + summary='List pokemom habitas', + ) +) class PokemonHabitatResource(PokeapiCommonViewset): queryset = PokemonHabitat.objects.all() serializer_class = PokemonHabitatDetailSerializer @@ -463,8 +691,14 @@ class PokemonHabitatResource(PokeapiCommonViewset): @extend_schema( description='Shapes used for sorting Pokémon in a Pokédex.', - tags=[ 'pokemon' ] + summary='Get pokemon shape', + tags=[ 'pokemon' ], ) +@extend_schema_view( + list=extend_schema( + summary='List pokemon shapes', + ) +) class PokemonShapeResource(PokeapiCommonViewset): queryset = PokemonShape.objects.all() serializer_class = PokemonShapeDetailSerializer @@ -473,8 +707,14 @@ class PokemonShapeResource(PokeapiCommonViewset): @extend_schema( description='Pokémon are the creatures that inhabit the world of the Pokémon games. They can be caught using Pokéballs and trained by battling with other Pokémon. Each Pokémon belongs to a specific species but may take on a variant which makes it differ from other Pokémon of the same species, such as base stats, available abilities and typings. See [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Pok%C3%A9mon_(species)) for greater detail.', - tags=[ 'pokemon' ] + summary='Get pokemon', + tags=[ 'pokemon' ], ) +@extend_schema_view( + list=extend_schema( + summary='List pokemon', + ) +) class PokemonResource(PokeapiCommonViewset): queryset = Pokemon.objects.all() serializer_class = PokemonDetailSerializer @@ -483,8 +723,14 @@ class PokemonResource(PokeapiCommonViewset): @extend_schema( description='A Pokémon Species forms the basis for at least one Pokémon. Attributes of a Pokémon species are shared across all varieties of Pokémon within the species. A good example is Wormadam; Wormadam is the species which can be found in three different varieties, Wormadam-Trash, Wormadam-Sandy and Wormadam-Plant.', - tags=[ 'pokemon' ] + summary='Get pokemon spec', + tags=[ 'pokemon' ], ) +@extend_schema_view( + list=extend_schema( + summary='List pokemon specs', + ) +) class PokemonSpeciesResource(PokeapiCommonViewset): queryset = PokemonSpecies.objects.all().order_by("id") serializer_class = PokemonSpeciesDetailSerializer @@ -493,8 +739,14 @@ class PokemonSpeciesResource(PokeapiCommonViewset): @extend_schema( description='A region is an organized area of the Pokémon world. Most often, the main difference between regions is the species of Pokémon that can be encountered within them.', - tags=[ 'location' ] + summary='Get region', + tags=[ 'location' ], ) +@extend_schema_view( + list=extend_schema( + summary='List regions', + ) +) class RegionResource(PokeapiCommonViewset): queryset = Region.objects.all() serializer_class = RegionDetailSerializer @@ -503,8 +755,14 @@ class RegionResource(PokeapiCommonViewset): @extend_schema( description='Stats determine certain aspects of battles. Each Pokémon has a value for each stat which grows as they gain levels and can be altered momentarily by effects in battles.', - tags=[ 'pokemon' ] + summary='Get stat', + tags=[ 'pokemon' ], ) +@extend_schema_view( + list=extend_schema( + summary='List stats', + ) +) class StatResource(PokeapiCommonViewset): queryset = Stat.objects.all() serializer_class = StatDetailSerializer @@ -513,8 +771,14 @@ class StatResource(PokeapiCommonViewset): @extend_schema( description='Super contest effects refer to the effects of moves when used in super contests.', - tags=[ 'contests' ] + summary='Get super contest effect', + tags=[ 'contests' ], ) +@extend_schema_view( + list=extend_schema( + summary='List super contest effects', + ) +) class SuperContestEffectResource(PokeapiCommonViewset): queryset = SuperContestEffect.objects.all() serializer_class = SuperContestEffectDetailSerializer @@ -523,8 +787,14 @@ class SuperContestEffectResource(PokeapiCommonViewset): @extend_schema( description='Types are properties for Pokémon and their moves. Each type has three properties: which types of Pokémon it is super effective against, which types of Pokémon it is not very effective against, and which types of Pokémon it is completely ineffective against.', - tags=[ 'pokemon' ] + summary='List types', + tags=[ 'pokemon' ], ) +@extend_schema_view( + list=extend_schema( + summary='List types', + ) +) class TypeResource(PokeapiCommonViewset): queryset = Type.objects.all() serializer_class = TypeDetailSerializer @@ -533,8 +803,14 @@ class TypeResource(PokeapiCommonViewset): @extend_schema( description='Versions of the games, e.g., Red, Blue or Yellow.', - tags=[ 'games' ] + summary='Get version', + tags=[ 'games' ], ) +@extend_schema_view( + list=extend_schema( + summary='List versions', + ) +) class VersionResource(PokeapiCommonViewset): queryset = Version.objects.all() serializer_class = VersionDetailSerializer @@ -543,8 +819,14 @@ class VersionResource(PokeapiCommonViewset): @extend_schema( description='Version groups categorize highly similar versions of the games.', - tags=[ 'games' ] + summary='Get version group', + tags=[ 'games' ], ) +@extend_schema_view( + list=extend_schema( + summary='List version groups', + ) +) class VersionGroupResource(PokeapiCommonViewset): queryset = VersionGroup.objects.all() serializer_class = VersionGroupDetailSerializer @@ -553,8 +835,14 @@ class VersionGroupResource(PokeapiCommonViewset): @extend_schema( description='Handles Pokemon Encounters as a sub-resource.', - tags=[ 'encounters' ] + summary='Get pokemon encounter', + tags=[ 'encounters' ], ) +@extend_schema_view( + list=extend_schema( + summary='List pokemon encounters', + ) +) class PokemonEncounterView(APIView): def get(self, request, pokemon_id): From 61c4cd084d425a03653aaee22c18d61ebff07ea4 Mon Sep 17 00:00:00 2001 From: indyandie <1058837+Indyandie@users.noreply.github.com> Date: Fri, 1 Mar 2024 03:54:51 -0600 Subject: [PATCH 17/76] fix: resolve drf-spectacular warnings, add schema_field definitions --- openapi.yml | 717 ++++++++++++++++++++++++++++++++++---- pokemon_v2/serializers.py | 712 +++++++++++++++++++++++++++++++++++++ 2 files changed, 1367 insertions(+), 62 deletions(-) diff --git a/openapi.yml b/openapi.yml index d75c2553..5d90c1e3 100644 --- a/openapi.yml +++ b/openapi.yml @@ -2738,7 +2738,7 @@ paths: three properties: which types of Pokémon it is super effective against, which types of Pokémon it is not very effective against, and which types of Pokémon it is completely ineffective against.' - summary: List types + summary: Get types parameters: - in: path name: id @@ -2931,7 +2931,8 @@ components: $ref: '#/components/schemas/AbilityFlavorText' readOnly: true pokemon: - type: string + type: object + additionalProperties: {} readOnly: true required: - effect_changes @@ -3030,7 +3031,31 @@ components: firmness: $ref: '#/components/schemas/BerryFirmnessSummary' flavors: - type: string + type: array + items: + type: object + required: + - potency + - flavor + properties: + potency: + type: integer + example: 10 + flavor: + type: object + require: + - name + - url + properties: + name: + type: string + description: The name of the flavor + example: spicy + url: + type: string + format: uri + description: The URL to get more information about the flavor + example: https://pokeapi.co/api/v2/berry-flavor/1/ readOnly: true item: $ref: '#/components/schemas/ItemSummary' @@ -3107,7 +3132,31 @@ components: type: string maxLength: 100 berries: - type: string + type: array + items: + type: object + required: + - potency + - berry + properties: + potency: + type: integer + example: 10 + berry: + type: object + require: + - name + - url + properties: + name: + type: string + description: The name of the berry + example: rowap + url: + type: string + format: uri + description: The URL to get more information about the berry + example: https://pokeapi.co/api/v2/berry/64/ readOnly: true contest_type: $ref: '#/components/schemas/ContestTypeSummary' @@ -3178,7 +3227,8 @@ components: gene_modulo: type: integer possible_values: - type: string + type: object + additionalProperties: {} readOnly: true highest_stat: $ref: '#/components/schemas/StatSummary' @@ -3329,7 +3379,22 @@ components: $ref: '#/components/schemas/EggGroupName' readOnly: true pokemon_species: - type: string + type: array + items: + type: object + required: + - potency + - flavor + properties: + name: + type: string + description: Pokemon species name. + example: bulbasaur + url: + type: string + format: uri + description: The URL to get more information about the species + example: https://pokeapi.co/api/v2/pokemon-species/1/ readOnly: true required: - id @@ -3510,7 +3575,8 @@ components: baby_trigger_item: $ref: '#/components/schemas/ItemSummary' chain: - type: string + type: object + additionalProperties: {} readOnly: true required: - baby_trigger_item @@ -3540,7 +3606,8 @@ components: $ref: '#/components/schemas/EvolutionTriggerName' readOnly: true pokemon_species: - type: string + type: object + additionalProperties: {} readOnly: true required: - id @@ -3595,10 +3662,12 @@ components: type: string maxLength: 100 pokemon_species_details: - type: string + type: object + additionalProperties: {} readOnly: true required_for_evolution: - type: string + type: object + additionalProperties: {} readOnly: true required: - id @@ -3775,7 +3844,8 @@ components: $ref: '#/components/schemas/ItemAttributeDescription' readOnly: true items: - type: string + type: object + additionalProperties: {} readOnly: true names: type: array @@ -3887,7 +3957,8 @@ components: fling_effect: $ref: '#/components/schemas/ItemFlingEffectSummary' attributes: - type: string + type: object + additionalProperties: {} readOnly: true category: $ref: '#/components/schemas/ItemCategorySummary' @@ -3912,16 +3983,20 @@ components: $ref: '#/components/schemas/ItemName' readOnly: true held_by_pokemon: - type: string + type: object + additionalProperties: {} readOnly: true sprites: - type: string + type: object + additionalProperties: {} readOnly: true baby_trigger_for: - type: string + type: object + additionalProperties: {} readOnly: true machines: - type: string + type: object + additionalProperties: {} readOnly: true required: - attributes @@ -4163,7 +4238,8 @@ components: maximum: 2147483647 minimum: -2147483648 encounter_method_rates: - type: string + type: object + additionalProperties: {} readOnly: true location: $ref: '#/components/schemas/LocationSummary' @@ -4173,7 +4249,8 @@ components: $ref: '#/components/schemas/LocationAreaName' readOnly: true pokemon_encounters: - type: string + type: object + additionalProperties: {} readOnly: true required: - encounter_method_rates @@ -4368,7 +4445,33 @@ components: effect_chance: type: integer effect_entries: - type: string + type: array + items: + type: object + required: + - effect + - short_effect + - language + properties: + effect: + type: string + example: Inflicts [regular damage]{mechanic:regular-damage}. + short_effect: + type: string + example: Inflicts regular damage with no additional effect. + language: + type: object + required: + - name + - url + properties: + name: + type: string + example: en + url: + type: string + format: uri + example: https://pokeapi.co/api/v2/language/9/ readOnly: true type: $ref: '#/components/schemas/TypeSummary' @@ -4479,7 +4582,87 @@ components: maximum: 2147483647 minimum: -2147483648 contest_combos: - type: string + type: object + properties: + required: + - normal + - super + normal: + type: object + required: + - use_before + - use_after + properties: + use_before: + type: array + nullable: true + items: + type: object + required: + - name + - url + properties: + name: + type: string + example: fire-punch + url: + type: string + format: uri + example: https://pokeapi.co/api/v2/move/7/ + use_after: + type: array + nullable: true + items: + type: object + required: + - name + - url + properties: + name: + type: string + example: ice-punch + url: + type: string + format: uri + example: https://pokeapi.co/api/v2/move/8/ + super: + type: object + required: + - use_before + - use_after + properties: + use_before: + type: array + nullable: true + items: + type: object + required: + - name + - url + properties: + name: + type: string + example: night-slash + url: + type: string + format: uri + example: https://pokeapi.co/api/v2/move/400/ + use_after: + type: array + nullable: true + items: + type: object + required: + - name + - url + properties: + name: + type: string + example: focus-energy + url: + type: string + format: uri + example: https://pokeapi.co/api/v2/move/116/ readOnly: true contest_type: $ref: '#/components/schemas/ContestTypeSummary' @@ -4488,10 +4671,79 @@ components: damage_class: $ref: '#/components/schemas/MoveDamageClassSummary' effect_entries: - type: string + type: array + items: + type: object + required: + - effect + - short_effect + - language + properties: + effect: + type: string + example: Inflicts [regular damage]{mechanic:regular-damage}. + short_effect: + type: string + example: Inflicts regular damage with no additional effect. + language: + type: object + required: + - name + - url + properties: + name: + type: string + example: en + url: + type: string + format: uri + example: https://pokeapi.co/api/v2/language/9/ readOnly: true effect_changes: - type: string + type: array + items: + type: object + required: + - effect_entries + - version_group + properties: + effect_entries: + type: array + items: + type: object + required: + - effect + - language + properties: + effect: + type: string + example: Hits Pokémon under the effects of dig and fly. + language: + type: object + required: + - name + - url + properties: + name: + type: string + example: en + url: + type: string + format: uri + example: https://pokeapi.co/api/v2/language/9/ + version_group: + type: object + required: + - name + - url + properties: + name: + type: string + example: gold-silver + url: + type: string + format: uri + example: https://pokeapi.co/api/v2/version-group/3/ readOnly: true generation: $ref: '#/components/schemas/GenerationSummary' @@ -4510,7 +4762,8 @@ components: $ref: '#/components/schemas/MoveChange' readOnly: true stat_changes: - type: string + type: object + additionalProperties: {} readOnly: true super_contest_effect: $ref: '#/components/schemas/SuperContestEffectSummary' @@ -4519,7 +4772,35 @@ components: type: $ref: '#/components/schemas/TypeSummary' machines: - type: string + type: array + items: + type: object + required: + - machine + - version_group + properties: + machine: + type: object + required: + - url + properties: + url: + type: string + format: uri + example: https://pokeapi.co/api/v2/machine/1/ + version_group: + type: object + required: + - name + - url + properties: + name: + type: string + example: sword-shield + url: + type: string + format: uri + example: https://pokeapi.co/api/v2/version-group/1/ readOnly: true flavor_text_entries: type: array @@ -4527,7 +4808,20 @@ components: $ref: '#/components/schemas/MoveFlavorText' readOnly: true learned_by_pokemon: - type: string + type: array + items: + type: object + required: + - name + - url + properties: + name: + type: string + example: clefairy + url: + type: string + format: uri + example: https://pokeapi.co/api/v2/pokemon/35/ readOnly: true required: - contest_combos @@ -4593,7 +4887,8 @@ components: $ref: '#/components/schemas/MoveLearnMethodDescription' readOnly: true version_groups: - type: string + type: object + additionalProperties: {} readOnly: true required: - descriptions @@ -4705,7 +5000,20 @@ components: type: string maxLength: 100 moves: - type: string + type: array + items: + type: object + required: + - name + - url + properties: + name: + type: string + example: thunder-punch + url: + type: string + format: uri + example: https://pokeapi.co/api/v2/move/9/ readOnly: true names: type: array @@ -4766,7 +5074,20 @@ components: $ref: '#/components/schemas/MoveMetaCategoryDescription' readOnly: true moves: - type: string + type: array + items: + type: object + required: + - name + - url + properties: + name: + type: string + example: sing + url: + type: string + format: uri + example: https://pokeapi.co/api/v2/move/47/ readOnly: true required: - descriptions @@ -4914,7 +5235,8 @@ components: $ref: '#/components/schemas/BerrySummary' readOnly: true pokeathlon_stat_changes: - type: string + type: object + additionalProperties: {} readOnly: true move_battle_style_preferences: type: array @@ -5936,7 +6258,8 @@ components: $ref: '#/components/schemas/PalParkAreaName' readOnly: true pokemon_encounters: - type: string + type: object + additionalProperties: {} readOnly: true required: - id @@ -5977,7 +6300,8 @@ components: type: string maxLength: 100 affecting_natures: - type: string + type: object + additionalProperties: {} readOnly: true names: type: array @@ -6045,12 +6369,14 @@ components: $ref: '#/components/schemas/PokedexName' readOnly: true pokemon_entries: - type: string + type: object + additionalProperties: {} readOnly: true region: $ref: '#/components/schemas/RegionSummary' version_groups: - type: string + type: object + additionalProperties: {} readOnly: true required: - descriptions @@ -6168,10 +6494,12 @@ components: maximum: 2147483647 minimum: -2147483648 abilities: - type: string + type: object + additionalProperties: {} readOnly: true past_abilities: - type: string + type: object + additionalProperties: {} readOnly: true forms: type: array @@ -6184,21 +6512,26 @@ components: $ref: '#/components/schemas/PokemonGameIndex' readOnly: true held_items: - type: string + type: object + additionalProperties: {} readOnly: true location_area_encounters: - type: string + type: object + additionalProperties: {} readOnly: true moves: - type: string + type: object + additionalProperties: {} readOnly: true species: $ref: '#/components/schemas/PokemonSpeciesSummary' sprites: - type: string + type: object + additionalProperties: {} readOnly: true cries: - type: string + type: object + additionalProperties: {} readOnly: true stats: type: array @@ -6206,10 +6539,12 @@ components: $ref: '#/components/schemas/PokemonStat' readOnly: true types: - type: string + type: object + additionalProperties: {} readOnly: true past_types: - type: string + type: object + additionalProperties: {} readOnly: true required: - abilities @@ -6270,18 +6605,22 @@ components: pokemon: $ref: '#/components/schemas/PokemonSummary' sprites: - type: string + type: object + additionalProperties: {} readOnly: true version_group: $ref: '#/components/schemas/VersionGroupSummary' form_names: - type: string + type: object + additionalProperties: {} readOnly: true names: - type: string + type: object + additionalProperties: {} readOnly: true types: - type: string + type: object + additionalProperties: {} readOnly: true required: - form_name @@ -6376,10 +6715,12 @@ components: type: string maxLength: 100 awesome_names: - type: string + type: object + additionalProperties: {} readOnly: true names: - type: string + type: object + additionalProperties: {} readOnly: true pokemon_species: type: array @@ -6472,7 +6813,8 @@ components: $ref: '#/components/schemas/PokemonDexEntry' readOnly: true egg_groups: - type: string + type: object + additionalProperties: {} readOnly: true color: $ref: '#/components/schemas/PokemonColorSummary' @@ -6487,10 +6829,12 @@ components: generation: $ref: '#/components/schemas/GenerationSummary' names: - type: string + type: object + additionalProperties: {} readOnly: true pal_park_encounters: - type: string + type: object + additionalProperties: {} readOnly: true form_descriptions: type: array @@ -6503,10 +6847,12 @@ components: $ref: '#/components/schemas/PokemonSpeciesFlavorText' readOnly: true genera: - type: string + type: object + additionalProperties: {} readOnly: true varieties: - type: string + type: object + additionalProperties: {} readOnly: true required: - color @@ -6611,7 +6957,8 @@ components: $ref: '#/components/schemas/PokedexSummary' readOnly: true version_groups: - type: string + type: object + additionalProperties: {} readOnly: true required: - id @@ -6661,10 +7008,12 @@ components: is_battle_only: type: boolean affecting_moves: - type: string + type: object + additionalProperties: {} readOnly: true affecting_natures: - type: string + type: object + additionalProperties: {} readOnly: true characteristics: type: array @@ -6767,10 +7116,227 @@ components: type: string maxLength: 100 damage_relations: - type: string + type: object + required: + - no_damage_to + - half_damage_to + - double_damage_to + - no_damage_from + - half_damage_from + - double_damage_from + properties: + no_damage_to: + type: array + items: + type: object + required: + - name + - url + properties: + name: + type: string + example: flying + url: + type: string + format: uri + example: https://pokeapi.co/api/v2/type/3/ + half_damage_to: + type: array + items: + type: object + required: + - name + - url + properties: + name: + type: string + example: bug + url: + type: string + format: uri + example: https://pokeapi.co/api/v2/type/7/ + double_damage_to: + type: array + items: + type: object + required: + - name + - url + properties: + name: + type: string + example: poison + url: + type: string + format: uri + example: https://pokeapi.co/api/v2/type/4/ + no_damage_from: + type: array + items: + type: object + required: + - name + - url + properties: + name: + type: string + example: electric + url: + type: string + format: uri + example: https://pokeapi.co/api/v2/type/13/ + half_damage_from: + type: array + items: + type: object + required: + - name + - url + properties: + name: + type: string + example: poison + url: + type: string + format: uri + example: https://pokeapi.co/api/v2/type/4/ + double_damage_from: + type: array + items: + type: object + required: + - name + - url + properties: + name: + type: string + example: water + url: + type: string + format: uri + example: https://pokeapi.co/api/v2/type/11/ readOnly: true past_damage_relations: - type: string + type: array + items: + type: object + required: + - generation + - damage_relations + properties: + generation: + type: object + required: + - name + - url + properties: + name: + type: string + example: generation-v + url: + type: string + format: uri + example: https://pokeapi.co/api/v2/generation/5/ + damage_relations: + type: object + required: + - no_damage_to + - half_damage_to + - double_damage_to + - no_damage_from + - half_damage_from + - double_damage_from + properties: + no_damage_to: + type: array + items: + type: object + required: + - name + - url + properties: + name: + type: string + example: flying + url: + type: string + format: uri + example: https://pokeapi.co/api/v2/type/3/ + half_damage_to: + type: array + items: + type: object + required: + - name + - url + properties: + name: + type: string + example: bug + url: + type: string + format: uri + example: https://pokeapi.co/api/v2/type/7/ + double_damage_to: + type: array + items: + type: object + required: + - name + - url + properties: + name: + type: string + example: poison + url: + type: string + format: uri + example: https://pokeapi.co/api/v2/type/4/ + no_damage_from: + type: array + items: + type: object + required: + - name + - url + properties: + name: + type: string + example: electric + url: + type: string + format: uri + example: https://pokeapi.co/api/v2/type/13/ + half_damage_from: + type: array + items: + type: object + required: + - name + - url + properties: + name: + type: string + example: poison + url: + type: string + format: uri + example: https://pokeapi.co/api/v2/type/4/ + double_damage_from: + type: array + items: + type: object + required: + - name + - url + properties: + name: + type: string + example: water + url: + type: string + format: uri + example: https://pokeapi.co/api/v2/type/11/ readOnly: true game_indices: type: array @@ -6787,7 +7353,31 @@ components: $ref: '#/components/schemas/AbilityName' readOnly: true pokemon: - type: string + type: array + items: + type: object + required: + - potency + - flavor + properties: + slot: + type: integer + example: 1 + pokemon: + type: object + require: + - name + - url + properties: + name: + type: string + description: The name of the pokemon + example: sandshrew + url: + type: string + format: uri + description: The URL to get more information about the pokemon + example: https://pokeapi.co/api/v2/pokemon/27/ readOnly: true moves: type: array @@ -6873,13 +7463,16 @@ components: generation: $ref: '#/components/schemas/GenerationSummary' move_learn_methods: - type: string + type: object + additionalProperties: {} readOnly: true pokedexes: - type: string + type: object + additionalProperties: {} readOnly: true regions: - type: string + type: object + additionalProperties: {} readOnly: true versions: type: array diff --git a/pokemon_v2/serializers.py b/pokemon_v2/serializers.py index cef6f6b1..588654fe 100644 --- a/pokemon_v2/serializers.py +++ b/pokemon_v2/serializers.py @@ -2,6 +2,8 @@ from collections import OrderedDict import json from django.urls import reverse from rest_framework import serializers +from drf_spectacular.types import OpenApiTypes +from drf_spectacular.utils import extend_schema_field, extend_schema, OpenApiParameter, OpenApiExample, extend_schema_serializer # pylint: disable=redefined-builtin @@ -477,6 +479,7 @@ class CharacteristicDetailSerializer(serializers.ModelSerializer): "descriptions", ) + @extend_schema_field(OpenApiTypes.OBJECT) def get_values(self, obj): mod = obj.gene_mod_5 values = [] @@ -609,6 +612,7 @@ class RegionDetailSerializer(serializers.ModelSerializer): "version_groups", ) + @extend_schema_field(OpenApiTypes.OBJECT) def get_region_version_groups(self, obj): vg_regions = VersionGroupRegion.objects.filter(region=obj) data = VersionGroupRegionSerializer( @@ -676,6 +680,7 @@ class GenderDetailSerializer(serializers.ModelSerializer): model = Gender fields = ("id", "name", "pokemon_species_details", "required_for_evolution") + @extend_schema_field(OpenApiTypes.OBJECT) def get_species(self, obj): species_objects = [] @@ -698,6 +703,7 @@ class GenderDetailSerializer(serializers.ModelSerializer): return details + @extend_schema_field(OpenApiTypes.OBJECT) def get_required(self, obj): evo_objects = PokemonEvolution.objects.filter(gender=obj) species_list = [] @@ -857,6 +863,7 @@ class EncounterDetailSerializer(serializers.ModelSerializer): "condition_values", ) + @extend_schema_field(OpenApiTypes.OBJECT) def get_encounter_conditions(self, obj): condition_values = EncounterConditionValueMap.objects.filter(encounter=obj) data = EncounterConditionValueMapSerializer( @@ -907,6 +914,7 @@ class LocationAreaDetailSerializer(serializers.ModelSerializer): "pokemon_encounters", ) + @extend_schema_field(OpenApiTypes.OBJECT) def get_method_rates(self, obj): # Get encounters related to this area and pull out unique encounter methods encounter_rates = LocationAreaEncounterRate.objects.filter( @@ -948,6 +956,7 @@ class LocationAreaDetailSerializer(serializers.ModelSerializer): return encounter_rate_list + @extend_schema_field(OpenApiTypes.OBJECT) def get_encounters(self, obj): # get versions for later use version_objects = Version.objects.all() @@ -1119,6 +1128,7 @@ class AbilityDetailSerializer(serializers.ModelSerializer): "pokemon", ) + @extend_schema_field(OpenApiTypes.OBJECT) def get_ability_pokemon(self, obj): pokemon_ability_objects = PokemonAbility.objects.filter(ability=obj) data = PokemonAbilitySerializer( @@ -1169,6 +1179,7 @@ class StatDetailSerializer(serializers.ModelSerializer): "names", ) + @extend_schema_field(OpenApiTypes.OBJECT) def get_moves_that_affect(self, obj): stat_change_objects = MoveMetaStatChange.objects.filter(stat=obj) stat_changes = MoveMetaStatChangeSerializer( @@ -1185,6 +1196,7 @@ class StatDetailSerializer(serializers.ModelSerializer): return changes + @extend_schema_field(OpenApiTypes.OBJECT) def get_natures_that_affect(self, obj): increase_objects = Nature.objects.filter(increased_stat=obj) increases = NatureSummarySerializer( @@ -1279,6 +1291,7 @@ class ItemAttributeDetailSerializer(serializers.ModelSerializer): model = ItemAttribute fields = ("id", "name", "descriptions", "items", "names") + @extend_schema_field(OpenApiTypes.OBJECT) def get_attribute_items(self, obj): item_map_objects = ItemAttributeMap.objects.filter(item_attribute=obj) items = [] @@ -1395,6 +1408,7 @@ class ItemDetailSerializer(serializers.ModelSerializer): "machines", ) + @extend_schema_field(OpenApiTypes.OBJECT) def get_item_machines(self, obj): machine_objects = Machine.objects.filter(item=obj) @@ -1415,10 +1429,12 @@ class ItemDetailSerializer(serializers.ModelSerializer): return machines + @extend_schema_field(OpenApiTypes.OBJECT) def get_item_sprites(self, obj): sprites_object = ItemSprites.objects.get(item_id=obj) return sprites_object.sprites + @extend_schema_field(OpenApiTypes.OBJECT) def get_item_attributes(self, obj): item_attribute_maps = ItemAttributeMap.objects.filter(item=obj) serializer = ItemAttributeMapSerializer( @@ -1436,6 +1452,7 @@ class ItemDetailSerializer(serializers.ModelSerializer): return attributes + @extend_schema_field(OpenApiTypes.OBJECT) def get_held_by_pokemon(self, obj): pokemon_items = PokemonItem.objects.filter(item=obj).order_by("pokemon_id") pokemon_ids = pokemon_items.values("pokemon_id").distinct() @@ -1468,6 +1485,7 @@ class ItemDetailSerializer(serializers.ModelSerializer): return pokemon_list + @extend_schema_field(OpenApiTypes.OBJECT) def get_baby_trigger_for(self, obj): try: chain_object = EvolutionChain.objects.get(baby_trigger_item=obj) @@ -1532,6 +1550,7 @@ class NatureDetailSerializer(serializers.ModelSerializer): "names", ) + @extend_schema_field(OpenApiTypes.OBJECT) def get_pokeathlon_stats(self, obj): pokeathlon_stat_objects = NaturePokeathlonStat.objects.filter(nature=obj) pokeathlon_stats = NaturePokeathlonStatSerializer( @@ -1587,6 +1606,35 @@ class BerryFlavorDetailSerializer(serializers.ModelSerializer): model = BerryFlavor fields = ("id", "name", "berries", "contest_type", "names") + @extend_schema_field(field={'type': 'array', + 'items': { + 'type': 'object', + 'required': [ 'potency', 'berry' ], + 'properties': { + 'potency': { + 'type': 'integer', + 'example': 10 + }, + 'berry': { + 'type': 'object', + 'require': [ 'name', 'url' ], + 'properties': { + 'name': { + 'type': 'string', + 'description': 'The name of the berry', + 'example': 'rowap' + }, + 'url': { + 'type': 'string', + 'format': 'uri', + 'description': 'The URL to get more information about the berry', + 'example': 'https://pokeapi.co/api/v2/berry/64/' + } + } + } + } + }, + }) def get_berries_with_flavor(self, obj): flavor_map_objects = BerryFlavorMap.objects.filter( berry_flavor=obj, potency__gt=0 @@ -1624,6 +1672,35 @@ class BerryDetailSerializer(serializers.ModelSerializer): "natural_gift_type", ) + @extend_schema_field(field={'type': 'array', + 'items': { + 'type': 'object', + 'required': [ 'potency', 'flavor' ], + 'properties': { + 'potency': { + 'type': 'integer', + 'example': 10 + }, + 'flavor': { + 'type': 'object', + 'require': [ 'name', 'url' ], + 'properties': { + 'name': { + 'type': 'string', + 'description': 'The name of the flavor', + 'example': 'spicy' + }, + 'url': { + 'type': 'string', + 'format': 'uri', + 'description': 'The URL to get more information about the flavor', + 'example': 'https://pokeapi.co/api/v2/berry-flavor/1/' + } + } + } + } + }, + }) def get_berry_flavors(self, obj): flavor_map_objects = BerryFlavorMap.objects.filter(berry=obj) flavor_maps = BerryFlavorMapSerializer( @@ -1666,6 +1743,25 @@ class EggGroupDetailSerializer(serializers.ModelSerializer): model = EggGroup fields = ("id", "name", "names", "pokemon_species") + @extend_schema_field(field={'type': 'array', + 'items': { + 'type': 'object', + 'required': [ 'potency', 'flavor' ], + 'properties': { + 'name': { + 'type': 'string', + 'description': 'Pokemon species name.', + 'example': 'bulbasaur' + }, + 'url': { + 'type': 'string', + 'format': 'uri', + 'description': 'The URL to get more information about the species', + 'example': 'https://pokeapi.co/api/v2/pokemon-species/1/' + }, + } + }, + }) def get_species(self, obj): results = PokemonEggGroup.objects.filter(egg_group=obj) data = PokemonEggGroupSerializer(results, many=True, context=self.context).data @@ -1745,6 +1841,7 @@ class TypeDetailSerializer(serializers.ModelSerializer): # adds an entry for the given type with the given damage # factor in the given direction to the set of relations + def add_type_entry(self, relations, type, damage_factor, direction="_damage_to"): if damage_factor == 200: relations["double" + direction].append( @@ -1759,6 +1856,126 @@ class TypeDetailSerializer(serializers.ModelSerializer): TypeSummarySerializer(type, context=self.context).data ) + @extend_schema_field(field={'type': 'object', + 'required': [ + 'no_damage_to', + 'half_damage_to', + 'double_damage_to', + 'no_damage_from', + 'half_damage_from', + 'double_damage_from' + ], + 'properties': { + 'no_damage_to': { + 'type': 'array', + 'items': { + 'type': 'object', + 'required': [ 'name', 'url' ], + 'properties': { + 'name': { + 'type': 'string', + 'example': 'flying' + }, + 'url': { + 'type': 'string', + 'format': 'uri', + 'example': 'https://pokeapi.co/api/v2/type/3/' + } + } + } + }, + 'half_damage_to': { + 'type': 'array', + 'items': { + 'type': 'object', + 'required': [ 'name', 'url' ], + 'properties': { + 'name': { + 'type': 'string', + 'example': 'bug' + }, + 'url': { + 'type': 'string', + 'format': 'uri', + 'example': 'https://pokeapi.co/api/v2/type/7/' + } + } + } + }, + 'double_damage_to': { + 'type': 'array', + 'items': { + 'type': 'object', + 'required': [ 'name', 'url' ], + 'properties': { + 'name': { + 'type': 'string', + 'example': 'poison' + }, + 'url': { + 'type': 'string', + 'format': 'uri', + 'example': 'https://pokeapi.co/api/v2/type/4/' + } + } + } + }, + 'no_damage_from': { + 'type': 'array', + 'items': { + 'type': 'object', + 'required': [ 'name', 'url' ], + 'properties': { + 'name': { + 'type': 'string', + 'example': 'electric' + }, + 'url': { + 'type': 'string', + 'format': 'uri', + 'example': 'https://pokeapi.co/api/v2/type/13/' + } + } + } + }, + 'half_damage_from': { + 'type': 'array', + 'items': { + 'type': 'object', + 'required': [ 'name', 'url' ], + 'properties': { + 'name': { + 'type': 'string', + 'example': 'poison' + }, + 'url': { + 'type': 'string', + 'format': 'uri', + 'example': 'https://pokeapi.co/api/v2/type/4/' + } + } + } + }, + 'double_damage_from': { + 'type': 'array', + 'items': { + 'type': 'object', + 'required': [ 'name', 'url' ], + 'properties': { + 'name': { + 'type': 'string', + 'example': 'water' + }, + 'url': { + 'type': 'string', + 'format': 'uri', + 'example': 'https://pokeapi.co/api/v2/type/11/' + } + } + } + } + } + }) def get_type_relationships(self, obj): relations = OrderedDict() relations["no_damage_to"] = [] @@ -1823,6 +2040,150 @@ class TypeDetailSerializer(serializers.ModelSerializer): return # returns past type relationships for the given type object + @extend_schema_field(field={'type': 'array', + 'items': { + 'type': 'object', + 'required': [ 'generation', 'damage_relations' ], + 'properties': { + 'generation': { + 'type': 'object', + 'required': [ 'name', 'url' ], + 'properties': { + 'name': { + 'type': 'string', + 'example': 'generation-v' + }, + 'url': { + 'type': 'string', + 'format': 'uri', + 'example': 'https://pokeapi.co/api/v2/generation/5/' + } + } + }, + 'damage_relations': { + 'type': 'object', + 'required': [ + 'no_damage_to', + 'half_damage_to', + 'double_damage_to', + 'no_damage_from', + 'half_damage_from', + 'double_damage_from' + ], + 'properties': { + 'no_damage_to': { + 'type': 'array', + 'items': { + 'type': 'object', + 'required': [ 'name', 'url' ], + 'properties': { + 'name': { + 'type': 'string', + 'example': 'flying' + }, + 'url': { + 'type': 'string', + 'format': 'uri', + 'example': 'https://pokeapi.co/api/v2/type/3/' + } + } + } + }, + 'half_damage_to': { + 'type': 'array', + 'items': { + 'type': 'object', + 'required': [ 'name', 'url' ], + 'properties': { + 'name': { + 'type': 'string', + 'example': 'bug' + }, + 'url': { + 'type': 'string', + 'format': 'uri', + 'example': 'https://pokeapi.co/api/v2/type/7/' + } + } + } + }, + 'double_damage_to': { + 'type': 'array', + 'items': { + 'type': 'object', + 'required': [ 'name', 'url' ], + 'properties': { + 'name': { + 'type': 'string', + 'example': 'poison' + }, + 'url': { + 'type': 'string', + 'format': 'uri', + 'example': 'https://pokeapi.co/api/v2/type/4/' + } + } + } + }, + 'no_damage_from': { + 'type': 'array', + 'items': { + 'type': 'object', + 'required': [ 'name', 'url' ], + 'properties': { + 'name': { + 'type': 'string', + 'example': 'electric' + }, + 'url': { + 'type': 'string', + 'format': 'uri', + 'example': 'https://pokeapi.co/api/v2/type/13/' + } + } + } + }, + 'half_damage_from': { + 'type': 'array', + 'items': { + 'type': 'object', + 'required': [ 'name', 'url' ], + 'properties': { + 'name': { + 'type': 'string', + 'example': 'poison' + }, + 'url': { + 'type': 'string', + 'format': 'uri', + 'example': 'https://pokeapi.co/api/v2/type/4/' + } + } + } + }, + 'double_damage_from': { + 'type': 'array', + 'items': { + 'type': 'object', + 'required': [ 'name', 'url' ], + 'properties': { + 'name': { + 'type': 'string', + 'example': 'water' + }, + 'url': { + 'type': 'string', + 'format': 'uri', + 'example': 'https://pokeapi.co/api/v2/type/11/' + } + } + } + } + } + } + } + }, + }) def get_type_past_relationships(self, obj): # collect data from DB damage_type_results = list(TypeEfficacyPast.objects.filter(damage_type=obj)) @@ -1917,6 +2278,35 @@ class TypeDetailSerializer(serializers.ModelSerializer): gen_introduced = Generation.objects.get(pk=type_obj.generation.id) return gen_introduced.id <= current_gen.id + @extend_schema_field(field={'type': 'array', + 'items': { + 'type': 'object', + 'required': [ 'potency', 'flavor' ], + 'properties': { + 'slot': { + 'type': 'integer', + 'example': 1 + }, + 'pokemon': { + 'type': 'object', + 'require': [ 'name', 'url' ], + 'properties': { + 'name': { + 'type': 'string', + 'description': 'The name of the pokemon', + 'example': 'sandshrew' + }, + 'url': { + 'type': 'string', + 'format': 'uri', + 'description': 'The URL to get more information about the pokemon', + 'example': 'https://pokeapi.co/api/v2/pokemon/27/' + } + } + } + } + }, + }) def get_type_pokemon(self, obj): poke_type_objects = PokemonType.objects.filter(type=obj) poke_types = PokemonTypeSerializer( @@ -2023,6 +2413,23 @@ class MoveMetaAilmentDetailSerializer(serializers.ModelSerializer): model = MoveMetaAilment fields = ("id", "name", "moves", "names") + @extend_schema_field(field={'type': 'array', + 'items': { + 'type': 'object', + 'required': [ 'name', 'url' ], + 'properties': { + 'name': { + 'type': 'string', + 'example': 'thunder-punch' + }, + 'url': { + 'type': 'string', + 'format': 'uri', + 'example': 'https://pokeapi.co/api/v2/move/9/' + } + } + }, + }) def get_ailment_moves(self, obj): move_meta_objects = MoveMeta.objects.filter(move_meta_ailment=obj) moves = [] @@ -2053,6 +2460,23 @@ class MoveMetaCategoryDetailSerializer(serializers.ModelSerializer): model = MoveMetaCategory fields = ("id", "name", "descriptions", "moves") + @extend_schema_field(field={'type': 'array', + 'items': { + 'type': 'object', + 'required': [ 'name', 'url' ], + 'properties': { + 'name': { + 'type': 'string', + 'example': 'sing' + }, + 'url': { + 'type': 'string', + 'format': 'uri', + 'example': 'https://pokeapi.co/api/v2/move/47/' + } + } + }, + }) def get_category_moves(self, obj): move_meta_objects = MoveMeta.objects.filter(move_meta_category=obj) moves = [] @@ -2147,6 +2571,37 @@ class MoveChangeSerializer(serializers.ModelSerializer): "version_group", ) + @extend_schema_field(field={'type': 'array', + 'items': { + 'type': 'object', + 'required': [ 'effect', 'short_effect', 'language' ], + 'properties': { + 'effect': { + 'type': 'string', + 'example': 'Inflicts [regular damage]{mechanic:regular-damage}.' + }, + 'short_effect': { + 'type': 'string', + 'example': 'Inflicts regular damage with no additional effect.' + }, + 'language': { + 'type': 'object', + 'required': [ 'name', 'url' ], + 'properties': { + 'name': { + 'type': 'string', + 'example': 'en' + }, + 'url': { + 'type': 'string', + 'format': 'uri', + 'example': 'https://pokeapi.co/api/v2/language/9/' + } + } + } + }, + }, + }) def get_effects(self, obj): effect_texts = MoveEffectEffectText.objects.filter(move_effect=obj.move_effect) data = MoveEffectEffectTextSerializer( @@ -2244,6 +2699,23 @@ class MoveDetailSerializer(serializers.ModelSerializer): "learned_by_pokemon", ) + @extend_schema_field(field={'type': 'array', + 'items': { + 'type': 'object', + 'required': [ 'name', 'url' ], + 'properties': { + 'name': { + 'type': 'string', + 'example': 'clefairy' + }, + 'url': { + 'type': 'string', + 'format': 'uri', + 'example': 'https://pokeapi.co/api/v2/pokemon/35/' + } + } + }, + }) def get_learned_by_pokemon(self, obj): pokemon_moves = PokemonMove.objects.filter(move_id=obj).order_by("pokemon_id") @@ -2261,6 +2733,40 @@ class MoveDetailSerializer(serializers.ModelSerializer): return pokemon_list + @extend_schema_field(field={'type': 'array', + 'items': { + 'type': 'object', + 'required': [ 'machine', 'version_group' ], + 'properties': { + 'machine': { + 'type': 'object', + 'required': [ 'url' ], + 'properties': { + 'url': { + 'type': 'string', + 'format': 'uri', + 'example': 'https://pokeapi.co/api/v2/machine/1/' + } + } + }, + 'version_group': { + 'type': 'object', + 'required': [ 'name', 'url' ], + 'properties': { + 'name': { + 'type': 'string', + 'example': 'sword-shield' + }, + 'url': { + 'type': 'string', + 'format': 'uri', + 'example': 'https://pokeapi.co/api/v2/version-group/1/' + } + } + } + } + }, + }) def get_move_machines(self, obj): machine_objects = Machine.objects.filter(move=obj) @@ -2281,6 +2787,99 @@ class MoveDetailSerializer(serializers.ModelSerializer): return machines + @extend_schema_field(field={'type': 'object', + 'properties': { + 'required': [ 'normal', 'super' ], + 'normal': { + 'type': 'object', + 'required': [ 'use_before', 'use_after' ], + 'properties': { + 'use_before': { + 'type': 'array', + 'nullable': True, + 'items': { + 'type': 'object', + 'required': [ 'name', 'url' ], + 'properties': { + 'name': { + 'type': 'string', + 'example': 'fire-punch' + }, + 'url': { + 'type': 'string', + 'format': 'uri', + 'example': 'https://pokeapi.co/api/v2/move/7/' + } + } + } + }, + 'use_after': { + 'type': 'array', + 'nullable': True, + 'items': { + 'type': 'object', + 'required': [ 'name', 'url' ], + 'properties': { + 'name': { + 'type': 'string', + 'example': 'ice-punch' + }, + 'url': { + 'type': 'string', + 'format': 'uri', + 'example': 'https://pokeapi.co/api/v2/move/8/' + } + } + } + } + } + }, + 'super': { + 'type': 'object', + 'required': [ 'use_before', 'use_after' ], + 'properties': { + 'use_before': { + 'type': 'array', + 'nullable': True, + 'items': { + 'type': 'object', + 'required': [ 'name', 'url' ], + 'properties': { + 'name': { + 'type': 'string', + 'example': 'night-slash' + }, + 'url': { + 'type': 'string', + 'format': 'uri', + 'example': 'https://pokeapi.co/api/v2/move/400/' + } + } + } + }, + 'use_after': { + 'type': 'array', + 'nullable': True, + 'items': { + 'type': 'object', + 'required': [ 'name', 'url' ], + 'properties': { + 'name': { + 'type': 'string', + 'example': 'focus-energy' + }, + 'url': { + 'type': 'string', + 'format': 'uri', + 'example': 'https://pokeapi.co/api/v2/move/116/' + } + } + } + } + } + }, + }, + }) def get_combos(self, obj): normal_before_objects = ContestCombo.objects.filter(first_move=obj) normal_before_data = ContestComboSerializer( @@ -2338,6 +2937,37 @@ class MoveDetailSerializer(serializers.ModelSerializer): return details + @extend_schema_field(field={'type': 'array', + 'items': { + 'type': 'object', + 'required': [ 'effect', 'short_effect', 'language' ], + 'properties': { + 'effect': { + 'type': 'string', + 'example': 'Inflicts [regular damage]{mechanic:regular-damage}.' + }, + 'short_effect': { + 'type': 'string', + 'example': 'Inflicts regular damage with no additional effect.' + }, + 'language': { + 'type': 'object', + 'required': [ 'name', 'url' ], + 'properties': { + 'name': { + 'type': 'string', + 'example': 'en' + }, + 'url': { + 'type': 'string', + 'format': 'uri', + 'example': 'https://pokeapi.co/api/v2/language/9/' + } + } + } + }, + }, + }) def get_effect_text(self, obj): effect_texts = MoveEffectEffectText.objects.filter(move_effect=obj.move_effect) data = MoveEffectEffectTextSerializer( @@ -2352,6 +2982,57 @@ class MoveDetailSerializer(serializers.ModelSerializer): return data + @extend_schema_field(field={'type': 'array', + 'items': { + 'type': 'object', + 'required': [ 'effect_entries', 'version_group' ], + 'properties': { + 'effect_entries': { + 'type': 'array', + 'items': { + 'type': 'object', + 'required': [ 'effect', 'language' ], + 'properties': { + 'effect': { + 'type': 'string', + 'example': 'Hits Pokémon under the effects of dig and fly.' + }, + 'language': { + 'type': 'object', + 'required': [ 'name', 'url' ], + 'properties': { + 'name': { + 'type': 'string', + 'example': 'en' + }, + 'url': { + 'type': 'string', + 'format': 'uri', + 'example': 'https://pokeapi.co/api/v2/language/9/' + } + } + } + } + } + }, + 'version_group': { + 'type': 'object', + 'required': [ 'name', 'url' ], + 'properties': { + 'name': { + 'type': 'string', + 'example': 'gold-silver' + }, + 'url': { + 'type': 'string', + 'format': 'uri', + 'example': 'https://pokeapi.co/api/v2/version-group/3/' + } + } + } + } + } + }) def get_effect_change_text(self, obj): effect_changes = MoveEffectChange.objects.filter(move_effect=obj.move_effect) data = MoveEffectChangeSerializer( @@ -2360,6 +3041,7 @@ class MoveDetailSerializer(serializers.ModelSerializer): return data + @extend_schema_field(OpenApiTypes.OBJECT) def get_move_stat_change(self, obj): stat_change_objects = MoveMetaStatChange.objects.filter(move=obj) stat_changes = MoveMetaStatChangeSerializer( @@ -2404,6 +3086,7 @@ class PalParkAreaDetailSerializer(serializers.ModelSerializer): model = PalParkArea fields = ("id", "name", "names", "pokemon_encounters") + @extend_schema_field(OpenApiTypes.OBJECT) def get_encounters(self, obj): pal_park_objects = PalPark.objects.filter(pal_park_area=obj) parks = PalParkSerializer( @@ -2488,6 +3171,7 @@ class PokemonFormDetailSerializer(serializers.ModelSerializer): "types", ) + @extend_schema_field(OpenApiTypes.OBJECT) def get_pokemon_form_names(self, obj): form_results = PokemonFormName.objects.filter( pokemon_form=obj, name__regex=".+" @@ -2503,6 +3187,7 @@ class PokemonFormDetailSerializer(serializers.ModelSerializer): return data + @extend_schema_field(OpenApiTypes.OBJECT) def get_pokemon_form_pokemon_names(self, obj): form_results = PokemonFormName.objects.filter( pokemon_form=obj, pokemon_name__regex=".+" @@ -2519,10 +3204,12 @@ class PokemonFormDetailSerializer(serializers.ModelSerializer): return data + @extend_schema_field(OpenApiTypes.OBJECT) def get_pokemon_form_sprites(self, obj): sprites_object = PokemonFormSprites.objects.get(pokemon_form_id=obj) return sprites_object.sprites + @extend_schema_field(OpenApiTypes.OBJECT) def get_pokemon_form_types(self, obj): form_type_objects = PokemonFormType.objects.filter(pokemon_form=obj) form_types = PokemonFormTypeSerializer( @@ -2606,6 +3293,7 @@ class MoveLearnMethodDetailSerializer(serializers.ModelSerializer): model = MoveLearnMethod fields = ("id", "name", "names", "descriptions", "version_groups") + @extend_schema_field(OpenApiTypes.OBJECT) def get_method_version_groups(self, obj): version_group_objects = VersionGroupMoveLearnMethod.objects.filter( move_learn_method=obj @@ -2650,6 +3338,7 @@ class PokemonShapeDetailSerializer(serializers.ModelSerializer): model = PokemonShape fields = ("id", "name", "awesome_names", "names", "pokemon_species") + @extend_schema_field(OpenApiTypes.OBJECT) def get_shape_names(self, obj): results = PokemonShapeName.objects.filter(pokemon_shape_id=obj) serializer = PokemonShapeNameSerializer( @@ -2662,6 +3351,7 @@ class PokemonShapeDetailSerializer(serializers.ModelSerializer): return data + @extend_schema_field(OpenApiTypes.OBJECT) def get_shape_awesome_names(self, obj): results = PokemonShapeName.objects.filter(pokemon_shape_id=obj) serializer = PokemonShapeNameSerializer( @@ -2755,14 +3445,17 @@ class PokemonDetailSerializer(serializers.ModelSerializer): "past_types", ) + @extend_schema_field(OpenApiTypes.OBJECT) def get_pokemon_sprites(self, obj): sprites_object = PokemonSprites.objects.get(pokemon_id=obj) return sprites_object.sprites + @extend_schema_field(OpenApiTypes.OBJECT) def get_pokemon_cries(self, obj): cries_object = PokemonCries.objects.get(pokemon_id=obj) return cries_object.cries + @extend_schema_field(OpenApiTypes.OBJECT) def get_pokemon_moves(self, obj): version_objects = VersionGroup.objects.all() version_data = VersionGroupSummarySerializer( @@ -2814,6 +3507,7 @@ class PokemonDetailSerializer(serializers.ModelSerializer): return move_list + @extend_schema_field(OpenApiTypes.OBJECT) def get_pokemon_held_items(self, obj): # Get items related to this pokemon and pull out unique Item IDs pokemon_items = PokemonItem.objects.filter(pokemon_id=obj).order_by("item_id") @@ -2847,6 +3541,7 @@ class PokemonDetailSerializer(serializers.ModelSerializer): return item_list + @extend_schema_field(OpenApiTypes.OBJECT) def get_pokemon_abilities(self, obj): pokemon_ability_objects = PokemonAbility.objects.filter(pokemon=obj) data = PokemonAbilitySerializer( @@ -2860,6 +3555,7 @@ class PokemonDetailSerializer(serializers.ModelSerializer): return abilities + @extend_schema_field(OpenApiTypes.OBJECT) def get_past_pokemon_abilities(self, obj): pokemon_past_ability_objects = PokemonAbilityPast.objects.filter(pokemon=obj) pokemon_past_abilities = PokemonAbilityPastSerializer( @@ -2895,6 +3591,7 @@ class PokemonDetailSerializer(serializers.ModelSerializer): return final_data + @extend_schema_field(OpenApiTypes.OBJECT) def get_pokemon_types(self, obj): poke_type_objects = PokemonType.objects.filter(pokemon=obj) poke_types = PokemonTypeSerializer( @@ -2906,6 +3603,7 @@ class PokemonDetailSerializer(serializers.ModelSerializer): return poke_types + @extend_schema_field(OpenApiTypes.OBJECT) def get_past_pokemon_types(self, obj): poke_past_type_objects = PokemonTypePast.objects.filter(pokemon=obj) poke_past_types = PokemonTypePastSerializer( @@ -2941,6 +3639,7 @@ class PokemonDetailSerializer(serializers.ModelSerializer): return final_data + @extend_schema_field(OpenApiTypes.OBJECT) def get_encounters(self, obj): return reverse("pokemon_encounters", kwargs={"pokemon_id": obj.pk}) @@ -2966,6 +3665,7 @@ class EvolutionTriggerDetailSerializer(serializers.HyperlinkedModelSerializer): model = EvolutionTrigger fields = ("id", "name", "names", "pokemon_species") + @extend_schema_field(OpenApiTypes.OBJECT) def get_species(self, obj): evo_objects = PokemonEvolution.objects.filter(evolution_trigger=obj) species_list = [] @@ -3073,6 +3773,7 @@ class PokemonSpeciesDetailSerializer(serializers.ModelSerializer): "varieties", ) + @extend_schema_field(OpenApiTypes.OBJECT) def get_pokemon_names(self, obj): species_results = PokemonSpeciesName.objects.filter(pokemon_species=obj) species_serializer = PokemonSpeciesNameSerializer( @@ -3086,6 +3787,7 @@ class PokemonSpeciesDetailSerializer(serializers.ModelSerializer): return data + @extend_schema_field(OpenApiTypes.OBJECT) def get_pokemon_genera(self, obj): results = PokemonSpeciesName.objects.filter(pokemon_species=obj) serializer = PokemonSpeciesNameSerializer( @@ -3101,6 +3803,7 @@ class PokemonSpeciesDetailSerializer(serializers.ModelSerializer): return genera + @extend_schema_field(OpenApiTypes.OBJECT) def get_pokemon_egg_groups(self, obj): results = PokemonEggGroup.objects.filter(pokemon_species=obj) data = PokemonEggGroupSerializer(results, many=True, context=self.context).data @@ -3110,6 +3813,7 @@ class PokemonSpeciesDetailSerializer(serializers.ModelSerializer): return groups + @extend_schema_field(OpenApiTypes.OBJECT) def get_pokemon_varieties(self, obj): results = Pokemon.objects.filter(pokemon_species=obj) summary_data = PokemonSummarySerializer( @@ -3129,6 +3833,7 @@ class PokemonSpeciesDetailSerializer(serializers.ModelSerializer): return varieties + @extend_schema_field(OpenApiTypes.OBJECT) def get_encounters(self, obj): pal_park_objects = PalPark.objects.filter(pokemon_species=obj) parks = PalParkSerializer( @@ -3186,6 +3891,7 @@ class EvolutionChainDetailSerializer(serializers.ModelSerializer): model = EvolutionChain fields = ("id", "baby_trigger_item", "chain") + @extend_schema_field(OpenApiTypes.OBJECT) def build_chain(self, obj): chain_id = obj.id @@ -3298,6 +4004,7 @@ class PokeathlonStatDetailSerializer(serializers.HyperlinkedModelSerializer): model = PokeathlonStat fields = ("id", "name", "affecting_natures", "names") + @extend_schema_field(OpenApiTypes.OBJECT) def get_natures_that_affect(self, obj): stat_change_objects = NaturePokeathlonStat.objects.filter(pokeathlon_stat=obj) stat_changes = NaturePokeathlonStatSerializer( @@ -3356,6 +4063,7 @@ class PokedexDetailSerializer(serializers.ModelSerializer): "version_groups", ) + @extend_schema_field(OpenApiTypes.OBJECT) def get_pokedex_entries(self, obj): results = PokemonDexNumber.objects.filter(pokedex=obj).order_by( "pokedex_number" @@ -3370,6 +4078,7 @@ class PokedexDetailSerializer(serializers.ModelSerializer): return data + @extend_schema_field(OpenApiTypes.OBJECT) def get_pokedex_version_groups(self, obj): dex_group_objects = PokedexVersionGroup.objects.filter(pokedex=obj) dex_groups = PokedexVersionGroupSerializer( @@ -3429,6 +4138,7 @@ class VersionGroupDetailSerializer(serializers.ModelSerializer): "versions", ) + @extend_schema_field(OpenApiTypes.OBJECT) def get_version_group_regions(self, obj): vg_regions = VersionGroupRegion.objects.filter(version_group=obj) data = VersionGroupRegionSerializer( @@ -3441,6 +4151,7 @@ class VersionGroupDetailSerializer(serializers.ModelSerializer): return regions + @extend_schema_field(OpenApiTypes.OBJECT) def get_learn_methods(self, obj): learn_method_objects = VersionGroupMoveLearnMethod.objects.filter( version_group=obj @@ -3455,6 +4166,7 @@ class VersionGroupDetailSerializer(serializers.ModelSerializer): return methods + @extend_schema_field(OpenApiTypes.OBJECT) def get_version_groups_pokedexes(self, obj): dex_group_objects = PokedexVersionGroup.objects.filter(version_group=obj) dex_groups = PokedexVersionGroupSerializer( From 5ee7cdd312eb1cf70a6f7ae5f3aed61d766e52df Mon Sep 17 00:00:00 2001 From: indyandie <1058837+Indyandie@users.noreply.github.com> Date: Fri, 1 Mar 2024 03:57:22 -0600 Subject: [PATCH 18/76] docs: update summary --- pokemon_v2/api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pokemon_v2/api.py b/pokemon_v2/api.py index 1737680a..518985e5 100644 --- a/pokemon_v2/api.py +++ b/pokemon_v2/api.py @@ -787,7 +787,7 @@ class SuperContestEffectResource(PokeapiCommonViewset): @extend_schema( description='Types are properties for Pokémon and their moves. Each type has three properties: which types of Pokémon it is super effective against, which types of Pokémon it is not very effective against, and which types of Pokémon it is completely ineffective against.', - summary='List types', + summary='Get types', tags=[ 'pokemon' ], ) @extend_schema_view( From adc66c097bcad9a33288c691467a1cef1a4ad63e Mon Sep 17 00:00:00 2001 From: indyandie <1058837+Indyandie@users.noreply.github.com> Date: Sat, 2 Mar 2024 02:51:42 -0600 Subject: [PATCH 19/76] fix: add schema_field definitions --- openapi.yml | 324 +++++++++++++++++++++++++++++++-- pokemon_v2/serializers.py | 365 +++++++++++++++++++++++++++++++++++++- 2 files changed, 665 insertions(+), 24 deletions(-) diff --git a/openapi.yml b/openapi.yml index 5d90c1e3..38cf8b79 100644 --- a/openapi.yml +++ b/openapi.yml @@ -2931,8 +2931,33 @@ components: $ref: '#/components/schemas/AbilityFlavorText' readOnly: true pokemon: - type: object - additionalProperties: {} + type: array + items: + type: object + required: + - is_hidden + - slot + - pokemon + properties: + is_hidden: + type: boolean + example: true + slot: + type: number + example: 3 + pokemon: + type: object + required: + - name + - url + properties: + name: + type: string + example: gloom + url: + type: string + format: uri + example: https://pokeapi.co/api/v2/pokemon/44/ readOnly: true required: - effect_changes @@ -3227,8 +3252,17 @@ components: gene_modulo: type: integer possible_values: - type: object - additionalProperties: {} + type: array + items: + type: number + example: + - 0 + - 5 + - 10 + - 15 + - 20 + - 25 + - 30 readOnly: true highest_stat: $ref: '#/components/schemas/StatSummary' @@ -3662,12 +3696,45 @@ components: type: string maxLength: 100 pokemon_species_details: - type: object - additionalProperties: {} + type: array + items: + type: object + required: + - rate + - pokemon_species + properties: + rate: + type: number + example: 1 + pokemon_species: + type: object + required: + - name + - url + properties: + name: + type: string + example: bulbasaur + url: + type: string + format: uri + example: https://pokeapi.co/api/v2/pokemon-species/1/ readOnly: true required_for_evolution: - type: object - additionalProperties: {} + type: array + items: + type: object + required: + - name + - url + properties: + name: + type: string + example: wormadam + url: + type: string + format: uri + example: https://pokeapi.co/api/v2/pokemon-species/413/ readOnly: true required: - id @@ -4238,8 +4305,50 @@ components: maximum: 2147483647 minimum: -2147483648 encounter_method_rates: - type: object - additionalProperties: {} + type: array + items: + type: object + required: + - encounter_method + - version_details + properties: + encounter_method: + type: object + required: + - name + - url + properties: + name: + type: string + example: old-rod + url: + type: string + format: uri + example: https://pokeapi.co/api/v2/encounter-method/2/ + version_details: + type: array + items: + type: object + required: + - rate + - version + properties: + rate: + type: number + example: 5 + version: + type: object + required: + - name + - url + properties: + name: + type: string + example: platinum + url: + type: string + format: uri + example: https://pokeapi.co/api/v2/version/14/ readOnly: true location: $ref: '#/components/schemas/LocationSummary' @@ -4249,8 +4358,95 @@ components: $ref: '#/components/schemas/LocationAreaName' readOnly: true pokemon_encounters: - type: object - additionalProperties: {} + type: array + items: + type: object + required: + - pokemon + - version_details + properties: + pokemon: + type: object + required: + - name + - url + properties: + name: + type: string + example: tentacool + url: + type: string + format: uri + example: ttps://pokeapi.co/api/v2/pokemon/72/ + version_details: + type: array + items: + type: object + required: + - version + - max_chance + - encounter_details + properties: + version: + type: object + required: + - name + - url + properties: + name: + type: string + example: diamond + url: + type: string + format: uri + example: https://pokeapi.co/api/v2/version/12/ + max_chance: + type: number + example: 60 + encounter_details: + type: object + required: + - min_level + - max_level + - condition_value + - chance + - method + properties: + min_level: + type: number + example: 20 + max_level: + type: number + example: 30 + condition_values: + type: object + required: + - name + - url + properties: + name: + type: string + example: slot2-sapphire + url: + type: string + format: uri + example: https://pokeapi.co/api/v2/encounter-condition-value/10/ + chance: + type: number + example: 60 + method: + type: object + required: + - name + - url + properties: + name: + type: string + example: surf + url: + type: string + format: uri + example: https://pokeapi.co/api/v2/encounter-method/5/ readOnly: true required: - encounter_method_rates @@ -6957,8 +7153,20 @@ components: $ref: '#/components/schemas/PokedexSummary' readOnly: true version_groups: - type: object - additionalProperties: {} + type: array + items: + type: object + required: + - name + - url + properties: + name: + type: string + example: red-blue + url: + type: string + format: uri + example: https://pokeapi.co/api/v2/version-group/1/ readOnly: true required: - id @@ -7009,11 +7217,95 @@ components: type: boolean affecting_moves: type: object - additionalProperties: {} + required: + - decrease + - increase + properties: + increase: + type: array + items: + type: object + required: + - change + - move + properties: + change: + type: number + example: -1 + move: + type: object + required: + - name + - url + properties: + name: + type: string + example: swords-dance + url: + type: string + format: uri + example: https://pokeapi.co/api/v2/move/14/ + decrease: + type: array + items: + type: object + required: + - change + - move + properties: + change: + type: number + example: 5 + move: + type: object + required: + - name + - url + properties: + name: + type: string + example: growl + url: + type: string + format: uri + example: https://pokeapi.co/api/v2/move/45/ readOnly: true affecting_natures: type: object - additionalProperties: {} + required: + - increase + - decrease + properties: + increase: + type: array + items: + type: object + required: + - name + - url + properties: + name: + type: string + example: lonely + url: + type: string + format: uri + example: https://pokeapi.co/api/v2/nature/6/ + decrease: + type: array + items: + type: object + required: + - name + - url + properties: + name: + type: string + example: bold + url: + type: string + format: uri + example: https://pokeapi.co/api/v2/nature/2/ readOnly: true characteristics: type: array diff --git a/pokemon_v2/serializers.py b/pokemon_v2/serializers.py index 588654fe..33ec11d6 100644 --- a/pokemon_v2/serializers.py +++ b/pokemon_v2/serializers.py @@ -479,7 +479,12 @@ class CharacteristicDetailSerializer(serializers.ModelSerializer): "descriptions", ) - @extend_schema_field(OpenApiTypes.OBJECT) + @extend_schema_field(field={'type': 'array', + 'items': { + 'type': 'number', + }, + 'example': [ 0, 5, 10, 15, 20, 25, 30 ] + }) def get_values(self, obj): mod = obj.gene_mod_5 values = [] @@ -612,7 +617,23 @@ class RegionDetailSerializer(serializers.ModelSerializer): "version_groups", ) - @extend_schema_field(OpenApiTypes.OBJECT) + @extend_schema_field(field={'type': 'array', + 'items': { + 'type': 'object', + 'required': [ 'name', 'url' ], + 'properties': { + 'name': { + 'type': 'string', + 'example': 'red-blue' + }, + 'url': { + 'type': 'string', + 'format': 'uri', + 'example': 'https://pokeapi.co/api/v2/version-group/1/' + } + } + } + }) def get_region_version_groups(self, obj): vg_regions = VersionGroupRegion.objects.filter(region=obj) data = VersionGroupRegionSerializer( @@ -680,7 +701,33 @@ class GenderDetailSerializer(serializers.ModelSerializer): model = Gender fields = ("id", "name", "pokemon_species_details", "required_for_evolution") - @extend_schema_field(OpenApiTypes.OBJECT) + @extend_schema_field(field={'type': 'array', + 'items': { + 'type': 'object', + 'required': [ 'rate', 'pokemon_species' ], + 'properties': { + 'rate': { + 'type': 'number', + 'example': 1 + }, + 'pokemon_species': { + 'type': 'object', + 'required': [ 'name', 'url' ], + 'properties': { + 'name': { + 'type': 'string', + 'example': 'bulbasaur' + }, + 'url': { + 'type': 'string', + 'format': 'uri', + 'example': 'https://pokeapi.co/api/v2/pokemon-species/1/' + } + } + } + } + } + }) def get_species(self, obj): species_objects = [] @@ -703,7 +750,23 @@ class GenderDetailSerializer(serializers.ModelSerializer): return details - @extend_schema_field(OpenApiTypes.OBJECT) + @extend_schema_field(field={'type': 'array', + 'items': { + 'type': 'object', + 'required': [ 'name', 'url' ], + 'properties': { + 'name': { + 'type': 'string', + 'example': 'wormadam' + }, + 'url': { + 'type': 'string', + 'format': 'uri', + 'example': 'https://pokeapi.co/api/v2/pokemon-species/413/' + } + } + } + }) def get_required(self, obj): evo_objects = PokemonEvolution.objects.filter(gender=obj) species_list = [] @@ -863,6 +926,7 @@ class EncounterDetailSerializer(serializers.ModelSerializer): "condition_values", ) + # no response at the moment @extend_schema_field(OpenApiTypes.OBJECT) def get_encounter_conditions(self, obj): condition_values = EncounterConditionValueMap.objects.filter(encounter=obj) @@ -914,7 +978,57 @@ class LocationAreaDetailSerializer(serializers.ModelSerializer): "pokemon_encounters", ) - @extend_schema_field(OpenApiTypes.OBJECT) + @extend_schema_field(field={'type': 'array', + 'items': { + 'type': 'object', + 'required': [ 'encounter_method', 'version_details' ], + 'properties': { + 'encounter_method': { + 'type': 'object', + 'required': [ 'name', 'url' ], + 'properties': { + 'name': { + 'type': 'string', + 'example': 'old-rod' + }, + 'url': { + 'type': 'string', + 'format': 'uri', + 'example': 'https://pokeapi.co/api/v2/encounter-method/2/' + } + } + }, + 'version_details': { + 'type': 'array', + 'items': { + 'type': 'object', + 'required': [ 'rate', 'version' ], + 'properties': { + 'rate': { + 'type': 'number', + 'example': 5 + }, + 'version': { + 'type': 'object', + 'required': [ 'name', 'url' ], + 'properties': { + 'name': { + 'type': 'string', + 'example': 'platinum' + }, + 'url': { + 'type': 'string', + 'format': 'uri', + 'example': 'https://pokeapi.co/api/v2/version/14/' + } + } + } + } + } + } + } + } + }) def get_method_rates(self, obj): # Get encounters related to this area and pull out unique encounter methods encounter_rates = LocationAreaEncounterRate.objects.filter( @@ -956,7 +1070,111 @@ class LocationAreaDetailSerializer(serializers.ModelSerializer): return encounter_rate_list - @extend_schema_field(OpenApiTypes.OBJECT) + @extend_schema_field(field={'type': 'array', + 'items': { + 'type': 'object', + 'required': [ 'pokemon', 'version_details' ], + 'properties': { + 'pokemon': { + 'type': 'object', + 'required': [ 'name', 'url' ], + 'properties': { + 'name': { + 'type': 'string', + 'example': 'tentacool' + }, + 'url': { + 'type': 'string', + 'format': 'uri', + 'example': 'ttps://pokeapi.co/api/v2/pokemon/72/' + } + } + }, + 'version_details': { + 'type': 'array', + 'items': { + 'type': 'object', + 'required': [ 'version', 'max_chance', 'encounter_details' ], + 'properties': { + 'version': { + 'type': 'object', + 'required': [ 'name', 'url' ], + 'properties': { + 'name': { + 'type': 'string', + 'example': 'diamond' + }, + 'url': { + 'type': 'string', + 'format': 'uri', + 'example': 'https://pokeapi.co/api/v2/version/12/' + } + } + }, + 'max_chance': { + 'type': 'number', + 'example': 60 + }, + 'encounter_details': { + 'type': 'object', + 'required': [ + 'min_level', + 'max_level', + 'condition_value', + 'chance', + 'method' + ], + 'properties': { + 'min_level': { + 'type': 'number', + 'example': 20 + }, + 'max_level': { + 'type': 'number', + 'example': 30 + }, + 'condition_values': { + 'type': 'object', + 'required': [ 'name', 'url' ], + 'properties': { + 'name': { + 'type': 'string', + 'example': 'slot2-sapphire' + }, + 'url': { + 'type': 'string', + 'format': 'uri', + 'example': 'https://pokeapi.co/api/v2/encounter-condition-value/10/' + } + } + }, + 'chance': { + 'type': 'number', + 'example': 60 + }, + 'method': { + 'type': 'object', + 'required': [ 'name', 'url' ], + 'properties': { + 'name': { + 'type': 'string', + 'example': 'surf' + }, + 'url': { + 'type': 'string', + 'format': 'uri', + 'example': 'https://pokeapi.co/api/v2/encounter-method/5/' + } + } + } + } + } + } + } + } + } + } + }) def get_encounters(self, obj): # get versions for later use version_objects = Version.objects.all() @@ -1128,7 +1346,37 @@ class AbilityDetailSerializer(serializers.ModelSerializer): "pokemon", ) - @extend_schema_field(OpenApiTypes.OBJECT) + @extend_schema_field(field={'type': 'array', + 'items': { + 'type': 'object', + 'required': [ 'is_hidden', 'slot', 'pokemon' ], + 'properties': { + 'is_hidden': { + 'type': 'boolean', + 'example': True + }, + 'slot': { + 'type': 'number', + 'example': 3 + }, + 'pokemon': { + 'type': 'object', + 'required': [ 'name', 'url' ], + 'properties': { + 'name': { + 'type': 'string', + 'example': 'gloom' + }, + 'url': { + 'type': 'string', + 'format': 'uri', + 'example': 'https://pokeapi.co/api/v2/pokemon/44/' + } + } + } + } + } + }) def get_ability_pokemon(self, obj): pokemon_ability_objects = PokemonAbility.objects.filter(ability=obj) data = PokemonAbilitySerializer( @@ -1179,6 +1427,67 @@ class StatDetailSerializer(serializers.ModelSerializer): "names", ) + @extend_schema_field(field={'type': 'object', + 'required': [ 'decrease', 'increase' ], + 'properties': { + 'increase': { + 'type': 'array', + 'items': { + 'type': 'object', + 'required': [ 'change', 'move' ], + 'properties': { + 'change': { + 'type': 'number', + 'example': -1 + }, + 'move': { + 'type': 'object', + 'required': [ 'name', 'url' ], + 'properties': { + 'name': { + 'type': 'string', + 'example': 'swords-dance' + }, + 'url': { + 'type': 'string', + 'format': 'uri', + 'example': 'https://pokeapi.co/api/v2/move/14/' + } + } + } + } + } + }, + 'decrease': { + 'type': 'array', + 'items': { + 'type': 'object', + 'required': [ 'change', 'move' ], + 'properties': { + 'change': { + 'type': 'number', + 'example': 5 + }, + 'move': { + 'type': 'object', + 'required': [ 'name', 'url' ], + 'properties': { + 'name': { + 'type': 'string', + 'example': 'growl' + }, + 'url': { + 'type': 'string', + 'format': 'uri', + 'example': 'https://pokeapi.co/api/v2/move/45/' + } + } + } + } + } + } + } + }) @extend_schema_field(OpenApiTypes.OBJECT) def get_moves_that_affect(self, obj): stat_change_objects = MoveMetaStatChange.objects.filter(stat=obj) @@ -1196,7 +1505,47 @@ class StatDetailSerializer(serializers.ModelSerializer): return changes - @extend_schema_field(OpenApiTypes.OBJECT) + @extend_schema_field(field={'type': 'object', + 'required': [ 'increase', 'decrease' ], + 'properties': { + 'increase': { + 'type': 'array', + 'items': { + 'type': 'object', + 'required': [ 'name', 'url' ], + 'properties': { + 'name': { + 'type': 'string', + 'example': 'lonely' + }, + 'url': { + 'type': 'string', + 'format': 'uri', + 'example': 'https://pokeapi.co/api/v2/nature/6/' + } + } + } + }, + 'decrease': { + 'type': 'array', + 'items': { + 'type': 'object', + 'required': [ 'name', 'url' ], + 'properties': { + 'name': { + 'type': 'string', + 'example': 'bold' + }, + 'url': { + 'type': 'string', + 'format': 'uri', + 'example': 'https://pokeapi.co/api/v2/nature/2/' + } + } + } + }, + } + }) def get_natures_that_affect(self, obj): increase_objects = Nature.objects.filter(increased_stat=obj) increases = NatureSummarySerializer( From ddeaeebeb89ac73dcddf16ceb3fc5e249819436d Mon Sep 17 00:00:00 2001 From: indyandie <1058837+Indyandie@users.noreply.github.com> Date: Sun, 3 Mar 2024 00:40:40 -0600 Subject: [PATCH 20/76] fix: add `item` schema_field definitions --- openapi.yml | 120 +++++++++++++++++++++++++++++--- pokemon_v2/serializers.py | 140 ++++++++++++++++++++++++++++++++++++-- 2 files changed, 243 insertions(+), 17 deletions(-) diff --git a/openapi.yml b/openapi.yml index 38cf8b79..e5419cbd 100644 --- a/openapi.yml +++ b/openapi.yml @@ -3911,8 +3911,20 @@ components: $ref: '#/components/schemas/ItemAttributeDescription' readOnly: true items: - type: object - additionalProperties: {} + type: array + items: + type: object + required: + - name + - url + properties: + name: + type: string + example: master-ball + url: + type: string + format: uri + example: https://pokeapi.co/api/v2/item/1/ readOnly: true names: type: array @@ -4024,8 +4036,20 @@ components: fling_effect: $ref: '#/components/schemas/ItemFlingEffectSummary' attributes: - type: object - additionalProperties: {} + type: array + items: + type: object + required: + - name + - url + properties: + name: + type: string + example: countable + url: + type: string + format: uri + example: https://pokeapi.co/api/v2/item-attribute/1/ readOnly: true category: $ref: '#/components/schemas/ItemCategorySummary' @@ -4050,20 +4074,96 @@ components: $ref: '#/components/schemas/ItemName' readOnly: true held_by_pokemon: - type: object - additionalProperties: {} + type: array + items: + type: object + required: + - pokemon + - version-details + properties: + pokemon: + type: object + required: + - name + - url + properties: + name: + type: string + example: farfetchd + url: + type: string + format: uri + example: https://pokeapi.co/api/v2/pokemon/83/ + version-details: + type: array + items: + type: object + required: + - rarity + - version + properties: + rarity: + type: number + example: 5 + version: + type: object + required: + - name + - url + properties: + name: + type: string + example: ruby + url: + type: string + format: uri + example: https://pokeapi.co/api/v2/version/7/ readOnly: true sprites: type: object - additionalProperties: {} + required: + - default + properties: + default: + type: string + format: uri + example: https://pokeapi.co/media/sprites/items/master-ball.png readOnly: true baby_trigger_for: type: object - additionalProperties: {} + required: + - url + properties: + url: + type: string + format: uri + example: '"https://pokeapi.co/api/v2/evolution-chain/51/' readOnly: true machines: - type: object - additionalProperties: {} + type: array + items: + type: object + required: + - machine + - version_group + properties: + machine: + type: string + format: uri + example: https://pokeapi.co/api/v2/machine/1/ + version_group: + type: object + required: + - name + - url + properties: + name: + type: string + example: sword-shield + url: + type: string + format: uri + example: https://pokeapi.co/api/v2/version-group/20/ readOnly: true required: - attributes diff --git a/pokemon_v2/serializers.py b/pokemon_v2/serializers.py index 33ec11d6..eb682991 100644 --- a/pokemon_v2/serializers.py +++ b/pokemon_v2/serializers.py @@ -1488,7 +1488,6 @@ class StatDetailSerializer(serializers.ModelSerializer): } } }) - @extend_schema_field(OpenApiTypes.OBJECT) def get_moves_that_affect(self, obj): stat_change_objects = MoveMetaStatChange.objects.filter(stat=obj) stat_changes = MoveMetaStatChangeSerializer( @@ -1640,7 +1639,23 @@ class ItemAttributeDetailSerializer(serializers.ModelSerializer): model = ItemAttribute fields = ("id", "name", "descriptions", "items", "names") - @extend_schema_field(OpenApiTypes.OBJECT) + @extend_schema_field(field={'type': 'array', + 'items': { + 'type': 'object', + 'required': [ 'name', 'url' ], + 'properties': { + 'name': { + 'type': 'string', + 'example': 'master-ball' + }, + 'url': { + 'type': 'string', + 'format': 'uri', + 'example': 'https://pokeapi.co/api/v2/item/1/' + } + } + } + }) def get_attribute_items(self, obj): item_map_objects = ItemAttributeMap.objects.filter(item_attribute=obj) items = [] @@ -1757,7 +1772,34 @@ class ItemDetailSerializer(serializers.ModelSerializer): "machines", ) - @extend_schema_field(OpenApiTypes.OBJECT) + @extend_schema_field(field={'type': 'array', + 'items': { + 'type': 'object', + 'required': [ 'machine', 'version_group' ], + 'properties': { + 'machine': { + 'type': 'string', + 'format': 'uri', + 'example': 'https://pokeapi.co/api/v2/machine/1/' + }, + 'version_group': { + 'type': 'object', + 'required': [ 'name', 'url' ], + 'properties': { + 'name': { + 'type': 'string', + 'example': 'sword-shield' + }, + 'url': { + 'type': 'string', + 'format': 'uri', + 'example': 'https://pokeapi.co/api/v2/version-group/20/' + } + } + } + } + } + }) def get_item_machines(self, obj): machine_objects = Machine.objects.filter(item=obj) @@ -1778,12 +1820,37 @@ class ItemDetailSerializer(serializers.ModelSerializer): return machines - @extend_schema_field(OpenApiTypes.OBJECT) + @extend_schema_field(field={'type': 'object', + 'required': [ 'default' ], + 'properties': { + 'default': { + 'type': 'string', + 'format': 'uri', + 'example': 'https://pokeapi.co/media/sprites/items/master-ball.png' + } + } + }) def get_item_sprites(self, obj): sprites_object = ItemSprites.objects.get(item_id=obj) return sprites_object.sprites - @extend_schema_field(OpenApiTypes.OBJECT) + @extend_schema_field(field={'type': 'array', + 'items': { + 'type': 'object', + 'required': [ 'name', 'url' ], + 'properties': { + 'name': { + 'type': 'string', + 'example': 'countable' + }, + 'url': { + 'type': 'string', + 'format': 'uri', + 'example': 'https://pokeapi.co/api/v2/item-attribute/1/' + } + } + } + }) def get_item_attributes(self, obj): item_attribute_maps = ItemAttributeMap.objects.filter(item=obj) serializer = ItemAttributeMapSerializer( @@ -1801,7 +1868,57 @@ class ItemDetailSerializer(serializers.ModelSerializer): return attributes - @extend_schema_field(OpenApiTypes.OBJECT) + @extend_schema_field(field={'type': 'array', + 'items': { + 'type': 'object', + 'required': [ 'pokemon', 'version-details' ], + 'properties': { + 'pokemon': { + 'type': 'object', + 'required': [ 'name', 'url' ], + 'properties': { + 'name': { + 'type': 'string', + 'example': 'farfetchd' + }, + 'url': { + 'type': 'string', + 'format': 'uri', + 'example': 'https://pokeapi.co/api/v2/pokemon/83/' + } + } + }, + 'version-details': { + 'type': 'array', + 'items': { + 'type': 'object', + 'required': [ 'rarity', 'version' ], + 'properties': { + 'rarity': { + 'type': 'number', + 'example': 5 + }, + 'version': { + 'type': 'object', + 'required': [ 'name', 'url' ], + 'properties': { + 'name': { + 'type': 'string', + 'example': 'ruby' + }, + 'url': { + 'type': 'string', + 'format': 'uri', + 'example': 'https://pokeapi.co/api/v2/version/7/' + } + } + } + } + } + } + } + } + }) def get_held_by_pokemon(self, obj): pokemon_items = PokemonItem.objects.filter(item=obj).order_by("pokemon_id") pokemon_ids = pokemon_items.values("pokemon_id").distinct() @@ -1834,7 +1951,16 @@ class ItemDetailSerializer(serializers.ModelSerializer): return pokemon_list - @extend_schema_field(OpenApiTypes.OBJECT) + @extend_schema_field(field={'type': 'object', + 'required': [ 'url' ], + 'properties': { + 'url': { + 'type': 'string', + 'format': 'uri', + 'example': '"https://pokeapi.co/api/v2/evolution-chain/51/' + } + } + }) def get_baby_trigger_for(self, obj): try: chain_object = EvolutionChain.objects.get(baby_trigger_item=obj) From 3c9d27bf4671c118656d7c297f7029666c884dbd Mon Sep 17 00:00:00 2001 From: indyandie <1058837+Indyandie@users.noreply.github.com> Date: Sun, 3 Mar 2024 01:02:00 -0600 Subject: [PATCH 21/76] conf(drf-spectacular): set `COMPONENT_SPLIT_REQUEST` --- config/settings.py | 1 + 1 file changed, 1 insertion(+) diff --git a/config/settings.py b/config/settings.py index ce9b8382..00c7d392 100755 --- a/config/settings.py +++ b/config/settings.py @@ -147,5 +147,6 @@ SPECTACULAR_SETTINGS = { 'VERSION': '2.7.0', 'SERVE_INCLUDE_SCHEMA': False, 'OAS_VERSION': '3.1.0', + 'COMPONENT_SPLIT_REQUEST': True } From 928507938a9c05836d81e08d509b40631ebf5c12 Mon Sep 17 00:00:00 2001 From: indyandie <1058837+Indyandie@users.noreply.github.com> Date: Sun, 3 Mar 2024 01:03:33 -0600 Subject: [PATCH 22/76] fix: add `nature` schema_field definitions --- openapi.yml | 25 +++++++++++++++++++++++-- pokemon_v2/serializers.py | 28 +++++++++++++++++++++++++++- 2 files changed, 50 insertions(+), 3 deletions(-) diff --git a/openapi.yml b/openapi.yml index e5419cbd..e0c65c02 100644 --- a/openapi.yml +++ b/openapi.yml @@ -5531,8 +5531,29 @@ components: $ref: '#/components/schemas/BerrySummary' readOnly: true pokeathlon_stat_changes: - type: object - additionalProperties: {} + type: array + items: + type: object + required: + - max_change + - pokeathlon_stat + properties: + max_change: + type: number + example: 1 + pokeathlon_stat: + type: object + required: + - name + - url + properties: + name: + type: string + example: power + url: + type: string + format: uri + example: https://pokeapi.co/api/v2/pokeathlon-stat/2/ readOnly: true move_battle_style_preferences: type: array diff --git a/pokemon_v2/serializers.py b/pokemon_v2/serializers.py index eb682991..23da1d33 100644 --- a/pokemon_v2/serializers.py +++ b/pokemon_v2/serializers.py @@ -2025,7 +2025,33 @@ class NatureDetailSerializer(serializers.ModelSerializer): "names", ) - @extend_schema_field(OpenApiTypes.OBJECT) + @extend_schema_field(field={'type': 'array', + 'items': { + 'type': 'object', + 'required': [ 'max_change', 'pokeathlon_stat' ], + 'properties': { + 'max_change': { + 'type': 'number', + 'example': 1 + }, + 'pokeathlon_stat': { + 'type': 'object', + 'required': [ 'name', 'url' ], + 'properties': { + 'name': { + 'type': 'string', + 'example': 'power' + }, + 'url': { + 'type': 'string', + 'format': 'uri', + 'example': 'https://pokeapi.co/api/v2/pokeathlon-stat/2/' + } + } + } + } + } + }) def get_pokeathlon_stats(self, obj): pokeathlon_stat_objects = NaturePokeathlonStat.objects.filter(nature=obj) pokeathlon_stats = NaturePokeathlonStatSerializer( From e7ea8b2e8ccd55c9bb192e7ff31874e1aebbdc4d Mon Sep 17 00:00:00 2001 From: indyandie <1058837+Indyandie@users.noreply.github.com> Date: Sun, 3 Mar 2024 01:27:45 -0600 Subject: [PATCH 23/76] fix: add `move` schema_field definitions --- pokemon_v2/serializers.py | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/pokemon_v2/serializers.py b/pokemon_v2/serializers.py index 23da1d33..6089b421 100644 --- a/pokemon_v2/serializers.py +++ b/pokemon_v2/serializers.py @@ -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( From ef97bc6a456e03945a0d27982e18f6d8699a6a4e Mon Sep 17 00:00:00 2001 From: indyandie <1058837+Indyandie@users.noreply.github.com> Date: Sun, 3 Mar 2024 01:45:46 -0600 Subject: [PATCH 24/76] fix: add `pal-park-area` schema_field definitions --- openapi.yml | 54 ++++++++++++++++++++++++++++++++++++--- pokemon_v2/serializers.py | 32 ++++++++++++++++++++++- 2 files changed, 81 insertions(+), 5 deletions(-) diff --git a/openapi.yml b/openapi.yml index e0c65c02..30a44361 100644 --- a/openapi.yml +++ b/openapi.yml @@ -5058,8 +5058,29 @@ components: $ref: '#/components/schemas/MoveChange' readOnly: true stat_changes: - type: object - additionalProperties: {} + 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/ readOnly: true super_contest_effect: $ref: '#/components/schemas/SuperContestEffectSummary' @@ -6575,8 +6596,33 @@ components: $ref: '#/components/schemas/PalParkAreaName' readOnly: true pokemon_encounters: - type: object - additionalProperties: {} + type: array + items: + type: object + required: + - base_score + - pokemon-species + - rate + properties: + base_score: + type: number + example: 50 + pokemon-species: + type: object + required: + - name + - url + properties: + name: + type: string + example: bulbasaur + url: + type: string + format: uri + example: https://pokeapi.co/api/v2/pokemon-species/1/ + rate: + type: number + example: 30 readOnly: true required: - id diff --git a/pokemon_v2/serializers.py b/pokemon_v2/serializers.py index 6089b421..33be60f4 100644 --- a/pokemon_v2/serializers.py +++ b/pokemon_v2/serializers.py @@ -3613,7 +3613,37 @@ class PalParkAreaDetailSerializer(serializers.ModelSerializer): model = PalParkArea fields = ("id", "name", "names", "pokemon_encounters") - @extend_schema_field(OpenApiTypes.OBJECT) + @extend_schema_field(field={'type': 'array', + 'items': { + 'type': 'object', + 'required': [ 'base_score', 'pokemon-species', 'rate' ], + 'properties': { + 'base_score': { + 'type': 'number', + 'example': 50 + }, + 'pokemon-species': { + 'type': 'object', + 'required': [ 'name', 'url' ], + 'properties': { + 'name': { + 'type': 'string', + 'example': 'bulbasaur' + }, + 'url': { + 'type': 'string', + 'format': 'uri', + 'example': 'https://pokeapi.co/api/v2/pokemon-species/1/' + } + } + }, + 'rate': { + 'type': 'number', + 'example': 30 + }, + } + } + }) def get_encounters(self, obj): pal_park_objects = PalPark.objects.filter(pal_park_area=obj) parks = PalParkSerializer( From 3bb60381f0f44a2ac3464255db156bc78a8a5c1a Mon Sep 17 00:00:00 2001 From: indyandie <1058837+Indyandie@users.noreply.github.com> Date: Sun, 3 Mar 2024 14:37:49 -0600 Subject: [PATCH 25/76] fix: add `pokemon-form` schema_field definitions --- openapi.yml | 95 +++++++++++++++++++++++++++++--- pokemon_v2/serializers.py | 110 ++++++++++++++++++++++++++++++++++++-- 2 files changed, 194 insertions(+), 11 deletions(-) diff --git a/openapi.yml b/openapi.yml index 30a44361..ebc0cbb1 100644 --- a/openapi.yml +++ b/openapi.yml @@ -6969,21 +6969,102 @@ components: $ref: '#/components/schemas/PokemonSummary' sprites: type: object - additionalProperties: {} + properties: + default: + type: string + format: uri + example: https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/412.png + additionalProperties: + type: string + format: uri + nullable: true + example: https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/shiny/412.png + example: + back_default: https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/412.png + back_female: null + back_shiny: https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/shiny/412.png + back_shiny_female: null + front_default: https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/412.png + front_female: null + front_shiny: https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/shiny/412.png + front_shiny_female: null readOnly: true version_group: $ref: '#/components/schemas/VersionGroupSummary' form_names: - type: object - additionalProperties: {} + type: array + items: + type: object + required: + - language + - name + properties: + language: + type: object + required: + - name + - url + properties: + name: + type: string + example: en + url: + type: string + format: uri + example: https://pokeapi.co/api/v2/language/9/ + name: + type: string + example: Plant Cloak readOnly: true names: - type: object - additionalProperties: {} + type: array + items: + type: object + required: + - language + - name + properties: + language: + type: object + required: + - name + - url + properties: + name: + type: string + example: en + url: + type: string + format: uri + example: https://pokeapi.co/api/v2/language/9/ + name: + type: string + example: Plant Cloak readOnly: true types: - type: object - additionalProperties: {} + type: array + items: + type: object + required: + - slot + - type + properties: + slot: + type: number + example: 1 + type: + type: object + required: + - name + - url + properties: + name: + type: string + example: bug + url: + type: string + format: uri + example: https://pokeapi.co/api/v2/type/7/ readOnly: true required: - form_name diff --git a/pokemon_v2/serializers.py b/pokemon_v2/serializers.py index 33be60f4..5f1e8d58 100644 --- a/pokemon_v2/serializers.py +++ b/pokemon_v2/serializers.py @@ -3728,7 +3728,33 @@ class PokemonFormDetailSerializer(serializers.ModelSerializer): "types", ) - @extend_schema_field(OpenApiTypes.OBJECT) + @extend_schema_field(field={'type': 'array', + 'items': { + 'type': 'object', + 'required': [ 'language', 'name' ], + 'properties': { + 'language': { + 'type': 'object', + 'required': [ 'name', 'url' ], + 'properties': { + 'name': { + 'type': 'string', + 'example': 'en' + }, + 'url': { + 'type': 'string', + 'format': 'uri', + 'example': 'https://pokeapi.co/api/v2/language/9/' + } + } + }, + 'name': { + 'type': 'string', + 'example': 'Plant Cloak' + } + } + } + }) def get_pokemon_form_names(self, obj): form_results = PokemonFormName.objects.filter( pokemon_form=obj, name__regex=".+" @@ -3744,7 +3770,33 @@ class PokemonFormDetailSerializer(serializers.ModelSerializer): return data - @extend_schema_field(OpenApiTypes.OBJECT) + @extend_schema_field(field={'type': 'array', + 'items': { + 'type': 'object', + 'required': [ 'language', 'name' ], + 'properties': { + 'language': { + 'type': 'object', + 'required': [ 'name', 'url' ], + 'properties': { + 'name': { + 'type': 'string', + 'example': 'en' + }, + 'url': { + 'type': 'string', + 'format': 'uri', + 'example': 'https://pokeapi.co/api/v2/language/9/' + } + } + }, + 'name': { + 'type': 'string', + 'example': 'Plant Cloak' + } + } + } + }) def get_pokemon_form_pokemon_names(self, obj): form_results = PokemonFormName.objects.filter( pokemon_form=obj, pokemon_name__regex=".+" @@ -3761,12 +3813,62 @@ class PokemonFormDetailSerializer(serializers.ModelSerializer): return data - @extend_schema_field(OpenApiTypes.OBJECT) + @extend_schema_field(field={'type': 'object', + 'properties': { + 'default': { + 'type': 'string', + 'format': 'uri', + 'example': 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/412.png', + } + }, + 'additionalProperties': { # Stoplight Elements doesn't render this well + 'type': 'string', + 'format': 'uri', + 'nullable': True, + 'example': 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/shiny/412.png' + }, + 'example': { + 'back_default': 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/412.png', + 'back_female': None, + 'back_shiny': 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/shiny/412.png', + 'back_shiny_female': None, + 'front_default': 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/412.png', + 'front_female': None, + 'front_shiny': 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/shiny/412.png', + 'front_shiny_female': None + } + }) def get_pokemon_form_sprites(self, obj): sprites_object = PokemonFormSprites.objects.get(pokemon_form_id=obj) return sprites_object.sprites - @extend_schema_field(OpenApiTypes.OBJECT) + @extend_schema_field(field={'type': 'array', + 'items': { + 'type': 'object', + 'required': [ 'slot', 'type' ], + 'properties': { + 'slot': { + 'type': 'number', + 'example': 1 + }, + 'type': { + 'type': 'object', + 'required': [ 'name', 'url' ], + 'properties': { + 'name': { + 'type': 'string', + 'example': 'bug' + }, + 'url': { + 'type': 'string', + 'format': 'uri', + 'example': 'https://pokeapi.co/api/v2/type/7/' + } + } + }, + } + } + }) def get_pokemon_form_types(self, obj): form_type_objects = PokemonFormType.objects.filter(pokemon_form=obj) form_types = PokemonFormTypeSerializer( From fe9c1fa98d6edb566ffc76eb283a6ea197e83f7d Mon Sep 17 00:00:00 2001 From: indyandie <1058837+Indyandie@users.noreply.github.com> Date: Sun, 3 Mar 2024 14:46:20 -0600 Subject: [PATCH 26/76] fix: add `move_learn_method` schema_field definitions --- openapi.yml | 16 ++++++++++++++-- pokemon_v2/serializers.py | 23 ++++++++++++++++++++++- 2 files changed, 36 insertions(+), 3 deletions(-) diff --git a/openapi.yml b/openapi.yml index ebc0cbb1..dc0df517 100644 --- a/openapi.yml +++ b/openapi.yml @@ -5204,8 +5204,20 @@ components: $ref: '#/components/schemas/MoveLearnMethodDescription' readOnly: true version_groups: - type: object - additionalProperties: {} + type: array + items: + type: object + required: + - name + - url + properties: + name: + type: string + example: red-blue + url: + type: string + format: uri + example: https://pokeapi.co/api/v2/version-group/1/ readOnly: true required: - descriptions diff --git a/pokemon_v2/serializers.py b/pokemon_v2/serializers.py index 5f1e8d58..edc1fff7 100644 --- a/pokemon_v2/serializers.py +++ b/pokemon_v2/serializers.py @@ -3952,7 +3952,28 @@ class MoveLearnMethodDetailSerializer(serializers.ModelSerializer): model = MoveLearnMethod fields = ("id", "name", "names", "descriptions", "version_groups") - @extend_schema_field(OpenApiTypes.OBJECT) + # "version_groups": [ + # { + # "name": "red-blue", + # "url": "https://pokeapi.co/api/v2/version-group/1/" + # }, + @extend_schema_field(field={'type': 'array', + 'items': { + 'type': 'object', + 'required': [ 'name', 'url' ], + 'properties': { + 'name': { + 'type': 'string', + 'example': 'red-blue' + }, + 'url': { + 'type': 'string', + 'format': 'uri', + 'example': 'https://pokeapi.co/api/v2/version-group/1/' + } + } + } + }) def get_method_version_groups(self, obj): version_group_objects = VersionGroupMoveLearnMethod.objects.filter( move_learn_method=obj From 38f67d047305663eb91f1607858aee712a7a3c28 Mon Sep 17 00:00:00 2001 From: indyandie <1058837+Indyandie@users.noreply.github.com> Date: Sun, 3 Mar 2024 14:58:22 -0600 Subject: [PATCH 27/76] fix: add `pokemon_shape` schema_field definitions --- openapi.yml | 41 +++++++++++++++++++++++--- pokemon_v2/serializers.py | 62 +++++++++++++++++++++++++++++++++++++-- 2 files changed, 97 insertions(+), 6 deletions(-) diff --git a/openapi.yml b/openapi.yml index dc0df517..b0a6b4c8 100644 --- a/openapi.yml +++ b/openapi.yml @@ -7171,12 +7171,45 @@ components: type: string maxLength: 100 awesome_names: - type: object - additionalProperties: {} + type: array + items: + type: object + required: + - awesome_name + - language + properties: + awesome_name: + type: string + example: Pomaceous + language: + type: object + required: + - name + - url + properties: + name: + type: string + example: en + url: + type: string + format: uri + example: https://pokeapi.co/api/v2/language/9/ readOnly: true names: - type: object - additionalProperties: {} + type: array + items: + type: object + required: + - url + - name + properties: + url: + type: string + format: uri + example: https://pokeapi.co/api/v2/language/9/ + name: + type: string + example: Ball readOnly: true pokemon_species: type: array diff --git a/pokemon_v2/serializers.py b/pokemon_v2/serializers.py index edc1fff7..596a6827 100644 --- a/pokemon_v2/serializers.py +++ b/pokemon_v2/serializers.py @@ -4018,7 +4018,23 @@ class PokemonShapeDetailSerializer(serializers.ModelSerializer): model = PokemonShape fields = ("id", "name", "awesome_names", "names", "pokemon_species") - @extend_schema_field(OpenApiTypes.OBJECT) + @extend_schema_field(field={'type': 'array', + 'items': { + 'type': 'object', + 'required': [ 'url', 'name' ], + 'properties': { + 'url': { + 'type': 'string', + 'format': 'uri', + 'example': 'https://pokeapi.co/api/v2/language/9/' + }, + 'name': { + 'type': 'string', + 'example': 'Ball' + } + } + } + }) def get_shape_names(self, obj): results = PokemonShapeName.objects.filter(pokemon_shape_id=obj) serializer = PokemonShapeNameSerializer( @@ -4031,7 +4047,49 @@ class PokemonShapeDetailSerializer(serializers.ModelSerializer): return data - @extend_schema_field(OpenApiTypes.OBJECT) + # "awesome_names": [ + # { + # "awesome_name": "Pomacé", + # "language": { + # "name": "fr", + # "url": "https://pokeapi.co/api/v2/language/5/" + # } + # }, + # { + # "awesome_name": "Pomaceous", + # "language": { + # "name": "en", + # "url": "https://pokeapi.co/api/v2/language/9/" + # } + # } + # ], + @extend_schema_field(field={'type': 'array', + 'items': { + 'type': 'object', + 'required': [ 'awesome_name', 'language' ], + 'properties': { + 'awesome_name': { + 'type': 'string', + 'example': 'Pomaceous' + }, + 'language': { + 'type': 'object', + 'required': [ 'name', 'url' ], + 'properties': { + 'name': { + 'type': 'string', + 'example': 'en' + }, + 'url': { + 'type': 'string', + 'format': 'uri', + 'example': 'https://pokeapi.co/api/v2/language/9/' + } + } + } + } + } + }) def get_shape_awesome_names(self, obj): results = PokemonShapeName.objects.filter(pokemon_shape_id=obj) serializer = PokemonShapeNameSerializer( From 029f663d2f92bc3b02f2d81d2d6de779dbb8dda5 Mon Sep 17 00:00:00 2001 From: indyandie <1058837+Indyandie@users.noreply.github.com> Date: Sun, 3 Mar 2024 20:01:04 -0600 Subject: [PATCH 28/76] fix: add `pokemon` schema_field definitions --- openapi.yml | 289 ++++++++++++++++- pokemon_v2/serializers.py | 659 +++++++++++++++++++++++++++++++++++++- 2 files changed, 924 insertions(+), 24 deletions(-) diff --git a/openapi.yml b/openapi.yml index b0a6b4c8..2f8d23f7 100644 --- a/openapi.yml +++ b/openapi.yml @@ -6869,12 +6869,83 @@ components: maximum: 2147483647 minimum: -2147483648 abilities: - type: object - additionalProperties: {} + type: array + items: + type: object + required: + - ability + - is_hidden + - slot + properties: + ability: + type: object + required: + - name + - url + properties: + name: + type: string + example: sand-veil + url: + type: string + format: uri + example: https://pokeapi.co/api/v2/ability/8/ + is_hidden: + type: boolean + example: false + slot: + type: number + example: 1 readOnly: true past_abilities: - type: object - additionalProperties: {} + type: array + items: + type: object + required: + - abilities + - generation + properties: + abilities: + type: array + items: + type: object + required: + - ability + - is_hidden + - slot + properties: + ability: + type: object + required: + - name + - url + properties: + name: + type: string + example: levitate + url: + type: string + format: uri + example: https://pokeapi.co/api/v2/ability/26/ + is_hidden: + type: boolean + example: false + slot: + type: number + example: 1 + generation: + type: object + required: + - name + - url + properties: + name: + type: string + example: generation-vi + url: + type: string + format: uri + example: https://pokeapi.co/api/v2/generation/6/ readOnly: true forms: type: array @@ -6888,25 +6959,150 @@ components: readOnly: true held_items: type: object - additionalProperties: {} + required: + - item + - version_details + properties: + item: + type: object + required: + - name + - url + properties: + name: + type: string + example: soft-sand + url: + type: string + format: uri + example: https://pokeapi.co/api/v2/item/214/ + version_details: + type: array + items: + type: object + required: + - rarity + - version + properties: + rarity: + type: number + example: 5 + version: + type: object + required: + - name + - url + properties: + name: + type: string + example: diamond + url: + type: string + format: uri + example: https://pokeapi.co/api/v2/version/12/ readOnly: true location_area_encounters: - type: object - additionalProperties: {} + type: string + example: https://pokeapi.co/api/v2/pokemon/1/encounters readOnly: true moves: - type: object - additionalProperties: {} + type: array + items: + type: object + required: + - move + - version_group_details + properties: + move: + type: object + required: + - name + - url + properties: + name: + type: string + example: scratch + url: + type: string + format: uri + example: https://pokeapi.co/api/v2/move/10/ + version_group_details: + type: array + items: + type: object + required: + - level_learned_at + - move_learn_method + - version_group + properties: + level_learned_at: + type: number + example: 1 + move_learn_method: + type: object + required: + - name + - url + properties: + name: + type: string + example: level-up + url: + type: string + format: uri + example: https://pokeapi.co/api/v2/move-learn-method/1/ + version_group: + type: object + required: + - name + - url + properties: + name: + type: string + example: red-blue + url: + type: string + format: uri + example: https://pokeapi.co/api/v2/version-group/1/ readOnly: true species: $ref: '#/components/schemas/PokemonSpeciesSummary' sprites: type: object - additionalProperties: {} + properties: + front_default: + type: string + format: uri + exmaple: https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/1.png + additionalProperties: + type: string + format: uri + nullable: true + example: https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/shiny/1.png + example: + back_default: https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/1.png + back_female: null + back_shiny: https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/shiny/1.png + back_shiny_female: null + front_default: https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/1.png + front_female: null + front_shiny: https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/shiny/1.png + front_shiny_female: null readOnly: true cries: type: object - additionalProperties: {} + required: + - latest + - legacy + properties: + latest: + type: string + format: uri + example: https://raw.githubusercontent.com/PokeAPI/cries/main/cries/pokemon/latest/50.ogg + legacy: + type: string + format: uri + example: https://raw.githubusercontent.com/PokeAPI/cries/main/cries/pokemon/legacy/50.ogg readOnly: true stats: type: array @@ -6914,12 +7110,75 @@ components: $ref: '#/components/schemas/PokemonStat' readOnly: true types: - type: object - additionalProperties: {} + type: array + items: + type: object + required: + - slot + - type + properties: + slot: + type: number + example: 1 + type: + type: object + required: + - name + - url + properties: + name: + type: string + example: ghost + url: + type: string + format: uri + example: https://pokeapi.co/api/v2/type/8/ readOnly: true past_types: - type: object - additionalProperties: {} + type: array + items: + type: object + required: + - generation + - types + properties: + generation: + type: object + required: + - name + - url + properties: + name: + type: string + example: generation-v + url: + type: string + format: uri + example: https://pokeapi.co/api/v2/generation/5/ + types: + type: array + items: + type: object + required: + - slot + - type + properties: + slot: + type: number + example: 1 + type: + type: object + required: + - name + - url + properties: + name: + type: string + example: normal + url: + type: string + format: uri + example: https://pokeapi.co/api/v2/type/1/ readOnly: true required: - abilities diff --git a/pokemon_v2/serializers.py b/pokemon_v2/serializers.py index 596a6827..edfcce0a 100644 --- a/pokemon_v2/serializers.py +++ b/pokemon_v2/serializers.py @@ -4183,17 +4183,387 @@ class PokemonDetailSerializer(serializers.ModelSerializer): "past_types", ) - @extend_schema_field(OpenApiTypes.OBJECT) + @extend_schema_field(field={'type': 'object', + 'properties': { + 'front_default': { + 'type': 'string', + 'format': 'uri', + 'exmaple': 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/1.png', + } + }, + 'additionalProperties': { # Stoplight Elements doesn't render this well + 'type': 'string', + 'format': 'uri', + 'nullable': True, + 'example': 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/shiny/1.png' + }, + 'example': { + 'back_default': 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/1.png', + 'back_female': None, + 'back_shiny': 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/shiny/1.png', + 'back_shiny_female': None, + 'front_default': 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/1.png', + 'front_female': None, + 'front_shiny': 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/shiny/1.png', + 'front_shiny_female': None, + } + }) def get_pokemon_sprites(self, obj): sprites_object = PokemonSprites.objects.get(pokemon_id=obj) return sprites_object.sprites - @extend_schema_field(OpenApiTypes.OBJECT) + @extend_schema_field(field={'type': 'object', + 'required': [ 'latest', 'legacy' ], + 'properties': { + 'latest': { + 'type': 'string', + 'format': 'uri', + 'example': 'https://raw.githubusercontent.com/PokeAPI/cries/main/cries/pokemon/latest/50.ogg' + }, + 'legacy': { + 'type': 'string', + 'format': 'uri', + 'example': 'https://raw.githubusercontent.com/PokeAPI/cries/main/cries/pokemon/legacy/50.ogg' + } + } + }) def get_pokemon_cries(self, obj): cries_object = PokemonCries.objects.get(pokemon_id=obj) return cries_object.cries - @extend_schema_field(OpenApiTypes.OBJECT) + # { + # "move": { + # "name": "scratch", + # "url": "https://pokeapi.co/api/v2/move/10/" + # }, + # "version_group_details": [ + # { + # "level_learned_at": 1, + # "move_learn_method": { + # "name": "level-up", + # "url": "https://pokeapi.co/api/v2/move-learn-method/1/" + # }, + # "version_group": { + # "name": "red-blue", + # "url": "https://pokeapi.co/api/v2/version-group/1/" + # } + # }, + # { + # "level_learned_at": 1, + # "move_learn_method": { + # "name": "level-up", + # "url": "https://pokeapi.co/api/v2/move-learn-method/1/" + # }, + # "version_group": { + # "name": "yellow", + # "url": "https://pokeapi.co/api/v2/version-group/2/" + # } + # }, + # { + # "level_learned_at": 1, + # "move_learn_method": { + # "name": "level-up", + # "url": "https://pokeapi.co/api/v2/move-learn-method/1/" + # }, + # "version_group": { + # "name": "gold-silver", + # "url": "https://pokeapi.co/api/v2/version-group/3/" + # } + # }, + # { + # "level_learned_at": 1, + # "move_learn_method": { + # "name": "level-up", + # "url": "https://pokeapi.co/api/v2/move-learn-method/1/" + # }, + # "version_group": { + # "name": "crystal", + # "url": "https://pokeapi.co/api/v2/version-group/4/" + # } + # }, + # { + # "level_learned_at": 1, + # "move_learn_method": { + # "name": "level-up", + # "url": "https://pokeapi.co/api/v2/move-learn-method/1/" + # }, + # "version_group": { + # "name": "ruby-sapphire", + # "url": "https://pokeapi.co/api/v2/version-group/5/" + # } + # }, + # { + # "level_learned_at": 1, + # "move_learn_method": { + # "name": "level-up", + # "url": "https://pokeapi.co/api/v2/move-learn-method/1/" + # }, + # "version_group": { + # "name": "emerald", + # "url": "https://pokeapi.co/api/v2/version-group/6/" + # } + # }, + # { + # "level_learned_at": 1, + # "move_learn_method": { + # "name": "level-up", + # "url": "https://pokeapi.co/api/v2/move-learn-method/1/" + # }, + # "version_group": { + # "name": "firered-leafgreen", + # "url": "https://pokeapi.co/api/v2/version-group/7/" + # } + # }, + # { + # "level_learned_at": 1, + # "move_learn_method": { + # "name": "level-up", + # "url": "https://pokeapi.co/api/v2/move-learn-method/1/" + # }, + # "version_group": { + # "name": "diamond-pearl", + # "url": "https://pokeapi.co/api/v2/version-group/8/" + # } + # }, + # { + # "level_learned_at": 1, + # "move_learn_method": { + # "name": "level-up", + # "url": "https://pokeapi.co/api/v2/move-learn-method/1/" + # }, + # "version_group": { + # "name": "platinum", + # "url": "https://pokeapi.co/api/v2/version-group/9/" + # } + # }, + # { + # "level_learned_at": 1, + # "move_learn_method": { + # "name": "level-up", + # "url": "https://pokeapi.co/api/v2/move-learn-method/1/" + # }, + # "version_group": { + # "name": "heartgold-soulsilver", + # "url": "https://pokeapi.co/api/v2/version-group/10/" + # } + # }, + # { + # "level_learned_at": 1, + # "move_learn_method": { + # "name": "level-up", + # "url": "https://pokeapi.co/api/v2/move-learn-method/1/" + # }, + # "version_group": { + # "name": "black-white", + # "url": "https://pokeapi.co/api/v2/version-group/11/" + # } + # }, + # { + # "level_learned_at": 1, + # "move_learn_method": { + # "name": "level-up", + # "url": "https://pokeapi.co/api/v2/move-learn-method/1/" + # }, + # "version_group": { + # "name": "colosseum", + # "url": "https://pokeapi.co/api/v2/version-group/12/" + # } + # }, + # { + # "level_learned_at": 1, + # "move_learn_method": { + # "name": "level-up", + # "url": "https://pokeapi.co/api/v2/move-learn-method/1/" + # }, + # "version_group": { + # "name": "xd", + # "url": "https://pokeapi.co/api/v2/version-group/13/" + # } + # }, + # { + # "level_learned_at": 1, + # "move_learn_method": { + # "name": "level-up", + # "url": "https://pokeapi.co/api/v2/move-learn-method/1/" + # }, + # "version_group": { + # "name": "black-2-white-2", + # "url": "https://pokeapi.co/api/v2/version-group/14/" + # } + # }, + # { + # "level_learned_at": 1, + # "move_learn_method": { + # "name": "level-up", + # "url": "https://pokeapi.co/api/v2/move-learn-method/1/" + # }, + # "version_group": { + # "name": "x-y", + # "url": "https://pokeapi.co/api/v2/version-group/15/" + # } + # }, + # { + # "level_learned_at": 1, + # "move_learn_method": { + # "name": "level-up", + # "url": "https://pokeapi.co/api/v2/move-learn-method/1/" + # }, + # "version_group": { + # "name": "omega-ruby-alpha-sapphire", + # "url": "https://pokeapi.co/api/v2/version-group/16/" + # } + # }, + # { + # "level_learned_at": 1, + # "move_learn_method": { + # "name": "level-up", + # "url": "https://pokeapi.co/api/v2/move-learn-method/1/" + # }, + # "version_group": { + # "name": "sun-moon", + # "url": "https://pokeapi.co/api/v2/version-group/17/" + # } + # }, + # { + # "level_learned_at": 1, + # "move_learn_method": { + # "name": "level-up", + # "url": "https://pokeapi.co/api/v2/move-learn-method/1/" + # }, + # "version_group": { + # "name": "ultra-sun-ultra-moon", + # "url": "https://pokeapi.co/api/v2/version-group/18/" + # } + # }, + # { + # "level_learned_at": 1, + # "move_learn_method": { + # "name": "level-up", + # "url": "https://pokeapi.co/api/v2/move-learn-method/1/" + # }, + # "version_group": { + # "name": "lets-go-pikachu-lets-go-eevee", + # "url": "https://pokeapi.co/api/v2/version-group/19/" + # } + # }, + # { + # "level_learned_at": 1, + # "move_learn_method": { + # "name": "level-up", + # "url": "https://pokeapi.co/api/v2/move-learn-method/1/" + # }, + # "version_group": { + # "name": "sword-shield", + # "url": "https://pokeapi.co/api/v2/version-group/20/" + # } + # }, + # { + # "level_learned_at": 1, + # "move_learn_method": { + # "name": "level-up", + # "url": "https://pokeapi.co/api/v2/move-learn-method/1/" + # }, + # "version_group": { + # "name": "brilliant-diamond-and-shining-pearl", + # "url": "https://pokeapi.co/api/v2/version-group/23/" + # } + # }, + # { + # "level_learned_at": 1, + # "move_learn_method": { + # "name": "level-up", + # "url": "https://pokeapi.co/api/v2/move-learn-method/1/" + # }, + # "version_group": { + # "name": "scarlet-violet", + # "url": "https://pokeapi.co/api/v2/version-group/25/" + # } + # } + # ] + # }, + + # "move": { + # "name": "scratch", + # "url": "https://pokeapi.co/api/v2/move/10/" + # }, + # "version_group_details": [ + # { + # "level_learned_at": 1, + # "move_learn_method": { + # "name": "level-up", + # "url": "https://pokeapi.co/api/v2/move-learn-method/1/" + # }, + # "version_group": { + # "name": "red-blue", + # "url": "https://pokeapi.co/api/v2/version-group/1/" + # } + # }, + @extend_schema_field(field={'type': 'array', + 'items': { + 'type': 'object', + 'required': [ 'move', 'version_group_details' ], + 'properties': { + 'move': { + 'type': 'object', + 'required': [ 'name', 'url' ], + 'properties': { + 'name': { + 'type': 'string', + 'example': 'scratch' + }, + 'url': { + 'type': 'string', + 'format': 'uri', + 'example': 'https://pokeapi.co/api/v2/move/10/' + } + } + }, + 'version_group_details': { + 'type': 'array', + 'items': { + 'type': 'object', + 'required': [ 'level_learned_at', 'move_learn_method', 'version_group' ], + 'properties': { + 'level_learned_at': { + 'type': 'number', + 'example': 1 + }, + 'move_learn_method': { + 'type': 'object', + 'required': [ 'name', 'url' ], + 'properties': { + 'name': { + 'type': 'string', + 'example': 'level-up' + }, + 'url': { + 'type': 'string', + 'format': 'uri', + 'example': 'https://pokeapi.co/api/v2/move-learn-method/1/' + } + } + }, + 'version_group': { + 'type': 'object', + 'required': [ 'name', 'url' ], + 'properties': { + 'name': { + 'type': 'string', + 'example': 'red-blue' + }, + 'url': { + 'type': 'string', + 'format': 'uri', + 'example': 'https://pokeapi.co/api/v2/version-group/1/' + } + } + } + } + } + } + } + } + }) def get_pokemon_moves(self, obj): version_objects = VersionGroup.objects.all() version_data = VersionGroupSummarySerializer( @@ -4245,7 +4615,67 @@ class PokemonDetailSerializer(serializers.ModelSerializer): return move_list - @extend_schema_field(OpenApiTypes.OBJECT) + # { + # "item": { + # "name": "soft-sand", + # "url": "https://pokeapi.co/api/v2/item/214/" + # }, + # "version_details": [ + # { + # "rarity": 5, + # "version": { + # "name": "diamond", + # "url": "https://pokeapi.co/api/v2/version/12/" + # } + # }, + @extend_schema_field(field={'type': 'object', + 'required': [ 'item', 'version_details' ], + 'properties': { + 'item': { + 'type': 'object', + 'required': [ 'name', 'url' ], + 'properties': { + 'name': { + 'type': 'string', + 'example': 'soft-sand' + }, + 'url': { + 'type': 'string', + 'format': 'uri', + 'example': 'https://pokeapi.co/api/v2/item/214/' + } + } + }, + 'version_details': { + 'type': 'array', + 'items': { + 'type': 'object', + 'required': [ 'rarity', 'version' ], + 'properties': { + 'rarity': { + 'type': 'number', + 'example': 5 + }, + 'version': { + 'type': 'object', + 'required': [ 'name', 'url' ], + 'properties': { + 'name': { + 'type': 'string', + 'example': 'diamond' + }, + 'url': { + 'type': 'string', + 'format': 'uri', + 'example': 'https://pokeapi.co/api/v2/version/12/' + } + } + } + } + } + }, + } + }) def get_pokemon_held_items(self, obj): # Get items related to this pokemon and pull out unique Item IDs pokemon_items = PokemonItem.objects.filter(pokemon_id=obj).order_by("item_id") @@ -4279,7 +4709,45 @@ class PokemonDetailSerializer(serializers.ModelSerializer): return item_list - @extend_schema_field(OpenApiTypes.OBJECT) + # { + # "ability": { + # "name": "sand-veil", + # "url": "https://pokeapi.co/api/v2/ability/8/" + # }, + # "is_hidden": false, + # "slot": 1 + # }, + @extend_schema_field(field={'type': 'array', + 'items': { + 'type': 'object', + 'required': [ 'ability', 'is_hidden', 'slot' ], + 'properties': { + 'ability': { + 'type': 'object', + 'required': [ 'name', 'url' ], + 'properties': { + 'name': { + 'type': 'string', + 'example': 'sand-veil' + }, + 'url': { + 'type': 'string', + 'format': 'uri', + 'example': 'https://pokeapi.co/api/v2/ability/8/' + } + } + }, + 'is_hidden': { + 'type': 'boolean', + 'example': False + }, + 'slot': { + 'type': 'number', + 'example': 1 + }, + } + } + }) def get_pokemon_abilities(self, obj): pokemon_ability_objects = PokemonAbility.objects.filter(pokemon=obj) data = PokemonAbilitySerializer( @@ -4293,7 +4761,77 @@ class PokemonDetailSerializer(serializers.ModelSerializer): return abilities - @extend_schema_field(OpenApiTypes.OBJECT) + # { + # "abilities": [ + # { + # "ability": { + # "name": "levitate", + # "url": "https://pokeapi.co/api/v2/ability/26/" + # }, + # "is_hidden": false, + # "slot": 1 + # } + # ], + # "generation": { + # "name": "generation-vi", + # "url": "https://pokeapi.co/api/v2/generation/6/" + # } + # } + @extend_schema_field(field={'type': 'array', + 'items': { + 'type': 'object', + 'required': [ 'abilities', 'generation' ], + 'properties': { + 'abilities': { + 'type': 'array', + 'items': { + 'type': 'object', + 'required': [ 'ability', 'is_hidden', 'slot' ], + 'properties': { + 'ability': { + 'type': 'object', + 'required': [ 'name', 'url' ], + 'properties': { + 'name': { + 'type': 'string', + 'example': 'levitate' + }, + 'url': { + 'type': 'string', + 'format': 'uri', + 'example': 'https://pokeapi.co/api/v2/ability/26/' + } + } + }, + 'is_hidden': { + 'type': 'boolean', + 'example': False + }, + 'slot': { + 'type': 'number', + 'example': 1 + } + } + } + }, + 'generation': { + 'type': 'object', + 'required': [ 'name', 'url' ], + 'properties': { + 'name': { + 'type': 'string', + 'example': 'generation-vi' + }, + 'url': { + 'type': 'string', + 'format': 'uri', + 'example': 'https://pokeapi.co/api/v2/generation/6/' + } + } + }, + } + } + }) def get_past_pokemon_abilities(self, obj): pokemon_past_ability_objects = PokemonAbilityPast.objects.filter(pokemon=obj) pokemon_past_abilities = PokemonAbilityPastSerializer( @@ -4329,7 +4867,40 @@ class PokemonDetailSerializer(serializers.ModelSerializer): return final_data - @extend_schema_field(OpenApiTypes.OBJECT) + # { + # "slot": 1, + # "type": { + # "name": "ghost", + # "url": "https://pokeapi.co/api/v2/type/8/" + # } + # }, + @extend_schema_field(field={'type': 'array', + 'items': { + 'type': 'object', + 'required': [ 'slot', 'type' ], + 'properties': { + 'slot': { + 'type': 'number', + 'example': 1 + }, + 'type': { + 'type': 'object', + 'required': [ 'name', 'url' ], + 'properties': { + 'name': { + 'type': 'string', + 'example': 'ghost' + }, + 'url': { + 'type': 'string', + 'format': 'uri', + 'example': 'https://pokeapi.co/api/v2/type/8/' + } + } + } + } + } + }) def get_pokemon_types(self, obj): poke_type_objects = PokemonType.objects.filter(pokemon=obj) poke_types = PokemonTypeSerializer( @@ -4341,7 +4912,74 @@ class PokemonDetailSerializer(serializers.ModelSerializer): return poke_types - @extend_schema_field(OpenApiTypes.OBJECT) + # "past_types": [ + # { + # "generation": { + # "name": "generation-v", + # "url": "https://pokeapi.co/api/v2/generation/5/" + # }, + # "types": [ + # { + # "slot": 1, + # "type": { + # "name": "normal", + # "url": "https://pokeapi.co/api/v2/type/1/" + # } + # } + # ] + # } + # ], + @extend_schema_field(field={'type': 'array', + 'items': { + 'type': 'object', + 'required': [ 'generation', 'types' ], + 'properties':{ + 'generation': { + 'type': 'object', + 'required': [ 'name', 'url' ], + 'properties': { + 'name': { + 'type': 'string', + 'example': 'generation-v' + }, + 'url': { + 'type': 'string', + 'format': 'uri', + 'example': 'https://pokeapi.co/api/v2/generation/5/' + } + } + }, + 'types': { + 'type': 'array', + 'items': { + 'type': 'object', + 'required': [ 'slot', 'type' ], + 'properties': { + 'slot': { + 'type': 'number', + 'example': 1 + }, + 'type': { + 'type': 'object', + 'required': [ 'name', 'url' ], + 'properties': { + 'name': { + 'type': 'string', + 'example': 'normal' + }, + 'url': { + 'type': 'string', + 'format': 'uri', + 'example': 'https://pokeapi.co/api/v2/type/1/' + } + } + }, + } + } + }, + } + } + }) def get_past_pokemon_types(self, obj): poke_past_type_objects = PokemonTypePast.objects.filter(pokemon=obj) poke_past_types = PokemonTypePastSerializer( @@ -4377,7 +5015,10 @@ class PokemonDetailSerializer(serializers.ModelSerializer): return final_data - @extend_schema_field(OpenApiTypes.OBJECT) + @extend_schema_field(field={ + 'type': 'string', + 'example': 'https://pokeapi.co/api/v2/pokemon/1/encounters' + }) def get_encounters(self, obj): return reverse("pokemon_encounters", kwargs={"pokemon_id": obj.pk}) From 0fabe2c70cc22c20547657a0528ed04ea07b0b05 Mon Sep 17 00:00:00 2001 From: indyandie <1058837+Indyandie@users.noreply.github.com> Date: Sun, 3 Mar 2024 20:49:15 -0600 Subject: [PATCH 29/76] fix: add `pokemon-species` schema_field definitions --- openapi.yml | 136 +++++++++++++++++++++++++++++--- pokemon_v2/serializers.py | 160 ++++++++++++++++++++++++++++++++++++-- 2 files changed, 278 insertions(+), 18 deletions(-) diff --git a/openapi.yml b/openapi.yml index 2f8d23f7..c2cc408c 100644 --- a/openapi.yml +++ b/openapi.yml @@ -3640,8 +3640,20 @@ components: $ref: '#/components/schemas/EvolutionTriggerName' readOnly: true pokemon_species: - type: object - additionalProperties: {} + type: array + items: + type: object + required: + - name + - url + properties: + name: + type: string + example: ivysaur + url: + type: string + format: uri + example: https://pokeapi.co/api/v2/pokemon-species/2/ readOnly: true required: - id @@ -7561,8 +7573,20 @@ components: $ref: '#/components/schemas/PokemonDexEntry' readOnly: true egg_groups: - type: object - additionalProperties: {} + type: array + items: + type: object + required: + - name + - url + properties: + name: + type: string + example: monster + url: + type: string + format: uri + example: https://pokeapi.co/api/v2/egg-group/1/ readOnly: true color: $ref: '#/components/schemas/PokemonColorSummary' @@ -7577,12 +7601,58 @@ components: generation: $ref: '#/components/schemas/GenerationSummary' names: - type: object - additionalProperties: {} + type: array + items: + type: object + required: + - language + - name + properties: + language: + type: object + required: + - name + - url + properties: + name: + type: string + example: en + url: + type: string + format: uri + example: https://pokeapi.co/api/v2/language/9/ + name: + type: string + example: bulbasaur readOnly: true pal_park_encounters: - type: object - additionalProperties: {} + type: array + items: + type: object + required: + - area + - base_score + - rate + properties: + area: + type: object + required: + - name + - url + properties: + name: + type: string + example: field + url: + type: string + format: uri + example: https://pokeapi.co/api/v2/pal-park-area/2/ + base_score: + type: number + example: 50 + rate: + type: number + example: 30 readOnly: true form_descriptions: type: array @@ -7595,12 +7665,54 @@ components: $ref: '#/components/schemas/PokemonSpeciesFlavorText' readOnly: true genera: - type: object - additionalProperties: {} + type: array + items: + type: object + required: + - genus + - language + properties: + genus: + type: string + example: Seed Pokémon + language: + type: object + required: + - name + - url + properties: + name: + type: string + example: en + url: + type: string + format: uri + example: https://pokeapi.co/api/v2/language/9/ readOnly: true varieties: - type: object - additionalProperties: {} + type: array + items: + type: object + required: + - is_default + - pokemon + properties: + is_default: + type: boolean + example: true + pokemon: + type: object + required: + - name + - url + properties: + name: + type: string + example: bulbasaur + url: + type: string + format: uri + example: https://pokeapi.co/api/v2/pokemon/1/ readOnly: true required: - color diff --git a/pokemon_v2/serializers.py b/pokemon_v2/serializers.py index edfcce0a..2240cc92 100644 --- a/pokemon_v2/serializers.py +++ b/pokemon_v2/serializers.py @@ -5044,7 +5044,24 @@ class EvolutionTriggerDetailSerializer(serializers.HyperlinkedModelSerializer): model = EvolutionTrigger fields = ("id", "name", "names", "pokemon_species") - @extend_schema_field(OpenApiTypes.OBJECT) + @extend_schema_field(field={ + 'type': 'array', + 'items': { + 'type': 'object', + 'required': [ 'name', 'url' ], + 'properties': { + 'name': { + 'type': 'string', + 'example': 'ivysaur' + }, + 'url': { + 'type': 'string', + 'format': 'uri', + 'example': 'https://pokeapi.co/api/v2/pokemon-species/2/' + } + } + } + }) def get_species(self, obj): evo_objects = PokemonEvolution.objects.filter(evolution_trigger=obj) species_list = [] @@ -5152,7 +5169,33 @@ class PokemonSpeciesDetailSerializer(serializers.ModelSerializer): "varieties", ) - @extend_schema_field(OpenApiTypes.OBJECT) + @extend_schema_field(field={'type': 'array', + 'items': { + 'type': 'object', + 'required': [ 'language', 'name' ], + 'properties': { + 'language': { + 'type': 'object', + 'required': [ 'name', 'url' ], + 'properties': { + 'name': { + 'type': 'string', + 'example': 'en' + }, + 'url': { + 'type': 'string', + 'format': 'uri', + 'example': 'https://pokeapi.co/api/v2/language/9/' + } + } + }, + 'name': { + 'type': 'string', + 'example': 'bulbasaur' + } + } + } + }) def get_pokemon_names(self, obj): species_results = PokemonSpeciesName.objects.filter(pokemon_species=obj) species_serializer = PokemonSpeciesNameSerializer( @@ -5166,7 +5209,40 @@ class PokemonSpeciesDetailSerializer(serializers.ModelSerializer): return data - @extend_schema_field(OpenApiTypes.OBJECT) + # { + # "genus": "Seed Pokémon", + # "language": { + # "name": "en", + # "url": "https://pokeapi.co/api/v2/language/9/" + # } + # }, + @extend_schema_field(field={'type': 'array', + 'items': { + 'type': 'object', + 'required': [ 'genus', 'language' ], + 'properties': { + 'genus': { + 'type': 'string', + 'example': 'Seed Pokémon' + }, + 'language': { + 'type': 'object', + 'required': [ 'name', 'url' ], + 'properties': { + 'name': { + 'type': 'string', + 'example': 'en' + }, + 'url': { + 'type': 'string', + 'format': 'uri', + 'example': 'https://pokeapi.co/api/v2/language/9/' + } + } + } + } + } + }) def get_pokemon_genera(self, obj): results = PokemonSpeciesName.objects.filter(pokemon_species=obj) serializer = PokemonSpeciesNameSerializer( @@ -5182,7 +5258,23 @@ class PokemonSpeciesDetailSerializer(serializers.ModelSerializer): return genera - @extend_schema_field(OpenApiTypes.OBJECT) + @extend_schema_field(field={'type': 'array', + 'items': { + 'type': 'object', + 'required': [ 'name', 'url' ], + 'properties': { + 'name': { + 'type': 'string', + 'example': 'monster' + }, + 'url': { + 'type': 'string', + 'format': 'uri', + 'example': 'https://pokeapi.co/api/v2/egg-group/1/' + } + } + } + }) def get_pokemon_egg_groups(self, obj): results = PokemonEggGroup.objects.filter(pokemon_species=obj) data = PokemonEggGroupSerializer(results, many=True, context=self.context).data @@ -5192,7 +5284,33 @@ class PokemonSpeciesDetailSerializer(serializers.ModelSerializer): return groups - @extend_schema_field(OpenApiTypes.OBJECT) + @extend_schema_field(field={'type': 'array', + 'items': { + 'type': 'object', + 'required': [ 'is_default', 'pokemon' ], + 'properties': { + 'is_default': { + 'type': 'boolean', + 'example': True + }, + 'pokemon': { + 'type': 'object', + 'required': [ 'name', 'url' ], + 'properties': { + 'name': { + 'type': 'string', + 'example': 'bulbasaur' + }, + 'url': { + 'type': 'string', + 'format': 'uri', + 'example': 'https://pokeapi.co/api/v2/pokemon/1/' + } + } + } + } + } + }) def get_pokemon_varieties(self, obj): results = Pokemon.objects.filter(pokemon_species=obj) summary_data = PokemonSummarySerializer( @@ -5212,7 +5330,37 @@ class PokemonSpeciesDetailSerializer(serializers.ModelSerializer): return varieties - @extend_schema_field(OpenApiTypes.OBJECT) + @extend_schema_field(field={'type': 'array', + 'items': { + 'type': 'object', + 'required': [ 'area', 'base_score', 'rate' ], + 'properties': { + 'area': { + 'type': 'object', + 'required': [ 'name', 'url' ], + 'properties': { + 'name': { + 'type': 'string', + 'example': 'field' + }, + 'url': { + 'type': 'string', + 'format': 'uri', + 'example': 'https://pokeapi.co/api/v2/pal-park-area/2/' + } + } + }, + 'base_score': { + 'type': 'number', + 'example': 50 + }, + 'rate': { + 'type': 'number', + 'example': 30 + } + } + } + }) def get_encounters(self, obj): pal_park_objects = PalPark.objects.filter(pokemon_species=obj) parks = PalParkSerializer( From da11f734dbef91abea3e8b1d2e4d281c3ae23123 Mon Sep 17 00:00:00 2001 From: indyandie <1058837+Indyandie@users.noreply.github.com> Date: Sun, 3 Mar 2024 22:29:50 -0600 Subject: [PATCH 30/76] fix: add `evolution-chain` schema_field definitions --- openapi.yml | 179 +++++++++++++++++++++++++++++- pokemon_v2/serializers.py | 224 +++++++++++++++++++++++++++++++++++++- 2 files changed, 401 insertions(+), 2 deletions(-) diff --git a/openapi.yml b/openapi.yml index c2cc408c..d507ff1c 100644 --- a/openapi.yml +++ b/openapi.yml @@ -3610,7 +3610,184 @@ components: $ref: '#/components/schemas/ItemSummary' chain: type: object - additionalProperties: {} + required: + - evolution_details + - evolves_to + - is_baby + - species + properties: + evolution_details: + type: array + items: {} + example: [] + evolves_to: + type: array + items: + type: object + required: + - evolution_details + - evolves_to + - is_baby + - species + properties: + evolution_details: + type: array + items: + type: object + required: + - gender + - held_item + - item + - known_move + - known_move_type + - location + - min_affection + - min_beauty + - min_happiness + - min_level + - needs_overworld_rain + - party_species + - party_type + - relative_physical_stats + - time_of_day + - trade_species + - trigger + - turn_upside_down + properties: + gender: + type: object + nullable: true + required: + - name + - url + properties: + name: + type: string + example: 1 + url: + type: string + format: uri + example: 2 + held_item: + type: object + nullable: true + required: + - name + - url + properties: + name: + type: string + example: 1 + url: + type: string + format: uri + example: 2 + item: + type: object + nullable: true + required: + - name + - url + properties: + name: + type: string + example: 1 + url: + type: string + format: uri + example: 2 + known_move: + type: '' + nullable: true + known_move_type: + type: '' + nullable: true + location: + type: object + nullable: true + required: + - name + - url + properties: + name: + type: string + url: + type: string + format: uri + min_affection: + type: number + nullable: true + min_beauty: + type: number + nullable: true + min_happiness: + type: number + nullable: true + min_level: + type: number + nullable: true + needs_overworld_rain: + type: boolean + nullable: true + party_species: + type: string + nullable: true + party_type: + type: string + nullable: true + relative_physical_stats: + type: string + nullable: true + time_of_day: + type: string + trade_species: + type: string + nullable: true + trigger: + type: object + required: + - name + - url + properties: + name: + type: string + url: + type: string + format: uri + turn_upside_down: + type: boolean + is_baby: + type: boolean + example: true + species: + type: object + required: + - name + - url + properties: + name: + type: string + example: happiny + url: + type: string + format: uri + example: https://pokeapi.co/api/v2/pokemon-species/440/ + is_baby: + type: boolean + example: true + species: + type: object + required: + - name + - url + properties: + name: + type: string + example: happiny + url: + type: string + format: uri + example: https://pokeapi.co/api/v2/pokemon-species/440/ readOnly: true required: - baby_trigger_item diff --git a/pokemon_v2/serializers.py b/pokemon_v2/serializers.py index 2240cc92..f336ea19 100644 --- a/pokemon_v2/serializers.py +++ b/pokemon_v2/serializers.py @@ -5418,7 +5418,229 @@ class EvolutionChainDetailSerializer(serializers.ModelSerializer): model = EvolutionChain fields = ("id", "baby_trigger_item", "chain") - @extend_schema_field(OpenApiTypes.OBJECT) + # TODO: Revisit Schema + @extend_schema_field(field={'type': 'object', + 'required': [ + 'evolution_details', + 'evolves_to', + 'is_baby', + 'species' + ], + 'properties': { + 'evolution_details': { + 'type': 'array', + 'items': { + }, + 'example': [] + }, + 'evolves_to': { + 'type': 'array', + 'items': { + 'type': 'object', + 'required': [ + 'evolution_details', + 'evolves_to', + 'is_baby', + 'species' + ], + 'properties': { + 'evolution_details': { + 'type': 'array', + 'items': { + 'type': 'object', + 'required': [ + 'gender', + 'held_item', + 'item', + 'known_move', + 'known_move_type', + 'location', + 'min_affection', + 'min_beauty', + 'min_happiness', + 'min_level', + 'needs_overworld_rain', + 'party_species', + 'party_type', + 'relative_physical_stats', + 'time_of_day', + 'trade_species', + 'trigger', + 'turn_upside_down' + ], + 'properties': { + 'gender': { + 'type': '', + 'nullable': True, + 'type': 'object', + 'required': [ 'name', 'url' ], + 'properties': { + 'name': { + 'type': 'string', + 'example': 1 + }, + 'url': { + 'type': 'string', + 'format': 'uri', + 'example': 2 + } + } + }, + 'held_item': { + 'type': 'object', + 'nullable': True, + 'required': [ 'name', 'url' ], + 'properties': { + 'name': { + 'type': 'string', + 'example': 1 + }, + 'url': { + 'type': 'string', + 'format': 'uri', + 'example': 2 + } + } + }, + 'item': { + 'type': 'object', + 'nullable': True, + 'required': [ 'name', 'url' ], + 'properties': { + 'name': { + 'type': 'string', + 'example': 1 + }, + 'url': { + 'type': 'string', + 'format': 'uri', + 'example': 2 + } + } + }, + 'known_move': { + 'type': '', + 'nullable': True, + }, + 'known_move_type': { + 'type': '', + 'nullable': True, + }, + 'location': { + 'type': 'object', + 'nullable': True, + 'required': [ 'name', 'url' ], + 'properties': { + 'name': { + 'type': 'string', + }, + 'url': { + 'type': 'string', + 'format': 'uri', + } + } + }, + 'min_affection': { + 'type': 'number', + 'nullable': True + }, + 'min_beauty': { + 'type': 'number', + 'nullable': True + }, + 'min_happiness': { + 'type': 'number', + 'nullable': True + }, + 'min_level': { + 'type': 'number', + 'nullable': True + }, + 'needs_overworld_rain': { + 'type': 'boolean', + 'nullable': True + }, + 'party_species': { + 'type': 'string', + 'nullable': True + }, + 'party_type': { + 'type': 'string', + 'nullable': True + }, + 'relative_physical_stats': { + 'type': 'string', + 'nullable': True + }, + 'time_of_day': { + 'type': 'string' + }, + 'trade_species': { + 'type': 'string', + 'nullable': True + }, + 'trigger': { + 'type': 'object', + 'required': [ 'name', 'url' ], + 'properties': { + 'name': { + 'type': 'string', + }, + 'url': { + 'type': 'string', + 'format': 'uri' + } + } + }, + 'turn_upside_down': { + 'type': 'boolean' + } + } + } + }, + 'is_baby': { + 'type': 'boolean', + 'example': True + }, + 'species': { + 'type': 'object', + 'required': [ 'name', 'url' ], + 'properties': { + 'name': { + 'type': 'string', + 'example': 'happiny' + }, + 'url': { + 'type': 'string', + 'format': 'uri', + 'example': 'https://pokeapi.co/api/v2/pokemon-species/440/' + } + } + } + } + } + }, + 'is_baby': { + 'type': 'boolean', + 'example': True + }, + 'species': { + 'type': 'object', + 'required': [ 'name', 'url' ], + 'properties': { + 'name': { + 'type': 'string', + 'example': 'happiny' + }, + 'url': { + 'type': 'string', + 'format': 'uri', + 'example': 'https://pokeapi.co/api/v2/pokemon-species/440/' + } + } + } + } + }) def build_chain(self, obj): chain_id = obj.id From 8060b59125cc4790beb107d658d1200e2d4cb0f8 Mon Sep 17 00:00:00 2001 From: indyandie <1058837+Indyandie@users.noreply.github.com> Date: Mon, 4 Mar 2024 00:23:24 -0600 Subject: [PATCH 31/76] fix: add `pokeathlon_stat` schema_field definitions --- openapi.yml | 55 ++++++++++++++++++++++++++++++++- pokemon_v2/serializers.py | 64 ++++++++++++++++++++++++++++++++++++++- 2 files changed, 117 insertions(+), 2 deletions(-) diff --git a/openapi.yml b/openapi.yml index d507ff1c..58575e4b 100644 --- a/openapi.yml +++ b/openapi.yml @@ -6865,7 +6865,60 @@ components: maxLength: 100 affecting_natures: type: object - additionalProperties: {} + required: + - decrease + - increase + properties: + decrease: + type: array + items: + type: object + required: + - max_change + - nature + properties: + max_change: + type: number + maximum: -1 + example: -1 + nature: + type: object + required: + - name + - url + properties: + name: + type: string + example: hardy + url: + type: string + format: uri + example: https://pokeapi.co/api/v2/nature/1/ + increase: + type: array + items: + type: object + required: + - max_change + - nature + properties: + max_change: + type: number + minimum: 1 + example: 2 + nature: + type: object + required: + - name + - url + properties: + name: + type: string + example: hardy + url: + type: string + format: uri + example: https://pokeapi.co/api/v2/nature/1/ readOnly: true names: type: array diff --git a/pokemon_v2/serializers.py b/pokemon_v2/serializers.py index f336ea19..ec078601 100644 --- a/pokemon_v2/serializers.py +++ b/pokemon_v2/serializers.py @@ -5753,7 +5753,69 @@ class PokeathlonStatDetailSerializer(serializers.HyperlinkedModelSerializer): model = PokeathlonStat fields = ("id", "name", "affecting_natures", "names") - @extend_schema_field(OpenApiTypes.OBJECT) + @extend_schema_field(field={'type': 'object', + 'required': [ 'decrease', 'increase' ], + 'properties': { + 'decrease': { + 'type': 'array', + 'items': { + 'type': 'object', + 'required': [ 'max_change', 'nature' ], + 'properties': { + 'max_change': { + 'type': 'number', + 'maximum': -1, + 'example': -1 + }, + 'nature': { + 'type': 'object', + 'required': [ 'name', 'url' ], + 'properties': { + 'name': { + 'type': 'string', + 'example': 'hardy' + }, + 'url': { + 'type': 'string', + 'format': 'uri', + 'example': 'https://pokeapi.co/api/v2/nature/1/' + } + } + } + } + } + }, + 'increase': { + 'type': 'array', + 'items': { + 'type': 'object', + 'required': [ 'max_change', 'nature' ], + 'properties': { + 'max_change': { + 'type': 'number', + 'minimum': 1, + 'example': 2 + }, + 'nature': { + 'type': 'object', + 'required': [ 'name', 'url' ], + 'properties': { + 'name': { + 'type': 'string', + 'example': 'hardy' + }, + 'url': { + 'type': 'string', + 'format': 'uri', + 'example': 'https://pokeapi.co/api/v2/nature/1/' + } + } + } + } + } + } + } + }) def get_natures_that_affect(self, obj): stat_change_objects = NaturePokeathlonStat.objects.filter(pokeathlon_stat=obj) stat_changes = NaturePokeathlonStatSerializer( From 807fbc1869a3ac63c5f2b11b169bbda696f10e17 Mon Sep 17 00:00:00 2001 From: indyandie <1058837+Indyandie@users.noreply.github.com> Date: Mon, 4 Mar 2024 00:44:24 -0600 Subject: [PATCH 32/76] fix: add `pokedex` schema_field definitions --- openapi.yml | 41 ++++++++++++++++++++++++++++++---- pokemon_v2/serializers.py | 46 +++++++++++++++++++++++++++++++++++++-- 2 files changed, 81 insertions(+), 6 deletions(-) diff --git a/openapi.yml b/openapi.yml index 58575e4b..79dd0974 100644 --- a/openapi.yml +++ b/openapi.yml @@ -6986,14 +6986,47 @@ components: $ref: '#/components/schemas/PokedexName' readOnly: true pokemon_entries: - type: object - additionalProperties: {} + type: array + items: + type: object + required: + - entry_number + - pokemon_species + properties: + entry_number: + type: number + example: 1 + pokemon_species: + type: object + required: + - name + - url + properties: + name: + type: string + example: bulbasaur + url: + type: string + format: uri + example: https://pokeapi.co/api/v2/pokemon-species/1/ readOnly: true region: $ref: '#/components/schemas/RegionSummary' version_groups: - type: object - additionalProperties: {} + type: array + items: + type: object + required: + - name + - url + properties: + name: + type: string + example: the-teal-mask + url: + type: string + format: uri + example: https://pokeapi.co/api/v2/version-group/26/ readOnly: true required: - descriptions diff --git a/pokemon_v2/serializers.py b/pokemon_v2/serializers.py index ec078601..f2c0ee96 100644 --- a/pokemon_v2/serializers.py +++ b/pokemon_v2/serializers.py @@ -5874,7 +5874,33 @@ class PokedexDetailSerializer(serializers.ModelSerializer): "version_groups", ) - @extend_schema_field(OpenApiTypes.OBJECT) + @extend_schema_field(field={'type': 'array', + 'items': { + 'type': 'object', + 'required': [ 'entry_number', 'pokemon_species' ], + 'properties': { + 'entry_number': { + 'type': 'number', + 'example': 1 + }, + 'pokemon_species': { + 'type': 'object', + 'required': [ 'name', 'url' ], + 'properties': { + 'name': { + 'type': 'string', + 'example': 'bulbasaur' + }, + 'url': { + 'type': 'string', + 'format': 'uri', + 'example': 'https://pokeapi.co/api/v2/pokemon-species/1/' + } + } + } + } + } + }) def get_pokedex_entries(self, obj): results = PokemonDexNumber.objects.filter(pokedex=obj).order_by( "pokedex_number" @@ -5889,7 +5915,23 @@ class PokedexDetailSerializer(serializers.ModelSerializer): return data - @extend_schema_field(OpenApiTypes.OBJECT) + @extend_schema_field(field={'type': 'array', + 'items': { + 'type': 'object', + 'required': [ 'name', 'url' ], + 'properties': { + 'name': { + 'type': 'string', + 'example': 'the-teal-mask' + }, + 'url': { + 'type': 'string', + 'format': 'uri', + 'example': 'https://pokeapi.co/api/v2/version-group/26/' + } + } + } + }) def get_pokedex_version_groups(self, obj): dex_group_objects = PokedexVersionGroup.objects.filter(pokedex=obj) dex_groups = PokedexVersionGroupSerializer( From 8198fae37a1219353fb6512015efa550f13db9a9 Mon Sep 17 00:00:00 2001 From: indyandie <1058837+Indyandie@users.noreply.github.com> Date: Mon, 4 Mar 2024 01:05:48 -0600 Subject: [PATCH 33/76] fix: add `version-group` schema_field definitions --- openapi.yml | 48 +++++++++++++++++++++++++++---- pokemon_v2/serializers.py | 59 +++++++++++++++++++++++++++++++++++++-- 2 files changed, 98 insertions(+), 9 deletions(-) diff --git a/openapi.yml b/openapi.yml index 79dd0974..c3bed477 100644 --- a/openapi.yml +++ b/openapi.yml @@ -8682,16 +8682,52 @@ components: generation: $ref: '#/components/schemas/GenerationSummary' move_learn_methods: - type: object - additionalProperties: {} + type: array + items: + type: object + required: + - name + - url + properties: + name: + type: string + example: level-up + url: + type: string + format: uri + example: https://pokeapi.co/api/v2/move-learn-method/1/ readOnly: true pokedexes: - type: object - additionalProperties: {} + type: array + items: + type: object + required: + - name + - url + properties: + name: + type: string + example: kanto + url: + type: string + format: uri + example: https://pokeapi.co/api/v2/pokedex/2/ readOnly: true regions: - type: object - additionalProperties: {} + type: array + items: + type: object + required: + - name + - url + properties: + name: + type: string + example: kanto + url: + type: string + format: uri + example: https://pokeapi.co/api/v2/region/1/ readOnly: true versions: type: array diff --git a/pokemon_v2/serializers.py b/pokemon_v2/serializers.py index f2c0ee96..72111ad2 100644 --- a/pokemon_v2/serializers.py +++ b/pokemon_v2/serializers.py @@ -5991,7 +5991,24 @@ class VersionGroupDetailSerializer(serializers.ModelSerializer): "versions", ) - @extend_schema_field(OpenApiTypes.OBJECT) + @extend_schema_field(field={ + 'type': 'array', + 'items': { + 'type': 'object', + 'required': [ 'name', 'url' ], + 'properties': { + 'name': { + 'type': 'string', + 'example': 'kanto' + }, + 'url': { + 'type': 'string', + 'format': 'uri', + 'example': 'https://pokeapi.co/api/v2/region/1/' + } + } + } + }) def get_version_group_regions(self, obj): vg_regions = VersionGroupRegion.objects.filter(version_group=obj) data = VersionGroupRegionSerializer( @@ -6004,7 +6021,26 @@ class VersionGroupDetailSerializer(serializers.ModelSerializer): return regions - @extend_schema_field(OpenApiTypes.OBJECT) + # "name": "level-up", + # "url": "https://pokeapi.co/api/v2/move-learn-method/1/" + @extend_schema_field(field={ + 'type': 'array', + 'items': { + 'type': 'object', + 'required': [ 'name', 'url' ], + 'properties': { + 'name': { + 'type': 'string', + 'example': 'level-up' + }, + 'url': { + 'type': 'string', + 'format': 'uri', + 'example': 'https://pokeapi.co/api/v2/move-learn-method/1/' + } + } + } + }) def get_learn_methods(self, obj): learn_method_objects = VersionGroupMoveLearnMethod.objects.filter( version_group=obj @@ -6019,7 +6055,24 @@ class VersionGroupDetailSerializer(serializers.ModelSerializer): return methods - @extend_schema_field(OpenApiTypes.OBJECT) + @extend_schema_field(field={ + 'type': 'array', + 'items': { + 'type': 'object', + 'required': [ 'name', 'url' ], + 'properties': { + 'name': { + 'type': 'string', + 'example': 'kanto' + }, + 'url': { + 'type': 'string', + 'format': 'uri', + 'example': 'https://pokeapi.co/api/v2/pokedex/2/' + } + } + } + }) def get_version_groups_pokedexes(self, obj): dex_group_objects = PokedexVersionGroup.objects.filter(version_group=obj) dex_groups = PokedexVersionGroupSerializer( From 5c9a73d795856d2c532d029a035001c1d0124dfa Mon Sep 17 00:00:00 2001 From: indyandie <1058837+Indyandie@users.noreply.github.com> Date: Mon, 4 Mar 2024 02:47:43 -0600 Subject: [PATCH 34/76] fix: add `pokemon_encounters` `200` response --- openapi.yml | 98 +++++++++++++++++++++++++++++- pokemon_v2/api.py | 121 ++++++++++++++++++++++++++++++++++++-- pokemon_v2/serializers.py | 2 - 3 files changed, 213 insertions(+), 8 deletions(-) diff --git a/openapi.yml b/openapi.yml index c3bed477..da10a55d 100644 --- a/openapi.yml +++ b/openapi.yml @@ -2518,7 +2518,103 @@ paths: - {} responses: '200': - description: No response body + content: + application/json: + schema: + type: array + items: + type: object + required: + - location_area + - version_details + properties: + location_area: + type: object + required: + - name + - url + properties: + name: + type: string + example: cerulean-city-area + url: + type: string + format: uri + example: https://pokeapi.co/api/v2/location-area/281/ + version_details: + type: array + items: + type: object + required: + - encounter_details + - max_chance + - version + properties: + encounter_details: + type: array + items: + type: object + required: + - chance + - condition_values + - max_level + - method + - min_level + properties: + chance: + type: number + example: 100 + condition_values: + type: array + items: + type: object + required: + - name + - url + properties: + name: + type: string + example: story-progress-beat-red + url: + type: string + format: uri + example: https://pokeapi.co/api/v2/encounter-condition-value/55/ + max_level: + type: number + example: 10 + method: + type: object + required: + - name + - url + properties: + name: + type: string + example: gift + url: + type: string + format: uri + example: https://pokeapi.co/api/v2/encounter-method/18/ + min_level: + type: number + example: 10 + max_chance: + type: number + example: 100 + version: + type: object + required: + - name + - url + properties: + name: + type: string + example: red + url: + type: string + format: uri + example: https://pokeapi.co/api/v2/version/1/ + description: '' /api/v2/region/: get: operationId: region_list diff --git a/pokemon_v2/api.py b/pokemon_v2/api.py index 518985e5..fc672acd 100644 --- a/pokemon_v2/api.py +++ b/pokemon_v2/api.py @@ -837,12 +837,123 @@ class VersionGroupResource(PokeapiCommonViewset): description='Handles Pokemon Encounters as a sub-resource.', summary='Get pokemon encounter', tags=[ 'encounters' ], + responses={'200': { + 'type': 'array', + 'items': { + 'type': 'object', + 'required': [ 'location_area', 'version_details' ], + 'properties': { + 'location_area': { + 'type': 'object', + 'required': [ 'name', 'url' ], + 'properties': { + 'name': { + 'type': 'string', + 'example': 'cerulean-city-area' + }, + 'url': { + 'type': 'string', + 'format': 'uri', + 'example': 'https://pokeapi.co/api/v2/location-area/281/' + } + } + }, + 'version_details': { + 'type': 'array', + 'items': { + 'type': 'object', + 'required': [ + 'encounter_details', + 'max_chance', + 'version' + ], + 'properties': { + 'encounter_details': { + 'type': 'array', + 'items': { + 'type': 'object', + 'required': [ + 'chance', + 'condition_values', + 'max_level', + 'method', + 'min_level' + ], + 'properties': { + 'chance': { + 'type': 'number', + 'example': 100 + }, + 'condition_values': { + 'type': 'array', + 'items': { + 'type': 'object', + 'required': [ 'name', 'url' ], + 'properties': { + 'name': { + 'type': 'string', + 'example': 'story-progress-beat-red' + }, + 'url': { + 'type': 'string', + 'format': 'uri', + 'example': 'https://pokeapi.co/api/v2/encounter-condition-value/55/' + } + } + } + }, + 'max_level': { + 'type': 'number', + 'example': 10 + }, + 'method': { + 'type': 'object', + 'required': [ 'name', 'url' ], + 'properties': { + 'name': { + 'type': 'string', + 'example': 'gift' + }, + 'url': { + 'type': 'string', + 'format': 'uri', + 'example': 'https://pokeapi.co/api/v2/encounter-method/18/' + } + } + }, + 'min_level': { + 'type': 'number', + 'example': 10 + } + } + } + }, + 'max_chance': { + 'type': 'number', + 'example': 100 + }, + 'version': { + 'type': 'object', + 'required': [ 'name', 'url' ], + 'properties': { + 'name': { + 'type': 'string', + 'example': 'red' + }, + 'url': { + 'type': 'string', + 'format': 'uri', + 'example': 'https://pokeapi.co/api/v2/version/1/' + } + } + } + } + } + } + } + } + }} ) -@extend_schema_view( - list=extend_schema( - summary='List pokemon encounters', - ) -) class PokemonEncounterView(APIView): def get(self, request, pokemon_id): diff --git a/pokemon_v2/serializers.py b/pokemon_v2/serializers.py index 72111ad2..b45a4ac6 100644 --- a/pokemon_v2/serializers.py +++ b/pokemon_v2/serializers.py @@ -926,8 +926,6 @@ class EncounterDetailSerializer(serializers.ModelSerializer): "condition_values", ) - # no response at the moment - @extend_schema_field(OpenApiTypes.OBJECT) def get_encounter_conditions(self, obj): condition_values = EncounterConditionValueMap.objects.filter(encounter=obj) data = EncounterConditionValueMapSerializer( From cfff93d6ed9ebbbd4342aa80849ef497420e5452 Mon Sep 17 00:00:00 2001 From: indyandie <1058837+Indyandie@users.noreply.github.com> Date: Mon, 4 Mar 2024 03:06:12 -0600 Subject: [PATCH 35/76] global tags --- config/settings.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/config/settings.py b/config/settings.py index 00c7d392..58cc0870 100755 --- a/config/settings.py +++ b/config/settings.py @@ -147,6 +147,19 @@ SPECTACULAR_SETTINGS = { 'VERSION': '2.7.0', 'SERVE_INCLUDE_SCHEMA': False, 'OAS_VERSION': '3.1.0', - 'COMPONENT_SPLIT_REQUEST': True + 'COMPONENT_SPLIT_REQUEST': True, + 'TAGS': [ + 'pokemon', + 'evolution', + 'berries', + 'items', + 'machines', + 'location', + 'contest', + 'moves', + 'encounters', + 'games', + 'utility' + ] } From 2b794c0ec690156e152fcedec3ff2e5f98cb3509 Mon Sep 17 00:00:00 2001 From: indyandie <1058837+Indyandie@users.noreply.github.com> Date: Mon, 4 Mar 2024 03:06:51 -0600 Subject: [PATCH 36/76] global tags --- openapi.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/openapi.yml b/openapi.yml index da10a55d..6f12202b 100644 --- a/openapi.yml +++ b/openapi.yml @@ -8885,5 +8885,17 @@ components: name: sessionid servers: - url: https://pokeapi.co +tags: +- pokemon +- evolution +- berries +- items +- machines +- location +- contest +- moves +- encounters +- games +- utility externalDocs: url: https://pokeapi.co/docs/v2 From c7c2c46f496456d5a05d4745dd603a1950f2c8dc Mon Sep 17 00:00:00 2001 From: indyandie <1058837+Indyandie@users.noreply.github.com> Date: Mon, 4 Mar 2024 03:07:09 -0600 Subject: [PATCH 37/76] typo --- pokemon_v2/api.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pokemon_v2/api.py b/pokemon_v2/api.py index fc672acd..912d90ca 100644 --- a/pokemon_v2/api.py +++ b/pokemon_v2/api.py @@ -723,12 +723,12 @@ class PokemonResource(PokeapiCommonViewset): @extend_schema( description='A Pokémon Species forms the basis for at least one Pokémon. Attributes of a Pokémon species are shared across all varieties of Pokémon within the species. A good example is Wormadam; Wormadam is the species which can be found in three different varieties, Wormadam-Trash, Wormadam-Sandy and Wormadam-Plant.', - summary='Get pokemon spec', + summary='Get pokemon species', tags=[ 'pokemon' ], ) @extend_schema_view( list=extend_schema( - summary='List pokemon specs', + summary='List pokemon species', ) ) class PokemonSpeciesResource(PokeapiCommonViewset): From 4688b0d071adcd9ec6b0693bf091ed54af1dfe5a Mon Sep 17 00:00:00 2001 From: indyandie <1058837+Indyandie@users.noreply.github.com> Date: Tue, 5 Mar 2024 00:37:02 -0600 Subject: [PATCH 38/76] tidy --- config/settings.py | 4 ++-- pokemon_v2/api.py | 4 ++-- pokemon_v2/serializers.py | 43 +++++++++++++++++++-------------------- 3 files changed, 25 insertions(+), 26 deletions(-) diff --git a/config/settings.py b/config/settings.py index 58cc0870..e561bc64 100755 --- a/config/settings.py +++ b/config/settings.py @@ -159,7 +159,7 @@ SPECTACULAR_SETTINGS = { 'moves', 'encounters', 'games', - 'utility' - ] + 'utility', + ], } diff --git a/pokemon_v2/api.py b/pokemon_v2/api.py index 912d90ca..27ee6c9d 100644 --- a/pokemon_v2/api.py +++ b/pokemon_v2/api.py @@ -4,7 +4,7 @@ from rest_framework.response import Response from rest_framework.views import APIView from django.shortcuts import get_object_or_404 from django.http import Http404 -from drf_spectacular.utils import extend_schema, extend_schema_serializer, extend_schema_view +from drf_spectacular.utils import extend_schema, extend_schema_view from .models import * from .serializers import * @@ -862,7 +862,7 @@ class VersionGroupResource(PokeapiCommonViewset): 'type': 'array', 'items': { 'type': 'object', - 'required': [ + 'required': [ 'encounter_details', 'max_chance', 'version' diff --git a/pokemon_v2/serializers.py b/pokemon_v2/serializers.py index b45a4ac6..fd4db022 100644 --- a/pokemon_v2/serializers.py +++ b/pokemon_v2/serializers.py @@ -2,8 +2,7 @@ from collections import OrderedDict import json from django.urls import reverse from rest_framework import serializers -from drf_spectacular.types import OpenApiTypes -from drf_spectacular.utils import extend_schema_field, extend_schema, OpenApiParameter, OpenApiExample, extend_schema_serializer +from drf_spectacular.utils import extend_schema_field # pylint: disable=redefined-builtin @@ -1115,7 +1114,7 @@ class LocationAreaDetailSerializer(serializers.ModelSerializer): }, 'encounter_details': { 'type': 'object', - 'required': [ + 'required': [ 'min_level', 'max_level', 'condition_value', @@ -2106,13 +2105,13 @@ class BerryFlavorDetailSerializer(serializers.ModelSerializer): fields = ("id", "name", "berries", "contest_type", "names") @extend_schema_field(field={'type': 'array', - 'items': { + 'items': { 'type': 'object', 'required': [ 'potency', 'berry' ], 'properties': { 'potency': { 'type': 'integer', - 'example': 10 + 'example': 10 }, 'berry': { 'type': 'object', @@ -2172,13 +2171,13 @@ class BerryDetailSerializer(serializers.ModelSerializer): ) @extend_schema_field(field={'type': 'array', - 'items': { + 'items': { 'type': 'object', 'required': [ 'potency', 'flavor' ], 'properties': { 'potency': { 'type': 'integer', - 'example': 10 + 'example': 10 }, 'flavor': { 'type': 'object', @@ -2243,14 +2242,14 @@ class EggGroupDetailSerializer(serializers.ModelSerializer): fields = ("id", "name", "names", "pokemon_species") @extend_schema_field(field={'type': 'array', - 'items': { + 'items': { 'type': 'object', 'required': [ 'potency', 'flavor' ], 'properties': { 'name': { 'type': 'string', 'description': 'Pokemon species name.', - 'example': 'bulbasaur' + 'example': 'bulbasaur' }, 'url': { 'type': 'string', @@ -2364,7 +2363,7 @@ class TypeDetailSerializer(serializers.ModelSerializer): 'half_damage_from', 'double_damage_from' ], - 'properties': { + 'properties': { 'no_damage_to': { 'type': 'array', 'items': { @@ -2540,7 +2539,7 @@ class TypeDetailSerializer(serializers.ModelSerializer): # returns past type relationships for the given type object @extend_schema_field(field={'type': 'array', - 'items': { + 'items': { 'type': 'object', 'required': [ 'generation', 'damage_relations' ], 'properties': { @@ -2569,7 +2568,7 @@ class TypeDetailSerializer(serializers.ModelSerializer): 'half_damage_from', 'double_damage_from' ], - 'properties': { + 'properties': { 'no_damage_to': { 'type': 'array', 'items': { @@ -2778,13 +2777,13 @@ class TypeDetailSerializer(serializers.ModelSerializer): return gen_introduced.id <= current_gen.id @extend_schema_field(field={'type': 'array', - 'items': { + 'items': { 'type': 'object', 'required': [ 'potency', 'flavor' ], 'properties': { 'slot': { 'type': 'integer', - 'example': 1 + 'example': 1 }, 'pokemon': { 'type': 'object', @@ -2913,7 +2912,7 @@ class MoveMetaAilmentDetailSerializer(serializers.ModelSerializer): fields = ("id", "name", "moves", "names") @extend_schema_field(field={'type': 'array', - 'items': { + 'items': { 'type': 'object', 'required': [ 'name', 'url' ], 'properties': { @@ -2960,7 +2959,7 @@ class MoveMetaCategoryDetailSerializer(serializers.ModelSerializer): fields = ("id", "name", "descriptions", "moves") @extend_schema_field(field={'type': 'array', - 'items': { + 'items': { 'type': 'object', 'required': [ 'name', 'url' ], 'properties': { @@ -3071,7 +3070,7 @@ class MoveChangeSerializer(serializers.ModelSerializer): ) @extend_schema_field(field={'type': 'array', - 'items': { + 'items': { 'type': 'object', 'required': [ 'effect', 'short_effect', 'language' ], 'properties': { @@ -3199,7 +3198,7 @@ class MoveDetailSerializer(serializers.ModelSerializer): ) @extend_schema_field(field={'type': 'array', - 'items': { + 'items': { 'type': 'object', 'required': [ 'name', 'url' ], 'properties': { @@ -3233,7 +3232,7 @@ class MoveDetailSerializer(serializers.ModelSerializer): return pokemon_list @extend_schema_field(field={'type': 'array', - 'items': { + 'items': { 'type': 'object', 'required': [ 'machine', 'version_group' ], 'properties': { @@ -3287,7 +3286,7 @@ class MoveDetailSerializer(serializers.ModelSerializer): return machines @extend_schema_field(field={'type': 'object', - 'properties': { + 'properties': { 'required': [ 'normal', 'super' ], 'normal': { 'type': 'object', @@ -3437,7 +3436,7 @@ class MoveDetailSerializer(serializers.ModelSerializer): return details @extend_schema_field(field={'type': 'array', - 'items': { + 'items': { 'type': 'object', 'required': [ 'effect', 'short_effect', 'language' ], 'properties': { @@ -3482,7 +3481,7 @@ class MoveDetailSerializer(serializers.ModelSerializer): return data @extend_schema_field(field={'type': 'array', - 'items': { + 'items': { 'type': 'object', 'required': [ 'effect_entries', 'version_group' ], 'properties': { From ae48daee015d9d64cd80661d819a0e1cd6e664f5 Mon Sep 17 00:00:00 2001 From: indyandie <1058837+Indyandie@users.noreply.github.com> Date: Tue, 5 Mar 2024 00:42:10 -0600 Subject: [PATCH 39/76] docs(openapi): update `openapi.yml` --- openapi.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openapi.yml b/openapi.yml index 6f12202b..19550827 100644 --- a/openapi.yml +++ b/openapi.yml @@ -2413,7 +2413,7 @@ paths: of a Pokémon species are shared across all varieties of Pokémon within the species. A good example is Wormadam; Wormadam is the species which can be found in three different varieties, Wormadam-Trash, Wormadam-Sandy and Wormadam-Plant. - summary: List pokemon specs + summary: List pokemon species parameters: - name: limit required: false @@ -2447,7 +2447,7 @@ paths: of a Pokémon species are shared across all varieties of Pokémon within the species. A good example is Wormadam; Wormadam is the species which can be found in three different varieties, Wormadam-Trash, Wormadam-Sandy and Wormadam-Plant. - summary: Get pokemon spec + summary: Get pokemon species parameters: - in: path name: id From e51c11e8b887271d0f6c8ceeaae0b5a129dac7f6 Mon Sep 17 00:00:00 2001 From: indyandie <1058837+Indyandie@users.noreply.github.com> Date: Tue, 5 Mar 2024 00:53:45 -0600 Subject: [PATCH 40/76] ci(nix-shell): add `black` --- default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/default.nix b/default.nix index 1775fe38..f5ae82fe 100644 --- a/default.nix +++ b/default.nix @@ -18,6 +18,7 @@ in pkgs.mkShell rec { # python310Packages.django-cors-headers # Required dependancies + black taglib openssl git From d7726206998bc9e047e467e00f6c73c097d88914 Mon Sep 17 00:00:00 2001 From: indyandie <1058837+Indyandie@users.noreply.github.com> Date: Tue, 5 Mar 2024 00:54:48 -0600 Subject: [PATCH 41/76] test: `make format` --- config/settings.py | 45 +- pokemon_v2/api.py | 800 ++++--- pokemon_v2/serializers.py | 4439 ++++++++++++++++++------------------- 3 files changed, 2561 insertions(+), 2723 deletions(-) diff --git a/config/settings.py b/config/settings.py index e561bc64..98d3bbdf 100755 --- a/config/settings.py +++ b/config/settings.py @@ -99,7 +99,7 @@ INSTALLED_APPS = ( "corsheaders", "rest_framework", "cachalot", - 'drf_spectacular', + "drf_spectacular", ) + CUSTOM_APPS @@ -117,7 +117,7 @@ REST_FRAMEWORK = { "DEFAULT_PAGINATION_CLASS": "rest_framework.pagination.LimitOffsetPagination", "PAGE_SIZE": 20, "PAGINATE_BY": 20, - 'DEFAULT_SCHEMA_CLASS': 'drf_spectacular.openapi.AutoSchema', + "DEFAULT_SCHEMA_CLASS": "drf_spectacular.openapi.AutoSchema", } @@ -140,26 +140,25 @@ TEMPLATES = [ DEFAULT_AUTO_FIELD = "django.db.models.AutoField" SPECTACULAR_SETTINGS = { - 'TITLE': 'pokeapi', - 'DESCRIPTION': 'A RESTful API for Pokémon.', - 'SERVERS': [{'url': 'https://pokeapi.co'}], - 'EXTERNAL_DOCS': {'url': 'https://pokeapi.co/docs/v2'}, - 'VERSION': '2.7.0', - 'SERVE_INCLUDE_SCHEMA': False, - 'OAS_VERSION': '3.1.0', - 'COMPONENT_SPLIT_REQUEST': True, - 'TAGS': [ - 'pokemon', - 'evolution', - 'berries', - 'items', - 'machines', - 'location', - 'contest', - 'moves', - 'encounters', - 'games', - 'utility', + "TITLE": "pokeapi", + "DESCRIPTION": "A RESTful API for Pokémon.", + "SERVERS": [{"url": "https://pokeapi.co"}], + "EXTERNAL_DOCS": {"url": "https://pokeapi.co/docs/v2"}, + "VERSION": "2.7.0", + "SERVE_INCLUDE_SCHEMA": False, + "OAS_VERSION": "3.1.0", + "COMPONENT_SPLIT_REQUEST": True, + "TAGS": [ + "pokemon", + "evolution", + "berries", + "items", + "machines", + "location", + "contest", + "moves", + "encounters", + "games", + "utility", ], } - diff --git a/pokemon_v2/api.py b/pokemon_v2/api.py index 27ee6c9d..77512e0e 100644 --- a/pokemon_v2/api.py +++ b/pokemon_v2/api.py @@ -72,9 +72,9 @@ class PokeapiCommonViewset( @extend_schema( - description='Abilities provide passive effects for Pokémon in battle or in the overworld. Pokémon have multiple possible abilities but can have only one ability at a time. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Ability) for greater detail.', - tags=[ 'pokemon' ], - ) + description="Abilities provide passive effects for Pokémon in battle or in the overworld. Pokémon have multiple possible abilities but can have only one ability at a time. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Ability) for greater detail.", + tags=["pokemon"], +) class AbilityResource(PokeapiCommonViewset): queryset = Ability.objects.all() serializer_class = AbilityDetailSerializer @@ -82,14 +82,14 @@ class AbilityResource(PokeapiCommonViewset): @extend_schema( - description='Berries are small fruits that can provide HP and status condition restoration, stat enhancement, and even damage negation when eaten by Pokémon. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Berry) for greater detail.', - tags=[ 'berries' ], - summary='Get a berry', - ) + description="Berries are small fruits that can provide HP and status condition restoration, stat enhancement, and even damage negation when eaten by Pokémon. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Berry) for greater detail.", + tags=["berries"], + summary="Get a berry", +) @extend_schema_view( list=extend_schema( - summary='List berries', - ) + summary="List berries", + ) ) class BerryResource(PokeapiCommonViewset): queryset = Berry.objects.all() @@ -98,14 +98,14 @@ class BerryResource(PokeapiCommonViewset): @extend_schema( - description='Berries can be soft or hard. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Category:Berries_by_firmness) for greater detail.', - tags=[ 'berries' ], - summary='Get berry by firmness', - ) + description="Berries can be soft or hard. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Category:Berries_by_firmness) for greater detail.", + tags=["berries"], + summary="Get berry by firmness", +) @extend_schema_view( list=extend_schema( - summary='List berry firmness', - ) + summary="List berry firmness", + ) ) class BerryFirmnessResource(PokeapiCommonViewset): queryset = BerryFirmness.objects.all() @@ -114,14 +114,14 @@ class BerryFirmnessResource(PokeapiCommonViewset): @extend_schema( - description='Flavors determine whether a Pokémon will benefit or suffer from eating a berry based on their **nature**. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Flavor) for greater detail.', - summary='Get berries by flavor', - tags=[ 'berries' ], - ) + description="Flavors determine whether a Pokémon will benefit or suffer from eating a berry based on their **nature**. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Flavor) for greater detail.", + summary="Get berries by flavor", + tags=["berries"], +) @extend_schema_view( list=extend_schema( - summary='List berry flavors', - ) + summary="List berry flavors", + ) ) class BerryFlavorResource(PokeapiCommonViewset): queryset = BerryFlavor.objects.all() @@ -130,14 +130,14 @@ class BerryFlavorResource(PokeapiCommonViewset): @extend_schema( - description='Characteristics indicate which stat contains a Pokémon\'s highest IV. A Pokémon\'s Characteristic is determined by the remainder of its highest IV divided by 5 (gene_modulo). Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Characteristic) for greater detail.', - summary='Get charecterictic', - tags=[ 'pokemon' ], - ) + description="Characteristics indicate which stat contains a Pokémon's highest IV. A Pokémon's Characteristic is determined by the remainder of its highest IV divided by 5 (gene_modulo). Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Characteristic) for greater detail.", + summary="Get charecterictic", + tags=["pokemon"], +) @extend_schema_view( list=extend_schema( - summary='List charecterictics', - ) + summary="List charecterictics", + ) ) class CharacteristicResource(PokeapiCommonViewset): queryset = Characteristic.objects.all() @@ -146,14 +146,14 @@ class CharacteristicResource(PokeapiCommonViewset): @extend_schema( - description='Contest effects refer to the effects of moves when used in contests.', - tags=[ 'contests' ], - summary='Get contest effect', - ) + description="Contest effects refer to the effects of moves when used in contests.", + tags=["contests"], + summary="Get contest effect", +) @extend_schema_view( list=extend_schema( - summary='List contest effects', - ) + summary="List contest effects", + ) ) class ContestEffectResource(PokeapiCommonViewset): queryset = ContestEffect.objects.all() @@ -162,14 +162,14 @@ class ContestEffectResource(PokeapiCommonViewset): @extend_schema( - description='Contest types are categories judges used to weigh a Pokémon\'s condition in Pokémon contests. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Contest_condition) for greater detail.', - summary='Get contest type', - tags=[ 'contests' ], - ) + description="Contest types are categories judges used to weigh a Pokémon's condition in Pokémon contests. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Contest_condition) for greater detail.", + summary="Get contest type", + tags=["contests"], +) @extend_schema_view( list=extend_schema( - summary='List contest types', - ) + summary="List contest types", + ) ) class ContestTypeResource(PokeapiCommonViewset): queryset = ContestType.objects.all() @@ -178,14 +178,14 @@ class ContestTypeResource(PokeapiCommonViewset): @extend_schema( - description='Egg Groups are categories which determine which Pokémon are able to interbreed. Pokémon may belong to either one or two Egg Groups. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Egg_Group) for greater detail.', - summary='Get egg group', - tags=[ 'pokemon' ], - ) + description="Egg Groups are categories which determine which Pokémon are able to interbreed. Pokémon may belong to either one or two Egg Groups. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Egg_Group) for greater detail.", + summary="Get egg group", + tags=["pokemon"], +) @extend_schema_view( list=extend_schema( - summary='List egg groups', - ) + summary="List egg groups", + ) ) class EggGroupResource(PokeapiCommonViewset): queryset = EggGroup.objects.all() @@ -194,14 +194,14 @@ class EggGroupResource(PokeapiCommonViewset): @extend_schema( - description='Conditions which affect what pokemon might appear in the wild, e.g., day or night.', - summary='Get encounter condition', - tags=[ 'encounters' ], - ) + description="Conditions which affect what pokemon might appear in the wild, e.g., day or night.", + summary="Get encounter condition", + tags=["encounters"], +) @extend_schema_view( list=extend_schema( - summary='List encounter conditions', - ) + summary="List encounter conditions", + ) ) class EncounterConditionResource(PokeapiCommonViewset): queryset = EncounterCondition.objects.all() @@ -210,14 +210,14 @@ class EncounterConditionResource(PokeapiCommonViewset): @extend_schema( - description='Encounter condition values are the various states that an encounter condition can have, i.e., time of day can be either day or night.', - summary='Get encounter condition value', - tags=[ 'encounters' ], - ) + description="Encounter condition values are the various states that an encounter condition can have, i.e., time of day can be either day or night.", + summary="Get encounter condition value", + tags=["encounters"], +) @extend_schema_view( list=extend_schema( - summary='List encounter condition values', - ) + summary="List encounter condition values", + ) ) class EncounterConditionValueResource(PokeapiCommonViewset): queryset = EncounterConditionValue.objects.all() @@ -226,14 +226,14 @@ class EncounterConditionValueResource(PokeapiCommonViewset): @extend_schema( - description='Methods by which the player might can encounter Pokémon in the wild, e.g., walking in tall grass. Check out Bulbapedia for greater detail.', - summary='Get encounter method', - tags=[ 'encounters' ], - ) + description="Methods by which the player might can encounter Pokémon in the wild, e.g., walking in tall grass. Check out Bulbapedia for greater detail.", + summary="Get encounter method", + tags=["encounters"], +) @extend_schema_view( list=extend_schema( - summary='List encounter methods', - ) + summary="List encounter methods", + ) ) class EncounterMethodResource(PokeapiCommonViewset): queryset = EncounterMethod.objects.all() @@ -242,14 +242,14 @@ class EncounterMethodResource(PokeapiCommonViewset): @extend_schema( - description='Evolution chains are essentially family trees. They start with the lowest stage within a family and detail evolution conditions for each as well as Pokémon they can evolve into up through the hierarchy.', - summary='Get evolution chain', - tags=[ 'evolution' ], - ) + description="Evolution chains are essentially family trees. They start with the lowest stage within a family and detail evolution conditions for each as well as Pokémon they can evolve into up through the hierarchy.", + summary="Get evolution chain", + tags=["evolution"], +) @extend_schema_view( list=extend_schema( - summary='List evolution chains', - ) + summary="List evolution chains", + ) ) class EvolutionChainResource(PokeapiCommonViewset): queryset = EvolutionChain.objects.all() @@ -258,14 +258,14 @@ class EvolutionChainResource(PokeapiCommonViewset): @extend_schema( - description='Evolution triggers are the events and conditions that cause a Pokémon to evolve. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Methods_of_evolution) for greater detail.', - summary='Get evolution trigger', - tags=[ 'evolution' ], - ) + description="Evolution triggers are the events and conditions that cause a Pokémon to evolve. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Methods_of_evolution) for greater detail.", + summary="Get evolution trigger", + tags=["evolution"], +) @extend_schema_view( list=extend_schema( - summary='List evolution triggers', - ) + summary="List evolution triggers", + ) ) class EvolutionTriggerResource(PokeapiCommonViewset): queryset = EvolutionTrigger.objects.all() @@ -274,14 +274,14 @@ class EvolutionTriggerResource(PokeapiCommonViewset): @extend_schema( - description='A generation is a grouping of the Pokémon games that separates them based on the Pokémon they include. In each generation, a new set of Pokémon, Moves, Abilities and Types that did not exist in the previous generation are released.', - summary='Get genration', - tags=[ 'games' ], - ) + description="A generation is a grouping of the Pokémon games that separates them based on the Pokémon they include. In each generation, a new set of Pokémon, Moves, Abilities and Types that did not exist in the previous generation are released.", + summary="Get genration", + tags=["games"], +) @extend_schema_view( list=extend_schema( - summary='List genrations', - ) + summary="List genrations", + ) ) class GenerationResource(PokeapiCommonViewset): queryset = Generation.objects.all() @@ -290,14 +290,14 @@ class GenerationResource(PokeapiCommonViewset): @extend_schema( - description='Genders were introduced in Generation II for the purposes of breeding Pokémon but can also result in visual differences or even different evolutionary lines. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Gender) for greater detail.', - summary='Get gender', - tags=[ 'pokemon' ], - ) + description="Genders were introduced in Generation II for the purposes of breeding Pokémon but can also result in visual differences or even different evolutionary lines. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Gender) for greater detail.", + summary="Get gender", + tags=["pokemon"], +) @extend_schema_view( list=extend_schema( - summary='List genders', - ) + summary="List genders", + ) ) class GenderResource(PokeapiCommonViewset): queryset = Gender.objects.all() @@ -306,14 +306,14 @@ class GenderResource(PokeapiCommonViewset): @extend_schema( - description='Growth rates are the speed with which Pokémon gain levels through experience. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Experience) for greater detail.', - summary='Get growth rate', - tags=[ 'pokemon' ], - ) + description="Growth rates are the speed with which Pokémon gain levels through experience. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Experience) for greater detail.", + summary="Get growth rate", + tags=["pokemon"], +) @extend_schema_view( list=extend_schema( - summary='List growth rates', - ) + summary="List growth rates", + ) ) class GrowthRateResource(PokeapiCommonViewset): queryset = GrowthRate.objects.all() @@ -322,14 +322,14 @@ class GrowthRateResource(PokeapiCommonViewset): @extend_schema( - description='An item is an object in the games which the player can pick up, keep in their bag, and use in some manner. They have various uses, including healing, powering up, helping catch Pokémon, or to access a new area.', - summary='Get item', - tags=[ 'items' ], - ) + description="An item is an object in the games which the player can pick up, keep in their bag, and use in some manner. They have various uses, including healing, powering up, helping catch Pokémon, or to access a new area.", + summary="Get item", + tags=["items"], +) @extend_schema_view( list=extend_schema( - summary='List items', - ) + summary="List items", + ) ) class ItemResource(PokeapiCommonViewset): queryset = Item.objects.all() @@ -338,14 +338,14 @@ class ItemResource(PokeapiCommonViewset): @extend_schema( - description='Item categories determine where items will be placed in the players bag.', - summary='Get item category', - tags=[ 'items' ], - ) + description="Item categories determine where items will be placed in the players bag.", + summary="Get item category", + tags=["items"], +) @extend_schema_view( list=extend_schema( - summary='List item categories', - ) + summary="List item categories", + ) ) class ItemCategoryResource(PokeapiCommonViewset): queryset = ItemCategory.objects.all() @@ -354,14 +354,14 @@ class ItemCategoryResource(PokeapiCommonViewset): @extend_schema( - description='Item attributes define particular aspects of items, e.g."usable in battle" or "consumable".', - summary='Get item attribute', - tags=[ 'items' ], - ) + description='Item attributes define particular aspects of items, e.g."usable in battle" or "consumable".', + summary="Get item attribute", + tags=["items"], +) @extend_schema_view( list=extend_schema( - summary='List item attributes', - ) + summary="List item attributes", + ) ) class ItemAttributeResource(PokeapiCommonViewset): queryset = ItemAttribute.objects.all() @@ -370,14 +370,14 @@ class ItemAttributeResource(PokeapiCommonViewset): @extend_schema( - description='The various effects of the move"Fling" when used with different items.', - summary='Get item fling effect', - tags=[ 'items' ], - ) + description='The various effects of the move"Fling" when used with different items.', + summary="Get item fling effect", + tags=["items"], +) @extend_schema_view( list=extend_schema( - summary='List item fling effects', - ) + summary="List item fling effects", + ) ) class ItemFlingEffectResource(PokeapiCommonViewset): queryset = ItemFlingEffect.objects.all() @@ -386,14 +386,14 @@ class ItemFlingEffectResource(PokeapiCommonViewset): @extend_schema( - description='Pockets within the players bag used for storing items by category.', - summary='Get item pocket', - tags=[ 'items' ], - ) + description="Pockets within the players bag used for storing items by category.", + summary="Get item pocket", + tags=["items"], +) @extend_schema_view( list=extend_schema( - summary='List item pockets', - ) + summary="List item pockets", + ) ) class ItemPocketResource(PokeapiCommonViewset): queryset = ItemPocket.objects.all() @@ -402,14 +402,14 @@ class ItemPocketResource(PokeapiCommonViewset): @extend_schema( - description='Languages for translations of API resource information.', - summary='Get language', - tags=[ 'utility' ], - ) + description="Languages for translations of API resource information.", + summary="Get language", + tags=["utility"], +) @extend_schema_view( list=extend_schema( - summary='List languages', - ) + summary="List languages", + ) ) class LanguageResource(PokeapiCommonViewset): queryset = Language.objects.all() @@ -418,14 +418,14 @@ class LanguageResource(PokeapiCommonViewset): @extend_schema( - description='Locations that can be visited within the games. Locations make up sizable portions of regions, like cities or routes.', - summary='Get location', - tags=[ 'location' ], - ) + description="Locations that can be visited within the games. Locations make up sizable portions of regions, like cities or routes.", + summary="Get location", + tags=["location"], +) @extend_schema_view( list=extend_schema( - summary='List locations', - ) + summary="List locations", + ) ) class LocationResource(PokeapiCommonViewset): queryset = Location.objects.all() @@ -434,14 +434,14 @@ class LocationResource(PokeapiCommonViewset): @extend_schema( - description='Location areas are sections of areas, such as floors in a building or cave. Each area has its own set of possible Pokémon encounters.', - summary='Get location area', - tags=[ 'location' ], - ) + description="Location areas are sections of areas, such as floors in a building or cave. Each area has its own set of possible Pokémon encounters.", + summary="Get location area", + tags=["location"], +) @extend_schema_view( list=extend_schema( - summary='List location areas', - ) + summary="List location areas", + ) ) class LocationAreaResource(ListOrDetailSerialRelation, viewsets.ReadOnlyModelViewSet): queryset = LocationArea.objects.all() @@ -450,14 +450,14 @@ class LocationAreaResource(ListOrDetailSerialRelation, viewsets.ReadOnlyModelVie @extend_schema( - description='Machines are the representation of items that teach moves to Pokémon. They vary from version to version, so it is not certain that one specific TM or HM corresponds to a single Machine.', - summary='Get machine', - tags=[ 'machines' ], - ) + description="Machines are the representation of items that teach moves to Pokémon. They vary from version to version, so it is not certain that one specific TM or HM corresponds to a single Machine.", + summary="Get machine", + tags=["machines"], +) @extend_schema_view( list=extend_schema( - summary='List machines', - ) + summary="List machines", + ) ) class MachineResource(PokeapiCommonViewset): queryset = Machine.objects.all() @@ -466,14 +466,14 @@ class MachineResource(PokeapiCommonViewset): @extend_schema( - description='Moves are the skills of Pokémon in battle. In battle, a Pokémon uses one move each turn. Some moves (including those learned by Hidden Machine) can be used outside of battle as well, usually for the purpose of removing obstacles or exploring new areas.', - summary='Get move', - tags=[ 'moves' ], - ) + description="Moves are the skills of Pokémon in battle. In battle, a Pokémon uses one move each turn. Some moves (including those learned by Hidden Machine) can be used outside of battle as well, usually for the purpose of removing obstacles or exploring new areas.", + summary="Get move", + tags=["moves"], +) @extend_schema_view( list=extend_schema( - summary='List moves', - ) + summary="List moves", + ) ) class MoveResource(PokeapiCommonViewset): queryset = Move.objects.all() @@ -482,14 +482,14 @@ class MoveResource(PokeapiCommonViewset): @extend_schema( - description='Damage classes moves can have, e.g. physical, special, or non-damaging.', - summary='Get move damage class', - tags=[ 'pokemon' ], - ) + description="Damage classes moves can have, e.g. physical, special, or non-damaging.", + summary="Get move damage class", + tags=["pokemon"], +) @extend_schema_view( list=extend_schema( - summary='List move damage classes', - ) + summary="List move damage classes", + ) ) class MoveDamageClassResource(PokeapiCommonViewset): queryset = MoveDamageClass.objects.all() @@ -498,14 +498,14 @@ class MoveDamageClassResource(PokeapiCommonViewset): @extend_schema( - description='Move Ailments are status conditions caused by moves used during battle. See [Bulbapedia](https://bulbapedia.bulbagarden.net/wiki/Status_condition) for greater detail.', - summary='Get move meta ailment', - tags=[ 'moves' ], - ) + description="Move Ailments are status conditions caused by moves used during battle. See [Bulbapedia](https://bulbapedia.bulbagarden.net/wiki/Status_condition) for greater detail.", + summary="Get move meta ailment", + tags=["moves"], +) @extend_schema_view( list=extend_schema( - summary='List move meta ailments', - ) + summary="List move meta ailments", + ) ) class MoveMetaAilmentResource(PokeapiCommonViewset): queryset = MoveMetaAilment.objects.all() @@ -514,14 +514,14 @@ class MoveMetaAilmentResource(PokeapiCommonViewset): @extend_schema( - description='Styles of moves when used in the Battle Palace. See [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Battle_Frontier_(Generation_III)) for greater detail.', - summary='Get move battle style', - tags=[ 'moves' ], - ) + description="Styles of moves when used in the Battle Palace. See [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Battle_Frontier_(Generation_III)) for greater detail.", + summary="Get move battle style", + tags=["moves"], +) @extend_schema_view( list=extend_schema( - summary='List move battle styles', - ) + summary="List move battle styles", + ) ) class MoveBattleStyleResource(PokeapiCommonViewset): queryset = MoveBattleStyle.objects.all() @@ -530,14 +530,14 @@ class MoveBattleStyleResource(PokeapiCommonViewset): @extend_schema( - description='Very general categories that loosely group move effects.', - summary='Get move meta category', - tags=[ 'moves' ], - ) + description="Very general categories that loosely group move effects.", + summary="Get move meta category", + tags=["moves"], +) @extend_schema_view( list=extend_schema( - summary='List move meta categories', - ) + summary="List move meta categories", + ) ) class MoveMetaCategoryResource(PokeapiCommonViewset): queryset = MoveMetaCategory.objects.all() @@ -546,14 +546,14 @@ class MoveMetaCategoryResource(PokeapiCommonViewset): @extend_schema( - description='Methods by which Pokémon can learn moves.', - summary='Get move learn method', - tags=[ 'moves' ], - ) + description="Methods by which Pokémon can learn moves.", + summary="Get move learn method", + tags=["moves"], +) @extend_schema_view( list=extend_schema( - summary='List move learn methods', - ) + summary="List move learn methods", + ) ) class MoveLearnMethodResource(PokeapiCommonViewset): queryset = MoveLearnMethod.objects.all() @@ -562,14 +562,14 @@ class MoveLearnMethodResource(PokeapiCommonViewset): @extend_schema( - description='Targets moves can be directed at during battle. Targets can be Pokémon, environments or even other moves.', - summary='Get move target', - tags=[ 'moves' ], - ) + description="Targets moves can be directed at during battle. Targets can be Pokémon, environments or even other moves.", + summary="Get move target", + tags=["moves"], +) @extend_schema_view( list=extend_schema( - summary='List move targets', - ) + summary="List move targets", + ) ) class MoveTargetResource(PokeapiCommonViewset): queryset = MoveTarget.objects.all() @@ -578,14 +578,14 @@ class MoveTargetResource(PokeapiCommonViewset): @extend_schema( - description='Natures influence how a Pokémon\'s stats grow. See [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Nature) for greater detail.', - summary='Get nature', - tags=[ 'pokemon' ], - ) + description="Natures influence how a Pokémon's stats grow. See [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Nature) for greater detail.", + summary="Get nature", + tags=["pokemon"], +) @extend_schema_view( list=extend_schema( - summary='List natures', - ) + summary="List natures", + ) ) class NatureResource(PokeapiCommonViewset): queryset = Nature.objects.all() @@ -594,14 +594,14 @@ class NatureResource(PokeapiCommonViewset): @extend_schema( - description='Areas used for grouping Pokémon encounters in Pal Park. They\'re like habitats that are specific to Pal Park.', - summary='Get pal park area', - tags=[ 'location' ], - ) + description="Areas used for grouping Pokémon encounters in Pal Park. They're like habitats that are specific to Pal Park.", + summary="Get pal park area", + tags=["location"], +) @extend_schema_view( list=extend_schema( - summary='List pal park areas', - ) + summary="List pal park areas", + ) ) class PalParkAreaResource(PokeapiCommonViewset): queryset = PalParkArea.objects.all() @@ -610,14 +610,14 @@ class PalParkAreaResource(PokeapiCommonViewset): @extend_schema( - description='Pokeathlon Stats are different attributes of a Pokémon\'s performance in Pokéathlons. In Pokéathlons, competitions happen on different courses; one for each of the different Pokéathlon stats. See [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Pok%C3%A9athlon) for greater detail.', - summary='Get pokeathlon stat', - tags=[ 'pokemon' ], - ) + description="Pokeathlon Stats are different attributes of a Pokémon's performance in Pokéathlons. In Pokéathlons, competitions happen on different courses; one for each of the different Pokéathlon stats. See [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Pok%C3%A9athlon) for greater detail.", + summary="Get pokeathlon stat", + tags=["pokemon"], +) @extend_schema_view( list=extend_schema( - summary='List pokeathlon stats', - ) + summary="List pokeathlon stats", + ) ) class PokeathlonStatResource(PokeapiCommonViewset): queryset = PokeathlonStat.objects.all() @@ -626,14 +626,14 @@ class PokeathlonStatResource(PokeapiCommonViewset): @extend_schema( - description='A Pokédex is a handheld electronic encyclopedia device; one which is capable of recording and retaining information of the various Pokémon in a given region with the exception of the national dex and some smaller dexes related to portions of a region. See [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Pokedex) for greater detail.', - summary='Get pokedex', - tags=[ 'games' ], - ) + description="A Pokédex is a handheld electronic encyclopedia device; one which is capable of recording and retaining information of the various Pokémon in a given region with the exception of the national dex and some smaller dexes related to portions of a region. See [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Pokedex) for greater detail.", + summary="Get pokedex", + tags=["games"], +) @extend_schema_view( list=extend_schema( - summary='List pokedex', - ) + summary="List pokedex", + ) ) class PokedexResource(PokeapiCommonViewset): queryset = Pokedex.objects.all() @@ -642,14 +642,14 @@ class PokedexResource(PokeapiCommonViewset): @extend_schema( - description='Colors used for sorting Pokémon in a Pokédex. The color listed in the Pokédex is usually the color most apparent or covering each Pokémon\'s body. No orange category exists; Pokémon that are primarily orange are listed as red or brown.', - summary='Get pokemon color', - tags=[ 'pokemon' ], - ) + description="Colors used for sorting Pokémon in a Pokédex. The color listed in the Pokédex is usually the color most apparent or covering each Pokémon's body. No orange category exists; Pokémon that are primarily orange are listed as red or brown.", + summary="Get pokemon color", + tags=["pokemon"], +) @extend_schema_view( list=extend_schema( - summary='List pokemon colors', - ) + summary="List pokemon colors", + ) ) class PokemonColorResource(PokeapiCommonViewset): queryset = PokemonColor.objects.all() @@ -658,14 +658,14 @@ class PokemonColorResource(PokeapiCommonViewset): @extend_schema( - description='Some Pokémon may appear in one of multiple, visually different forms. These differences are purely cosmetic. For variations within a Pokémon species, which do differ in more than just visuals, the \'Pokémon\' entity is used to represent such a variety.', - summary='Get pokemon form', - tags=[ 'pokemon' ], - ) + description="Some Pokémon may appear in one of multiple, visually different forms. These differences are purely cosmetic. For variations within a Pokémon species, which do differ in more than just visuals, the 'Pokémon' entity is used to represent such a variety.", + summary="Get pokemon form", + tags=["pokemon"], +) @extend_schema_view( list=extend_schema( - summary='List pokemon forms', - ) + summary="List pokemon forms", + ) ) class PokemonFormResource(PokeapiCommonViewset): queryset = PokemonForm.objects.all() @@ -674,14 +674,14 @@ class PokemonFormResource(PokeapiCommonViewset): @extend_schema( - description='Habitats are generally different terrain Pokémon can be found in but can also be areas designated for rare or legendary Pokémon.', - summary='Get pokemom habita', - tags=[ 'pokemon' ], - ) + description="Habitats are generally different terrain Pokémon can be found in but can also be areas designated for rare or legendary Pokémon.", + summary="Get pokemom habita", + tags=["pokemon"], +) @extend_schema_view( list=extend_schema( - summary='List pokemom habitas', - ) + summary="List pokemom habitas", + ) ) class PokemonHabitatResource(PokeapiCommonViewset): queryset = PokemonHabitat.objects.all() @@ -690,14 +690,14 @@ class PokemonHabitatResource(PokeapiCommonViewset): @extend_schema( - description='Shapes used for sorting Pokémon in a Pokédex.', - summary='Get pokemon shape', - tags=[ 'pokemon' ], - ) + description="Shapes used for sorting Pokémon in a Pokédex.", + summary="Get pokemon shape", + tags=["pokemon"], +) @extend_schema_view( list=extend_schema( - summary='List pokemon shapes', - ) + summary="List pokemon shapes", + ) ) class PokemonShapeResource(PokeapiCommonViewset): queryset = PokemonShape.objects.all() @@ -706,14 +706,14 @@ class PokemonShapeResource(PokeapiCommonViewset): @extend_schema( - description='Pokémon are the creatures that inhabit the world of the Pokémon games. They can be caught using Pokéballs and trained by battling with other Pokémon. Each Pokémon belongs to a specific species but may take on a variant which makes it differ from other Pokémon of the same species, such as base stats, available abilities and typings. See [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Pok%C3%A9mon_(species)) for greater detail.', - summary='Get pokemon', - tags=[ 'pokemon' ], - ) + description="Pokémon are the creatures that inhabit the world of the Pokémon games. They can be caught using Pokéballs and trained by battling with other Pokémon. Each Pokémon belongs to a specific species but may take on a variant which makes it differ from other Pokémon of the same species, such as base stats, available abilities and typings. See [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Pok%C3%A9mon_(species)) for greater detail.", + summary="Get pokemon", + tags=["pokemon"], +) @extend_schema_view( list=extend_schema( - summary='List pokemon', - ) + summary="List pokemon", + ) ) class PokemonResource(PokeapiCommonViewset): queryset = Pokemon.objects.all() @@ -722,14 +722,14 @@ class PokemonResource(PokeapiCommonViewset): @extend_schema( - description='A Pokémon Species forms the basis for at least one Pokémon. Attributes of a Pokémon species are shared across all varieties of Pokémon within the species. A good example is Wormadam; Wormadam is the species which can be found in three different varieties, Wormadam-Trash, Wormadam-Sandy and Wormadam-Plant.', - summary='Get pokemon species', - tags=[ 'pokemon' ], - ) + description="A Pokémon Species forms the basis for at least one Pokémon. Attributes of a Pokémon species are shared across all varieties of Pokémon within the species. A good example is Wormadam; Wormadam is the species which can be found in three different varieties, Wormadam-Trash, Wormadam-Sandy and Wormadam-Plant.", + summary="Get pokemon species", + tags=["pokemon"], +) @extend_schema_view( list=extend_schema( - summary='List pokemon species', - ) + summary="List pokemon species", + ) ) class PokemonSpeciesResource(PokeapiCommonViewset): queryset = PokemonSpecies.objects.all().order_by("id") @@ -738,14 +738,14 @@ class PokemonSpeciesResource(PokeapiCommonViewset): @extend_schema( - description='A region is an organized area of the Pokémon world. Most often, the main difference between regions is the species of Pokémon that can be encountered within them.', - summary='Get region', - tags=[ 'location' ], - ) + description="A region is an organized area of the Pokémon world. Most often, the main difference between regions is the species of Pokémon that can be encountered within them.", + summary="Get region", + tags=["location"], +) @extend_schema_view( list=extend_schema( - summary='List regions', - ) + summary="List regions", + ) ) class RegionResource(PokeapiCommonViewset): queryset = Region.objects.all() @@ -754,14 +754,14 @@ class RegionResource(PokeapiCommonViewset): @extend_schema( - description='Stats determine certain aspects of battles. Each Pokémon has a value for each stat which grows as they gain levels and can be altered momentarily by effects in battles.', - summary='Get stat', - tags=[ 'pokemon' ], - ) + description="Stats determine certain aspects of battles. Each Pokémon has a value for each stat which grows as they gain levels and can be altered momentarily by effects in battles.", + summary="Get stat", + tags=["pokemon"], +) @extend_schema_view( list=extend_schema( - summary='List stats', - ) + summary="List stats", + ) ) class StatResource(PokeapiCommonViewset): queryset = Stat.objects.all() @@ -770,14 +770,14 @@ class StatResource(PokeapiCommonViewset): @extend_schema( - description='Super contest effects refer to the effects of moves when used in super contests.', - summary='Get super contest effect', - tags=[ 'contests' ], - ) + description="Super contest effects refer to the effects of moves when used in super contests.", + summary="Get super contest effect", + tags=["contests"], +) @extend_schema_view( list=extend_schema( - summary='List super contest effects', - ) + summary="List super contest effects", + ) ) class SuperContestEffectResource(PokeapiCommonViewset): queryset = SuperContestEffect.objects.all() @@ -786,14 +786,14 @@ class SuperContestEffectResource(PokeapiCommonViewset): @extend_schema( - description='Types are properties for Pokémon and their moves. Each type has three properties: which types of Pokémon it is super effective against, which types of Pokémon it is not very effective against, and which types of Pokémon it is completely ineffective against.', - summary='Get types', - tags=[ 'pokemon' ], - ) + description="Types are properties for Pokémon and their moves. Each type has three properties: which types of Pokémon it is super effective against, which types of Pokémon it is not very effective against, and which types of Pokémon it is completely ineffective against.", + summary="Get types", + tags=["pokemon"], +) @extend_schema_view( list=extend_schema( - summary='List types', - ) + summary="List types", + ) ) class TypeResource(PokeapiCommonViewset): queryset = Type.objects.all() @@ -802,14 +802,14 @@ class TypeResource(PokeapiCommonViewset): @extend_schema( - description='Versions of the games, e.g., Red, Blue or Yellow.', - summary='Get version', - tags=[ 'games' ], - ) + description="Versions of the games, e.g., Red, Blue or Yellow.", + summary="Get version", + tags=["games"], +) @extend_schema_view( list=extend_schema( - summary='List versions', - ) + summary="List versions", + ) ) class VersionResource(PokeapiCommonViewset): queryset = Version.objects.all() @@ -818,14 +818,14 @@ class VersionResource(PokeapiCommonViewset): @extend_schema( - description='Version groups categorize highly similar versions of the games.', - summary='Get version group', - tags=[ 'games' ], - ) + description="Version groups categorize highly similar versions of the games.", + summary="Get version group", + tags=["games"], +) @extend_schema_view( list=extend_schema( - summary='List version groups', - ) + summary="List version groups", + ) ) class VersionGroupResource(PokeapiCommonViewset): queryset = VersionGroup.objects.all() @@ -834,128 +834,116 @@ class VersionGroupResource(PokeapiCommonViewset): @extend_schema( - description='Handles Pokemon Encounters as a sub-resource.', - summary='Get pokemon encounter', - tags=[ 'encounters' ], - responses={'200': { - 'type': 'array', - 'items': { - 'type': 'object', - 'required': [ 'location_area', 'version_details' ], - 'properties': { - 'location_area': { - 'type': 'object', - 'required': [ 'name', 'url' ], - 'properties': { - 'name': { - 'type': 'string', - 'example': 'cerulean-city-area' - }, - 'url': { - 'type': 'string', - 'format': 'uri', - 'example': 'https://pokeapi.co/api/v2/location-area/281/' - } - } - }, - 'version_details': { - 'type': 'array', - 'items': { - 'type': 'object', - 'required': [ - 'encounter_details', - 'max_chance', - 'version' - ], - 'properties': { - 'encounter_details': { - 'type': 'array', - 'items': { - 'type': 'object', - 'required': [ - 'chance', - 'condition_values', - 'max_level', - 'method', - 'min_level' - ], - 'properties': { - 'chance': { - 'type': 'number', - 'example': 100 - }, - 'condition_values': { - 'type': 'array', - 'items': { - 'type': 'object', - 'required': [ 'name', 'url' ], - 'properties': { - 'name': { - 'type': 'string', - 'example': 'story-progress-beat-red' - }, - 'url': { - 'type': 'string', - 'format': 'uri', - 'example': 'https://pokeapi.co/api/v2/encounter-condition-value/55/' - } - } - } - }, - 'max_level': { - 'type': 'number', - 'example': 10 - }, - 'method': { - 'type': 'object', - 'required': [ 'name', 'url' ], - 'properties': { - 'name': { - 'type': 'string', - 'example': 'gift' - }, - 'url': { - 'type': 'string', - 'format': 'uri', - 'example': 'https://pokeapi.co/api/v2/encounter-method/18/' - } - } - }, - 'min_level': { - 'type': 'number', - 'example': 10 - } - } - } - }, - 'max_chance': { - 'type': 'number', - 'example': 100 - }, - 'version': { - 'type': 'object', - 'required': [ 'name', 'url' ], - 'properties': { - 'name': { - 'type': 'string', - 'example': 'red' - }, - 'url': { - 'type': 'string', - 'format': 'uri', - 'example': 'https://pokeapi.co/api/v2/version/1/' - } - } - } - } - } - } - } - } - }} - ) + description="Handles Pokemon Encounters as a sub-resource.", + summary="Get pokemon encounter", + tags=["encounters"], + responses={ + "200": { + "type": "array", + "items": { + "type": "object", + "required": ["location_area", "version_details"], + "properties": { + "location_area": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "example": "cerulean-city-area"}, + "url": { + "type": "string", + "format": "uri", + "example": "https://pokeapi.co/api/v2/location-area/281/", + }, + }, + }, + "version_details": { + "type": "array", + "items": { + "type": "object", + "required": ["encounter_details", "max_chance", "version"], + "properties": { + "encounter_details": { + "type": "array", + "items": { + "type": "object", + "required": [ + "chance", + "condition_values", + "max_level", + "method", + "min_level", + ], + "properties": { + "chance": { + "type": "number", + "example": 100, + }, + "condition_values": { + "type": "array", + "items": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": { + "type": "string", + "example": "story-progress-beat-red", + }, + "url": { + "type": "string", + "format": "uri", + "example": "https://pokeapi.co/api/v2/encounter-condition-value/55/", + }, + }, + }, + }, + "max_level": { + "type": "number", + "example": 10, + }, + "method": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": { + "type": "string", + "example": "gift", + }, + "url": { + "type": "string", + "format": "uri", + "example": "https://pokeapi.co/api/v2/encounter-method/18/", + }, + }, + }, + "min_level": { + "type": "number", + "example": 10, + }, + }, + }, + }, + "max_chance": {"type": "number", "example": 100}, + "version": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "example": "red"}, + "url": { + "type": "string", + "format": "uri", + "example": "https://pokeapi.co/api/v2/version/1/", + }, + }, + }, + }, + }, + }, + }, + }, + } + }, +) class PokemonEncounterView(APIView): - def get(self, request, pokemon_id): self.context = dict(request=request) diff --git a/pokemon_v2/serializers.py b/pokemon_v2/serializers.py index fd4db022..463b60f4 100644 --- a/pokemon_v2/serializers.py +++ b/pokemon_v2/serializers.py @@ -478,12 +478,15 @@ class CharacteristicDetailSerializer(serializers.ModelSerializer): "descriptions", ) - @extend_schema_field(field={'type': 'array', - 'items': { - 'type': 'number', - }, - 'example': [ 0, 5, 10, 15, 20, 25, 30 ] - }) + @extend_schema_field( + field={ + "type": "array", + "items": { + "type": "number", + }, + "example": [0, 5, 10, 15, 20, 25, 30], + } + ) def get_values(self, obj): mod = obj.gene_mod_5 values = [] @@ -616,23 +619,23 @@ class RegionDetailSerializer(serializers.ModelSerializer): "version_groups", ) - @extend_schema_field(field={'type': 'array', - 'items': { - 'type': 'object', - 'required': [ 'name', 'url' ], - 'properties': { - 'name': { - 'type': 'string', - 'example': 'red-blue' - }, - 'url': { - 'type': 'string', - 'format': 'uri', - 'example': 'https://pokeapi.co/api/v2/version-group/1/' - } - } - } - }) + @extend_schema_field( + field={ + "type": "array", + "items": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "example": "red-blue"}, + "url": { + "type": "string", + "format": "uri", + "example": "https://pokeapi.co/api/v2/version-group/1/", + }, + }, + }, + } + ) def get_region_version_groups(self, obj): vg_regions = VersionGroupRegion.objects.filter(region=obj) data = VersionGroupRegionSerializer( @@ -700,33 +703,30 @@ class GenderDetailSerializer(serializers.ModelSerializer): model = Gender fields = ("id", "name", "pokemon_species_details", "required_for_evolution") - @extend_schema_field(field={'type': 'array', - 'items': { - 'type': 'object', - 'required': [ 'rate', 'pokemon_species' ], - 'properties': { - 'rate': { - 'type': 'number', - 'example': 1 - }, - 'pokemon_species': { - 'type': 'object', - 'required': [ 'name', 'url' ], - 'properties': { - 'name': { - 'type': 'string', - 'example': 'bulbasaur' - }, - 'url': { - 'type': 'string', - 'format': 'uri', - 'example': 'https://pokeapi.co/api/v2/pokemon-species/1/' - } - } - } - } - } - }) + @extend_schema_field( + field={ + "type": "array", + "items": { + "type": "object", + "required": ["rate", "pokemon_species"], + "properties": { + "rate": {"type": "number", "example": 1}, + "pokemon_species": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "example": "bulbasaur"}, + "url": { + "type": "string", + "format": "uri", + "example": "https://pokeapi.co/api/v2/pokemon-species/1/", + }, + }, + }, + }, + }, + } + ) def get_species(self, obj): species_objects = [] @@ -749,23 +749,23 @@ class GenderDetailSerializer(serializers.ModelSerializer): return details - @extend_schema_field(field={'type': 'array', - 'items': { - 'type': 'object', - 'required': [ 'name', 'url' ], - 'properties': { - 'name': { - 'type': 'string', - 'example': 'wormadam' - }, - 'url': { - 'type': 'string', - 'format': 'uri', - 'example': 'https://pokeapi.co/api/v2/pokemon-species/413/' - } - } - } - }) + @extend_schema_field( + field={ + "type": "array", + "items": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "example": "wormadam"}, + "url": { + "type": "string", + "format": "uri", + "example": "https://pokeapi.co/api/v2/pokemon-species/413/", + }, + }, + }, + } + ) def get_required(self, obj): evo_objects = PokemonEvolution.objects.filter(gender=obj) species_list = [] @@ -975,57 +975,54 @@ class LocationAreaDetailSerializer(serializers.ModelSerializer): "pokemon_encounters", ) - @extend_schema_field(field={'type': 'array', - 'items': { - 'type': 'object', - 'required': [ 'encounter_method', 'version_details' ], - 'properties': { - 'encounter_method': { - 'type': 'object', - 'required': [ 'name', 'url' ], - 'properties': { - 'name': { - 'type': 'string', - 'example': 'old-rod' - }, - 'url': { - 'type': 'string', - 'format': 'uri', - 'example': 'https://pokeapi.co/api/v2/encounter-method/2/' - } - } - }, - 'version_details': { - 'type': 'array', - 'items': { - 'type': 'object', - 'required': [ 'rate', 'version' ], - 'properties': { - 'rate': { - 'type': 'number', - 'example': 5 - }, - 'version': { - 'type': 'object', - 'required': [ 'name', 'url' ], - 'properties': { - 'name': { - 'type': 'string', - 'example': 'platinum' - }, - 'url': { - 'type': 'string', - 'format': 'uri', - 'example': 'https://pokeapi.co/api/v2/version/14/' - } - } - } - } - } - } - } - } - }) + @extend_schema_field( + field={ + "type": "array", + "items": { + "type": "object", + "required": ["encounter_method", "version_details"], + "properties": { + "encounter_method": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "example": "old-rod"}, + "url": { + "type": "string", + "format": "uri", + "example": "https://pokeapi.co/api/v2/encounter-method/2/", + }, + }, + }, + "version_details": { + "type": "array", + "items": { + "type": "object", + "required": ["rate", "version"], + "properties": { + "rate": {"type": "number", "example": 5}, + "version": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": { + "type": "string", + "example": "platinum", + }, + "url": { + "type": "string", + "format": "uri", + "example": "https://pokeapi.co/api/v2/version/14/", + }, + }, + }, + }, + }, + }, + }, + }, + } + ) def get_method_rates(self, obj): # Get encounters related to this area and pull out unique encounter methods encounter_rates = LocationAreaEncounterRate.objects.filter( @@ -1067,111 +1064,99 @@ class LocationAreaDetailSerializer(serializers.ModelSerializer): return encounter_rate_list - @extend_schema_field(field={'type': 'array', - 'items': { - 'type': 'object', - 'required': [ 'pokemon', 'version_details' ], - 'properties': { - 'pokemon': { - 'type': 'object', - 'required': [ 'name', 'url' ], - 'properties': { - 'name': { - 'type': 'string', - 'example': 'tentacool' - }, - 'url': { - 'type': 'string', - 'format': 'uri', - 'example': 'ttps://pokeapi.co/api/v2/pokemon/72/' - } - } - }, - 'version_details': { - 'type': 'array', - 'items': { - 'type': 'object', - 'required': [ 'version', 'max_chance', 'encounter_details' ], - 'properties': { - 'version': { - 'type': 'object', - 'required': [ 'name', 'url' ], - 'properties': { - 'name': { - 'type': 'string', - 'example': 'diamond' - }, - 'url': { - 'type': 'string', - 'format': 'uri', - 'example': 'https://pokeapi.co/api/v2/version/12/' - } - } - }, - 'max_chance': { - 'type': 'number', - 'example': 60 - }, - 'encounter_details': { - 'type': 'object', - 'required': [ - 'min_level', - 'max_level', - 'condition_value', - 'chance', - 'method' - ], - 'properties': { - 'min_level': { - 'type': 'number', - 'example': 20 - }, - 'max_level': { - 'type': 'number', - 'example': 30 - }, - 'condition_values': { - 'type': 'object', - 'required': [ 'name', 'url' ], - 'properties': { - 'name': { - 'type': 'string', - 'example': 'slot2-sapphire' - }, - 'url': { - 'type': 'string', - 'format': 'uri', - 'example': 'https://pokeapi.co/api/v2/encounter-condition-value/10/' - } - } - }, - 'chance': { - 'type': 'number', - 'example': 60 - }, - 'method': { - 'type': 'object', - 'required': [ 'name', 'url' ], - 'properties': { - 'name': { - 'type': 'string', - 'example': 'surf' - }, - 'url': { - 'type': 'string', - 'format': 'uri', - 'example': 'https://pokeapi.co/api/v2/encounter-method/5/' - } - } - } - } - } - } - } - } - } - } - }) + @extend_schema_field( + field={ + "type": "array", + "items": { + "type": "object", + "required": ["pokemon", "version_details"], + "properties": { + "pokemon": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "example": "tentacool"}, + "url": { + "type": "string", + "format": "uri", + "example": "ttps://pokeapi.co/api/v2/pokemon/72/", + }, + }, + }, + "version_details": { + "type": "array", + "items": { + "type": "object", + "required": ["version", "max_chance", "encounter_details"], + "properties": { + "version": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": { + "type": "string", + "example": "diamond", + }, + "url": { + "type": "string", + "format": "uri", + "example": "https://pokeapi.co/api/v2/version/12/", + }, + }, + }, + "max_chance": {"type": "number", "example": 60}, + "encounter_details": { + "type": "object", + "required": [ + "min_level", + "max_level", + "condition_value", + "chance", + "method", + ], + "properties": { + "min_level": {"type": "number", "example": 20}, + "max_level": {"type": "number", "example": 30}, + "condition_values": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": { + "type": "string", + "example": "slot2-sapphire", + }, + "url": { + "type": "string", + "format": "uri", + "example": "https://pokeapi.co/api/v2/encounter-condition-value/10/", + }, + }, + }, + "chance": {"type": "number", "example": 60}, + "method": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": { + "type": "string", + "example": "surf", + }, + "url": { + "type": "string", + "format": "uri", + "example": "https://pokeapi.co/api/v2/encounter-method/5/", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + } + ) def get_encounters(self, obj): # get versions for later use version_objects = Version.objects.all() @@ -1343,37 +1328,31 @@ class AbilityDetailSerializer(serializers.ModelSerializer): "pokemon", ) - @extend_schema_field(field={'type': 'array', - 'items': { - 'type': 'object', - 'required': [ 'is_hidden', 'slot', 'pokemon' ], - 'properties': { - 'is_hidden': { - 'type': 'boolean', - 'example': True - }, - 'slot': { - 'type': 'number', - 'example': 3 - }, - 'pokemon': { - 'type': 'object', - 'required': [ 'name', 'url' ], - 'properties': { - 'name': { - 'type': 'string', - 'example': 'gloom' - }, - 'url': { - 'type': 'string', - 'format': 'uri', - 'example': 'https://pokeapi.co/api/v2/pokemon/44/' - } - } - } - } - } - }) + @extend_schema_field( + field={ + "type": "array", + "items": { + "type": "object", + "required": ["is_hidden", "slot", "pokemon"], + "properties": { + "is_hidden": {"type": "boolean", "example": True}, + "slot": {"type": "number", "example": 3}, + "pokemon": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "example": "gloom"}, + "url": { + "type": "string", + "format": "uri", + "example": "https://pokeapi.co/api/v2/pokemon/44/", + }, + }, + }, + }, + }, + } + ) def get_ability_pokemon(self, obj): pokemon_ability_objects = PokemonAbility.objects.filter(ability=obj) data = PokemonAbilitySerializer( @@ -1424,67 +1403,61 @@ class StatDetailSerializer(serializers.ModelSerializer): "names", ) - @extend_schema_field(field={'type': 'object', - 'required': [ 'decrease', 'increase' ], - 'properties': { - 'increase': { - 'type': 'array', - 'items': { - 'type': 'object', - 'required': [ 'change', 'move' ], - 'properties': { - 'change': { - 'type': 'number', - 'example': -1 - }, - 'move': { - 'type': 'object', - 'required': [ 'name', 'url' ], - 'properties': { - 'name': { - 'type': 'string', - 'example': 'swords-dance' - }, - 'url': { - 'type': 'string', - 'format': 'uri', - 'example': 'https://pokeapi.co/api/v2/move/14/' - } - } - } - } - } - }, - 'decrease': { - 'type': 'array', - 'items': { - 'type': 'object', - 'required': [ 'change', 'move' ], - 'properties': { - 'change': { - 'type': 'number', - 'example': 5 - }, - 'move': { - 'type': 'object', - 'required': [ 'name', 'url' ], - 'properties': { - 'name': { - 'type': 'string', - 'example': 'growl' - }, - 'url': { - 'type': 'string', - 'format': 'uri', - 'example': 'https://pokeapi.co/api/v2/move/45/' - } - } - } - } - } - } - } - }) + @extend_schema_field( + field={ + "type": "object", + "required": ["decrease", "increase"], + "properties": { + "increase": { + "type": "array", + "items": { + "type": "object", + "required": ["change", "move"], + "properties": { + "change": {"type": "number", "example": -1}, + "move": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": { + "type": "string", + "example": "swords-dance", + }, + "url": { + "type": "string", + "format": "uri", + "example": "https://pokeapi.co/api/v2/move/14/", + }, + }, + }, + }, + }, + }, + "decrease": { + "type": "array", + "items": { + "type": "object", + "required": ["change", "move"], + "properties": { + "change": {"type": "number", "example": 5}, + "move": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "example": "growl"}, + "url": { + "type": "string", + "format": "uri", + "example": "https://pokeapi.co/api/v2/move/45/", + }, + }, + }, + }, + }, + }, + }, + } + ) def get_moves_that_affect(self, obj): stat_change_objects = MoveMetaStatChange.objects.filter(stat=obj) stat_changes = MoveMetaStatChangeSerializer( @@ -1501,47 +1474,44 @@ class StatDetailSerializer(serializers.ModelSerializer): return changes - @extend_schema_field(field={'type': 'object', - 'required': [ 'increase', 'decrease' ], - 'properties': { - 'increase': { - 'type': 'array', - 'items': { - 'type': 'object', - 'required': [ 'name', 'url' ], - 'properties': { - 'name': { - 'type': 'string', - 'example': 'lonely' - }, - 'url': { - 'type': 'string', - 'format': 'uri', - 'example': 'https://pokeapi.co/api/v2/nature/6/' - } - } - } - }, - 'decrease': { - 'type': 'array', - 'items': { - 'type': 'object', - 'required': [ 'name', 'url' ], - 'properties': { - 'name': { - 'type': 'string', - 'example': 'bold' - }, - 'url': { - 'type': 'string', - 'format': 'uri', - 'example': 'https://pokeapi.co/api/v2/nature/2/' - } - } - } - }, - } - }) + @extend_schema_field( + field={ + "type": "object", + "required": ["increase", "decrease"], + "properties": { + "increase": { + "type": "array", + "items": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "example": "lonely"}, + "url": { + "type": "string", + "format": "uri", + "example": "https://pokeapi.co/api/v2/nature/6/", + }, + }, + }, + }, + "decrease": { + "type": "array", + "items": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "example": "bold"}, + "url": { + "type": "string", + "format": "uri", + "example": "https://pokeapi.co/api/v2/nature/2/", + }, + }, + }, + }, + }, + } + ) def get_natures_that_affect(self, obj): increase_objects = Nature.objects.filter(increased_stat=obj) increases = NatureSummarySerializer( @@ -1636,23 +1606,23 @@ class ItemAttributeDetailSerializer(serializers.ModelSerializer): model = ItemAttribute fields = ("id", "name", "descriptions", "items", "names") - @extend_schema_field(field={'type': 'array', - 'items': { - 'type': 'object', - 'required': [ 'name', 'url' ], - 'properties': { - 'name': { - 'type': 'string', - 'example': 'master-ball' - }, - 'url': { - 'type': 'string', - 'format': 'uri', - 'example': 'https://pokeapi.co/api/v2/item/1/' - } - } - } - }) + @extend_schema_field( + field={ + "type": "array", + "items": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "example": "master-ball"}, + "url": { + "type": "string", + "format": "uri", + "example": "https://pokeapi.co/api/v2/item/1/", + }, + }, + }, + } + ) def get_attribute_items(self, obj): item_map_objects = ItemAttributeMap.objects.filter(item_attribute=obj) items = [] @@ -1769,34 +1739,34 @@ class ItemDetailSerializer(serializers.ModelSerializer): "machines", ) - @extend_schema_field(field={'type': 'array', - 'items': { - 'type': 'object', - 'required': [ 'machine', 'version_group' ], - 'properties': { - 'machine': { - 'type': 'string', - 'format': 'uri', - 'example': 'https://pokeapi.co/api/v2/machine/1/' - }, - 'version_group': { - 'type': 'object', - 'required': [ 'name', 'url' ], - 'properties': { - 'name': { - 'type': 'string', - 'example': 'sword-shield' - }, - 'url': { - 'type': 'string', - 'format': 'uri', - 'example': 'https://pokeapi.co/api/v2/version-group/20/' - } - } - } - } - } - }) + @extend_schema_field( + field={ + "type": "array", + "items": { + "type": "object", + "required": ["machine", "version_group"], + "properties": { + "machine": { + "type": "string", + "format": "uri", + "example": "https://pokeapi.co/api/v2/machine/1/", + }, + "version_group": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "example": "sword-shield"}, + "url": { + "type": "string", + "format": "uri", + "example": "https://pokeapi.co/api/v2/version-group/20/", + }, + }, + }, + }, + }, + } + ) def get_item_machines(self, obj): machine_objects = Machine.objects.filter(item=obj) @@ -1817,37 +1787,40 @@ class ItemDetailSerializer(serializers.ModelSerializer): return machines - @extend_schema_field(field={'type': 'object', - 'required': [ 'default' ], - 'properties': { - 'default': { - 'type': 'string', - 'format': 'uri', - 'example': 'https://pokeapi.co/media/sprites/items/master-ball.png' - } - } - }) + @extend_schema_field( + field={ + "type": "object", + "required": ["default"], + "properties": { + "default": { + "type": "string", + "format": "uri", + "example": "https://pokeapi.co/media/sprites/items/master-ball.png", + } + }, + } + ) def get_item_sprites(self, obj): sprites_object = ItemSprites.objects.get(item_id=obj) return sprites_object.sprites - @extend_schema_field(field={'type': 'array', - 'items': { - 'type': 'object', - 'required': [ 'name', 'url' ], - 'properties': { - 'name': { - 'type': 'string', - 'example': 'countable' - }, - 'url': { - 'type': 'string', - 'format': 'uri', - 'example': 'https://pokeapi.co/api/v2/item-attribute/1/' - } - } - } - }) + @extend_schema_field( + field={ + "type": "array", + "items": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "example": "countable"}, + "url": { + "type": "string", + "format": "uri", + "example": "https://pokeapi.co/api/v2/item-attribute/1/", + }, + }, + }, + } + ) def get_item_attributes(self, obj): item_attribute_maps = ItemAttributeMap.objects.filter(item=obj) serializer = ItemAttributeMapSerializer( @@ -1865,57 +1838,51 @@ class ItemDetailSerializer(serializers.ModelSerializer): return attributes - @extend_schema_field(field={'type': 'array', - 'items': { - 'type': 'object', - 'required': [ 'pokemon', 'version-details' ], - 'properties': { - 'pokemon': { - 'type': 'object', - 'required': [ 'name', 'url' ], - 'properties': { - 'name': { - 'type': 'string', - 'example': 'farfetchd' - }, - 'url': { - 'type': 'string', - 'format': 'uri', - 'example': 'https://pokeapi.co/api/v2/pokemon/83/' - } - } - }, - 'version-details': { - 'type': 'array', - 'items': { - 'type': 'object', - 'required': [ 'rarity', 'version' ], - 'properties': { - 'rarity': { - 'type': 'number', - 'example': 5 - }, - 'version': { - 'type': 'object', - 'required': [ 'name', 'url' ], - 'properties': { - 'name': { - 'type': 'string', - 'example': 'ruby' - }, - 'url': { - 'type': 'string', - 'format': 'uri', - 'example': 'https://pokeapi.co/api/v2/version/7/' - } - } - } - } - } - } - } - } - }) + @extend_schema_field( + field={ + "type": "array", + "items": { + "type": "object", + "required": ["pokemon", "version-details"], + "properties": { + "pokemon": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "example": "farfetchd"}, + "url": { + "type": "string", + "format": "uri", + "example": "https://pokeapi.co/api/v2/pokemon/83/", + }, + }, + }, + "version-details": { + "type": "array", + "items": { + "type": "object", + "required": ["rarity", "version"], + "properties": { + "rarity": {"type": "number", "example": 5}, + "version": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "example": "ruby"}, + "url": { + "type": "string", + "format": "uri", + "example": "https://pokeapi.co/api/v2/version/7/", + }, + }, + }, + }, + }, + }, + }, + }, + } + ) def get_held_by_pokemon(self, obj): pokemon_items = PokemonItem.objects.filter(item=obj).order_by("pokemon_id") pokemon_ids = pokemon_items.values("pokemon_id").distinct() @@ -1948,16 +1915,19 @@ class ItemDetailSerializer(serializers.ModelSerializer): return pokemon_list - @extend_schema_field(field={'type': 'object', - 'required': [ 'url' ], - 'properties': { - 'url': { - 'type': 'string', - 'format': 'uri', - 'example': '"https://pokeapi.co/api/v2/evolution-chain/51/' - } - } - }) + @extend_schema_field( + field={ + "type": "object", + "required": ["url"], + "properties": { + "url": { + "type": "string", + "format": "uri", + "example": '"https://pokeapi.co/api/v2/evolution-chain/51/', + } + }, + } + ) def get_baby_trigger_for(self, obj): try: chain_object = EvolutionChain.objects.get(baby_trigger_item=obj) @@ -2022,33 +1992,30 @@ class NatureDetailSerializer(serializers.ModelSerializer): "names", ) - @extend_schema_field(field={'type': 'array', - 'items': { - 'type': 'object', - 'required': [ 'max_change', 'pokeathlon_stat' ], - 'properties': { - 'max_change': { - 'type': 'number', - 'example': 1 - }, - 'pokeathlon_stat': { - 'type': 'object', - 'required': [ 'name', 'url' ], - 'properties': { - 'name': { - 'type': 'string', - 'example': 'power' - }, - 'url': { - 'type': 'string', - 'format': 'uri', - 'example': 'https://pokeapi.co/api/v2/pokeathlon-stat/2/' - } - } - } - } - } - }) + @extend_schema_field( + field={ + "type": "array", + "items": { + "type": "object", + "required": ["max_change", "pokeathlon_stat"], + "properties": { + "max_change": {"type": "number", "example": 1}, + "pokeathlon_stat": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "example": "power"}, + "url": { + "type": "string", + "format": "uri", + "example": "https://pokeapi.co/api/v2/pokeathlon-stat/2/", + }, + }, + }, + }, + }, + } + ) def get_pokeathlon_stats(self, obj): pokeathlon_stat_objects = NaturePokeathlonStat.objects.filter(nature=obj) pokeathlon_stats = NaturePokeathlonStatSerializer( @@ -2104,35 +2071,35 @@ class BerryFlavorDetailSerializer(serializers.ModelSerializer): model = BerryFlavor fields = ("id", "name", "berries", "contest_type", "names") - @extend_schema_field(field={'type': 'array', - 'items': { - 'type': 'object', - 'required': [ 'potency', 'berry' ], - 'properties': { - 'potency': { - 'type': 'integer', - 'example': 10 - }, - 'berry': { - 'type': 'object', - 'require': [ 'name', 'url' ], - 'properties': { - 'name': { - 'type': 'string', - 'description': 'The name of the berry', - 'example': 'rowap' - }, - 'url': { - 'type': 'string', - 'format': 'uri', - 'description': 'The URL to get more information about the berry', - 'example': 'https://pokeapi.co/api/v2/berry/64/' - } - } - } - } - }, - }) + @extend_schema_field( + field={ + "type": "array", + "items": { + "type": "object", + "required": ["potency", "berry"], + "properties": { + "potency": {"type": "integer", "example": 10}, + "berry": { + "type": "object", + "require": ["name", "url"], + "properties": { + "name": { + "type": "string", + "description": "The name of the berry", + "example": "rowap", + }, + "url": { + "type": "string", + "format": "uri", + "description": "The URL to get more information about the berry", + "example": "https://pokeapi.co/api/v2/berry/64/", + }, + }, + }, + }, + }, + } + ) def get_berries_with_flavor(self, obj): flavor_map_objects = BerryFlavorMap.objects.filter( berry_flavor=obj, potency__gt=0 @@ -2170,35 +2137,35 @@ class BerryDetailSerializer(serializers.ModelSerializer): "natural_gift_type", ) - @extend_schema_field(field={'type': 'array', - 'items': { - 'type': 'object', - 'required': [ 'potency', 'flavor' ], - 'properties': { - 'potency': { - 'type': 'integer', - 'example': 10 - }, - 'flavor': { - 'type': 'object', - 'require': [ 'name', 'url' ], - 'properties': { - 'name': { - 'type': 'string', - 'description': 'The name of the flavor', - 'example': 'spicy' - }, - 'url': { - 'type': 'string', - 'format': 'uri', - 'description': 'The URL to get more information about the flavor', - 'example': 'https://pokeapi.co/api/v2/berry-flavor/1/' - } - } - } - } - }, - }) + @extend_schema_field( + field={ + "type": "array", + "items": { + "type": "object", + "required": ["potency", "flavor"], + "properties": { + "potency": {"type": "integer", "example": 10}, + "flavor": { + "type": "object", + "require": ["name", "url"], + "properties": { + "name": { + "type": "string", + "description": "The name of the flavor", + "example": "spicy", + }, + "url": { + "type": "string", + "format": "uri", + "description": "The URL to get more information about the flavor", + "example": "https://pokeapi.co/api/v2/berry-flavor/1/", + }, + }, + }, + }, + }, + } + ) def get_berry_flavors(self, obj): flavor_map_objects = BerryFlavorMap.objects.filter(berry=obj) flavor_maps = BerryFlavorMapSerializer( @@ -2241,25 +2208,28 @@ class EggGroupDetailSerializer(serializers.ModelSerializer): model = EggGroup fields = ("id", "name", "names", "pokemon_species") - @extend_schema_field(field={'type': 'array', - 'items': { - 'type': 'object', - 'required': [ 'potency', 'flavor' ], - 'properties': { - 'name': { - 'type': 'string', - 'description': 'Pokemon species name.', - 'example': 'bulbasaur' - }, - 'url': { - 'type': 'string', - 'format': 'uri', - 'description': 'The URL to get more information about the species', - 'example': 'https://pokeapi.co/api/v2/pokemon-species/1/' - }, - } - }, - }) + @extend_schema_field( + field={ + "type": "array", + "items": { + "type": "object", + "required": ["potency", "flavor"], + "properties": { + "name": { + "type": "string", + "description": "Pokemon species name.", + "example": "bulbasaur", + }, + "url": { + "type": "string", + "format": "uri", + "description": "The URL to get more information about the species", + "example": "https://pokeapi.co/api/v2/pokemon-species/1/", + }, + }, + }, + } + ) def get_species(self, obj): results = PokemonEggGroup.objects.filter(egg_group=obj) data = PokemonEggGroupSerializer(results, many=True, context=self.context).data @@ -2354,126 +2324,111 @@ class TypeDetailSerializer(serializers.ModelSerializer): TypeSummarySerializer(type, context=self.context).data ) - @extend_schema_field(field={'type': 'object', - 'required': [ - 'no_damage_to', - 'half_damage_to', - 'double_damage_to', - 'no_damage_from', - 'half_damage_from', - 'double_damage_from' - ], - 'properties': { - 'no_damage_to': { - 'type': 'array', - 'items': { - 'type': 'object', - 'required': [ 'name', 'url' ], - 'properties': { - 'name': { - 'type': 'string', - 'example': 'flying' - }, - 'url': { - 'type': 'string', - 'format': 'uri', - 'example': 'https://pokeapi.co/api/v2/type/3/' - } - } - } - }, - 'half_damage_to': { - 'type': 'array', - 'items': { - 'type': 'object', - 'required': [ 'name', 'url' ], - 'properties': { - 'name': { - 'type': 'string', - 'example': 'bug' - }, - 'url': { - 'type': 'string', - 'format': 'uri', - 'example': 'https://pokeapi.co/api/v2/type/7/' - } - } - } - }, - 'double_damage_to': { - 'type': 'array', - 'items': { - 'type': 'object', - 'required': [ 'name', 'url' ], - 'properties': { - 'name': { - 'type': 'string', - 'example': 'poison' - }, - 'url': { - 'type': 'string', - 'format': 'uri', - 'example': 'https://pokeapi.co/api/v2/type/4/' - } - } - } - }, - 'no_damage_from': { - 'type': 'array', - 'items': { - 'type': 'object', - 'required': [ 'name', 'url' ], - 'properties': { - 'name': { - 'type': 'string', - 'example': 'electric' - }, - 'url': { - 'type': 'string', - 'format': 'uri', - 'example': 'https://pokeapi.co/api/v2/type/13/' - } - } - } - }, - 'half_damage_from': { - 'type': 'array', - 'items': { - 'type': 'object', - 'required': [ 'name', 'url' ], - 'properties': { - 'name': { - 'type': 'string', - 'example': 'poison' - }, - 'url': { - 'type': 'string', - 'format': 'uri', - 'example': 'https://pokeapi.co/api/v2/type/4/' - } - } - } - }, - 'double_damage_from': { - 'type': 'array', - 'items': { - 'type': 'object', - 'required': [ 'name', 'url' ], - 'properties': { - 'name': { - 'type': 'string', - 'example': 'water' - }, - 'url': { - 'type': 'string', - 'format': 'uri', - 'example': 'https://pokeapi.co/api/v2/type/11/' - } - } - } - } - } - }) + @extend_schema_field( + field={ + "type": "object", + "required": [ + "no_damage_to", + "half_damage_to", + "double_damage_to", + "no_damage_from", + "half_damage_from", + "double_damage_from", + ], + "properties": { + "no_damage_to": { + "type": "array", + "items": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "example": "flying"}, + "url": { + "type": "string", + "format": "uri", + "example": "https://pokeapi.co/api/v2/type/3/", + }, + }, + }, + }, + "half_damage_to": { + "type": "array", + "items": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "example": "bug"}, + "url": { + "type": "string", + "format": "uri", + "example": "https://pokeapi.co/api/v2/type/7/", + }, + }, + }, + }, + "double_damage_to": { + "type": "array", + "items": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "example": "poison"}, + "url": { + "type": "string", + "format": "uri", + "example": "https://pokeapi.co/api/v2/type/4/", + }, + }, + }, + }, + "no_damage_from": { + "type": "array", + "items": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "example": "electric"}, + "url": { + "type": "string", + "format": "uri", + "example": "https://pokeapi.co/api/v2/type/13/", + }, + }, + }, + }, + "half_damage_from": { + "type": "array", + "items": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "example": "poison"}, + "url": { + "type": "string", + "format": "uri", + "example": "https://pokeapi.co/api/v2/type/4/", + }, + }, + }, + }, + "double_damage_from": { + "type": "array", + "items": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "example": "water"}, + "url": { + "type": "string", + "format": "uri", + "example": "https://pokeapi.co/api/v2/type/11/", + }, + }, + }, + }, + }, + } + ) def get_type_relationships(self, obj): relations = OrderedDict() relations["no_damage_to"] = [] @@ -2538,150 +2493,135 @@ class TypeDetailSerializer(serializers.ModelSerializer): return # returns past type relationships for the given type object - @extend_schema_field(field={'type': 'array', - 'items': { - 'type': 'object', - 'required': [ 'generation', 'damage_relations' ], - 'properties': { - 'generation': { - 'type': 'object', - 'required': [ 'name', 'url' ], - 'properties': { - 'name': { - 'type': 'string', - 'example': 'generation-v' - }, - 'url': { - 'type': 'string', - 'format': 'uri', - 'example': 'https://pokeapi.co/api/v2/generation/5/' - } - } - }, - 'damage_relations': { - 'type': 'object', - 'required': [ - 'no_damage_to', - 'half_damage_to', - 'double_damage_to', - 'no_damage_from', - 'half_damage_from', - 'double_damage_from' - ], - 'properties': { - 'no_damage_to': { - 'type': 'array', - 'items': { - 'type': 'object', - 'required': [ 'name', 'url' ], - 'properties': { - 'name': { - 'type': 'string', - 'example': 'flying' - }, - 'url': { - 'type': 'string', - 'format': 'uri', - 'example': 'https://pokeapi.co/api/v2/type/3/' - } - } - } - }, - 'half_damage_to': { - 'type': 'array', - 'items': { - 'type': 'object', - 'required': [ 'name', 'url' ], - 'properties': { - 'name': { - 'type': 'string', - 'example': 'bug' - }, - 'url': { - 'type': 'string', - 'format': 'uri', - 'example': 'https://pokeapi.co/api/v2/type/7/' - } - } - } - }, - 'double_damage_to': { - 'type': 'array', - 'items': { - 'type': 'object', - 'required': [ 'name', 'url' ], - 'properties': { - 'name': { - 'type': 'string', - 'example': 'poison' - }, - 'url': { - 'type': 'string', - 'format': 'uri', - 'example': 'https://pokeapi.co/api/v2/type/4/' - } - } - } - }, - 'no_damage_from': { - 'type': 'array', - 'items': { - 'type': 'object', - 'required': [ 'name', 'url' ], - 'properties': { - 'name': { - 'type': 'string', - 'example': 'electric' - }, - 'url': { - 'type': 'string', - 'format': 'uri', - 'example': 'https://pokeapi.co/api/v2/type/13/' - } - } - } - }, - 'half_damage_from': { - 'type': 'array', - 'items': { - 'type': 'object', - 'required': [ 'name', 'url' ], - 'properties': { - 'name': { - 'type': 'string', - 'example': 'poison' - }, - 'url': { - 'type': 'string', - 'format': 'uri', - 'example': 'https://pokeapi.co/api/v2/type/4/' - } - } - } - }, - 'double_damage_from': { - 'type': 'array', - 'items': { - 'type': 'object', - 'required': [ 'name', 'url' ], - 'properties': { - 'name': { - 'type': 'string', - 'example': 'water' - }, - 'url': { - 'type': 'string', - 'format': 'uri', - 'example': 'https://pokeapi.co/api/v2/type/11/' - } - } - } - } - } - } - } - }, - }) + @extend_schema_field( + field={ + "type": "array", + "items": { + "type": "object", + "required": ["generation", "damage_relations"], + "properties": { + "generation": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "example": "generation-v"}, + "url": { + "type": "string", + "format": "uri", + "example": "https://pokeapi.co/api/v2/generation/5/", + }, + }, + }, + "damage_relations": { + "type": "object", + "required": [ + "no_damage_to", + "half_damage_to", + "double_damage_to", + "no_damage_from", + "half_damage_from", + "double_damage_from", + ], + "properties": { + "no_damage_to": { + "type": "array", + "items": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "example": "flying"}, + "url": { + "type": "string", + "format": "uri", + "example": "https://pokeapi.co/api/v2/type/3/", + }, + }, + }, + }, + "half_damage_to": { + "type": "array", + "items": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "example": "bug"}, + "url": { + "type": "string", + "format": "uri", + "example": "https://pokeapi.co/api/v2/type/7/", + }, + }, + }, + }, + "double_damage_to": { + "type": "array", + "items": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "example": "poison"}, + "url": { + "type": "string", + "format": "uri", + "example": "https://pokeapi.co/api/v2/type/4/", + }, + }, + }, + }, + "no_damage_from": { + "type": "array", + "items": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": { + "type": "string", + "example": "electric", + }, + "url": { + "type": "string", + "format": "uri", + "example": "https://pokeapi.co/api/v2/type/13/", + }, + }, + }, + }, + "half_damage_from": { + "type": "array", + "items": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "example": "poison"}, + "url": { + "type": "string", + "format": "uri", + "example": "https://pokeapi.co/api/v2/type/4/", + }, + }, + }, + }, + "double_damage_from": { + "type": "array", + "items": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "example": "water"}, + "url": { + "type": "string", + "format": "uri", + "example": "https://pokeapi.co/api/v2/type/11/", + }, + }, + }, + }, + }, + }, + }, + }, + } + ) def get_type_past_relationships(self, obj): # collect data from DB damage_type_results = list(TypeEfficacyPast.objects.filter(damage_type=obj)) @@ -2776,35 +2716,35 @@ class TypeDetailSerializer(serializers.ModelSerializer): gen_introduced = Generation.objects.get(pk=type_obj.generation.id) return gen_introduced.id <= current_gen.id - @extend_schema_field(field={'type': 'array', - 'items': { - 'type': 'object', - 'required': [ 'potency', 'flavor' ], - 'properties': { - 'slot': { - 'type': 'integer', - 'example': 1 - }, - 'pokemon': { - 'type': 'object', - 'require': [ 'name', 'url' ], - 'properties': { - 'name': { - 'type': 'string', - 'description': 'The name of the pokemon', - 'example': 'sandshrew' - }, - 'url': { - 'type': 'string', - 'format': 'uri', - 'description': 'The URL to get more information about the pokemon', - 'example': 'https://pokeapi.co/api/v2/pokemon/27/' - } - } - } - } - }, - }) + @extend_schema_field( + field={ + "type": "array", + "items": { + "type": "object", + "required": ["potency", "flavor"], + "properties": { + "slot": {"type": "integer", "example": 1}, + "pokemon": { + "type": "object", + "require": ["name", "url"], + "properties": { + "name": { + "type": "string", + "description": "The name of the pokemon", + "example": "sandshrew", + }, + "url": { + "type": "string", + "format": "uri", + "description": "The URL to get more information about the pokemon", + "example": "https://pokeapi.co/api/v2/pokemon/27/", + }, + }, + }, + }, + }, + } + ) def get_type_pokemon(self, obj): poke_type_objects = PokemonType.objects.filter(type=obj) poke_types = PokemonTypeSerializer( @@ -2911,23 +2851,23 @@ class MoveMetaAilmentDetailSerializer(serializers.ModelSerializer): model = MoveMetaAilment fields = ("id", "name", "moves", "names") - @extend_schema_field(field={'type': 'array', - 'items': { - 'type': 'object', - 'required': [ 'name', 'url' ], - 'properties': { - 'name': { - 'type': 'string', - 'example': 'thunder-punch' - }, - 'url': { - 'type': 'string', - 'format': 'uri', - 'example': 'https://pokeapi.co/api/v2/move/9/' - } - } - }, - }) + @extend_schema_field( + field={ + "type": "array", + "items": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "example": "thunder-punch"}, + "url": { + "type": "string", + "format": "uri", + "example": "https://pokeapi.co/api/v2/move/9/", + }, + }, + }, + } + ) def get_ailment_moves(self, obj): move_meta_objects = MoveMeta.objects.filter(move_meta_ailment=obj) moves = [] @@ -2958,23 +2898,23 @@ class MoveMetaCategoryDetailSerializer(serializers.ModelSerializer): model = MoveMetaCategory fields = ("id", "name", "descriptions", "moves") - @extend_schema_field(field={'type': 'array', - 'items': { - 'type': 'object', - 'required': [ 'name', 'url' ], - 'properties': { - 'name': { - 'type': 'string', - 'example': 'sing' - }, - 'url': { - 'type': 'string', - 'format': 'uri', - 'example': 'https://pokeapi.co/api/v2/move/47/' - } - } - }, - }) + @extend_schema_field( + field={ + "type": "array", + "items": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "example": "sing"}, + "url": { + "type": "string", + "format": "uri", + "example": "https://pokeapi.co/api/v2/move/47/", + }, + }, + }, + } + ) def get_category_moves(self, obj): move_meta_objects = MoveMeta.objects.filter(move_meta_category=obj) moves = [] @@ -3069,37 +3009,37 @@ class MoveChangeSerializer(serializers.ModelSerializer): "version_group", ) - @extend_schema_field(field={'type': 'array', - 'items': { - 'type': 'object', - 'required': [ 'effect', 'short_effect', 'language' ], - 'properties': { - 'effect': { - 'type': 'string', - 'example': 'Inflicts [regular damage]{mechanic:regular-damage}.' - }, - 'short_effect': { - 'type': 'string', - 'example': 'Inflicts regular damage with no additional effect.' - }, - 'language': { - 'type': 'object', - 'required': [ 'name', 'url' ], - 'properties': { - 'name': { - 'type': 'string', - 'example': 'en' - }, - 'url': { - 'type': 'string', - 'format': 'uri', - 'example': 'https://pokeapi.co/api/v2/language/9/' - } - } - } - }, - }, - }) + @extend_schema_field( + field={ + "type": "array", + "items": { + "type": "object", + "required": ["effect", "short_effect", "language"], + "properties": { + "effect": { + "type": "string", + "example": "Inflicts [regular damage]{mechanic:regular-damage}.", + }, + "short_effect": { + "type": "string", + "example": "Inflicts regular damage with no additional effect.", + }, + "language": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "example": "en"}, + "url": { + "type": "string", + "format": "uri", + "example": "https://pokeapi.co/api/v2/language/9/", + }, + }, + }, + }, + }, + } + ) def get_effects(self, obj): effect_texts = MoveEffectEffectText.objects.filter(move_effect=obj.move_effect) data = MoveEffectEffectTextSerializer( @@ -3197,23 +3137,23 @@ class MoveDetailSerializer(serializers.ModelSerializer): "learned_by_pokemon", ) - @extend_schema_field(field={'type': 'array', - 'items': { - 'type': 'object', - 'required': [ 'name', 'url' ], - 'properties': { - 'name': { - 'type': 'string', - 'example': 'clefairy' - }, - 'url': { - 'type': 'string', - 'format': 'uri', - 'example': 'https://pokeapi.co/api/v2/pokemon/35/' - } - } - }, - }) + @extend_schema_field( + field={ + "type": "array", + "items": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "example": "clefairy"}, + "url": { + "type": "string", + "format": "uri", + "example": "https://pokeapi.co/api/v2/pokemon/35/", + }, + }, + }, + } + ) def get_learned_by_pokemon(self, obj): pokemon_moves = PokemonMove.objects.filter(move_id=obj).order_by("pokemon_id") @@ -3231,40 +3171,40 @@ class MoveDetailSerializer(serializers.ModelSerializer): return pokemon_list - @extend_schema_field(field={'type': 'array', - 'items': { - 'type': 'object', - 'required': [ 'machine', 'version_group' ], - 'properties': { - 'machine': { - 'type': 'object', - 'required': [ 'url' ], - 'properties': { - 'url': { - 'type': 'string', - 'format': 'uri', - 'example': 'https://pokeapi.co/api/v2/machine/1/' - } - } - }, - 'version_group': { - 'type': 'object', - 'required': [ 'name', 'url' ], - 'properties': { - 'name': { - 'type': 'string', - 'example': 'sword-shield' - }, - 'url': { - 'type': 'string', - 'format': 'uri', - 'example': 'https://pokeapi.co/api/v2/version-group/1/' - } - } - } - } - }, - }) + @extend_schema_field( + field={ + "type": "array", + "items": { + "type": "object", + "required": ["machine", "version_group"], + "properties": { + "machine": { + "type": "object", + "required": ["url"], + "properties": { + "url": { + "type": "string", + "format": "uri", + "example": "https://pokeapi.co/api/v2/machine/1/", + } + }, + }, + "version_group": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "example": "sword-shield"}, + "url": { + "type": "string", + "format": "uri", + "example": "https://pokeapi.co/api/v2/version-group/1/", + }, + }, + }, + }, + }, + } + ) def get_move_machines(self, obj): machine_objects = Machine.objects.filter(move=obj) @@ -3285,99 +3225,96 @@ class MoveDetailSerializer(serializers.ModelSerializer): return machines - @extend_schema_field(field={'type': 'object', - 'properties': { - 'required': [ 'normal', 'super' ], - 'normal': { - 'type': 'object', - 'required': [ 'use_before', 'use_after' ], - 'properties': { - 'use_before': { - 'type': 'array', - 'nullable': True, - 'items': { - 'type': 'object', - 'required': [ 'name', 'url' ], - 'properties': { - 'name': { - 'type': 'string', - 'example': 'fire-punch' - }, - 'url': { - 'type': 'string', - 'format': 'uri', - 'example': 'https://pokeapi.co/api/v2/move/7/' - } - } - } - }, - 'use_after': { - 'type': 'array', - 'nullable': True, - 'items': { - 'type': 'object', - 'required': [ 'name', 'url' ], - 'properties': { - 'name': { - 'type': 'string', - 'example': 'ice-punch' - }, - 'url': { - 'type': 'string', - 'format': 'uri', - 'example': 'https://pokeapi.co/api/v2/move/8/' - } - } - } - } - } - }, - 'super': { - 'type': 'object', - 'required': [ 'use_before', 'use_after' ], - 'properties': { - 'use_before': { - 'type': 'array', - 'nullable': True, - 'items': { - 'type': 'object', - 'required': [ 'name', 'url' ], - 'properties': { - 'name': { - 'type': 'string', - 'example': 'night-slash' - }, - 'url': { - 'type': 'string', - 'format': 'uri', - 'example': 'https://pokeapi.co/api/v2/move/400/' - } - } - } - }, - 'use_after': { - 'type': 'array', - 'nullable': True, - 'items': { - 'type': 'object', - 'required': [ 'name', 'url' ], - 'properties': { - 'name': { - 'type': 'string', - 'example': 'focus-energy' - }, - 'url': { - 'type': 'string', - 'format': 'uri', - 'example': 'https://pokeapi.co/api/v2/move/116/' - } - } - } - } - } - }, - }, - }) + @extend_schema_field( + field={ + "type": "object", + "properties": { + "required": ["normal", "super"], + "normal": { + "type": "object", + "required": ["use_before", "use_after"], + "properties": { + "use_before": { + "type": "array", + "nullable": True, + "items": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "example": "fire-punch"}, + "url": { + "type": "string", + "format": "uri", + "example": "https://pokeapi.co/api/v2/move/7/", + }, + }, + }, + }, + "use_after": { + "type": "array", + "nullable": True, + "items": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "example": "ice-punch"}, + "url": { + "type": "string", + "format": "uri", + "example": "https://pokeapi.co/api/v2/move/8/", + }, + }, + }, + }, + }, + }, + "super": { + "type": "object", + "required": ["use_before", "use_after"], + "properties": { + "use_before": { + "type": "array", + "nullable": True, + "items": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": { + "type": "string", + "example": "night-slash", + }, + "url": { + "type": "string", + "format": "uri", + "example": "https://pokeapi.co/api/v2/move/400/", + }, + }, + }, + }, + "use_after": { + "type": "array", + "nullable": True, + "items": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": { + "type": "string", + "example": "focus-energy", + }, + "url": { + "type": "string", + "format": "uri", + "example": "https://pokeapi.co/api/v2/move/116/", + }, + }, + }, + }, + }, + }, + }, + } + ) def get_combos(self, obj): normal_before_objects = ContestCombo.objects.filter(first_move=obj) normal_before_data = ContestComboSerializer( @@ -3435,37 +3372,37 @@ class MoveDetailSerializer(serializers.ModelSerializer): return details - @extend_schema_field(field={'type': 'array', - 'items': { - 'type': 'object', - 'required': [ 'effect', 'short_effect', 'language' ], - 'properties': { - 'effect': { - 'type': 'string', - 'example': 'Inflicts [regular damage]{mechanic:regular-damage}.' - }, - 'short_effect': { - 'type': 'string', - 'example': 'Inflicts regular damage with no additional effect.' - }, - 'language': { - 'type': 'object', - 'required': [ 'name', 'url' ], - 'properties': { - 'name': { - 'type': 'string', - 'example': 'en' - }, - 'url': { - 'type': 'string', - 'format': 'uri', - 'example': 'https://pokeapi.co/api/v2/language/9/' - } - } - } - }, - }, - }) + @extend_schema_field( + field={ + "type": "array", + "items": { + "type": "object", + "required": ["effect", "short_effect", "language"], + "properties": { + "effect": { + "type": "string", + "example": "Inflicts [regular damage]{mechanic:regular-damage}.", + }, + "short_effect": { + "type": "string", + "example": "Inflicts regular damage with no additional effect.", + }, + "language": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "example": "en"}, + "url": { + "type": "string", + "format": "uri", + "example": "https://pokeapi.co/api/v2/language/9/", + }, + }, + }, + }, + }, + } + ) def get_effect_text(self, obj): effect_texts = MoveEffectEffectText.objects.filter(move_effect=obj.move_effect) data = MoveEffectEffectTextSerializer( @@ -3480,57 +3417,54 @@ class MoveDetailSerializer(serializers.ModelSerializer): return data - @extend_schema_field(field={'type': 'array', - 'items': { - 'type': 'object', - 'required': [ 'effect_entries', 'version_group' ], - 'properties': { - 'effect_entries': { - 'type': 'array', - 'items': { - 'type': 'object', - 'required': [ 'effect', 'language' ], - 'properties': { - 'effect': { - 'type': 'string', - 'example': 'Hits Pokémon under the effects of dig and fly.' - }, - 'language': { - 'type': 'object', - 'required': [ 'name', 'url' ], - 'properties': { - 'name': { - 'type': 'string', - 'example': 'en' - }, - 'url': { - 'type': 'string', - 'format': 'uri', - 'example': 'https://pokeapi.co/api/v2/language/9/' - } - } - } - } - } - }, - 'version_group': { - 'type': 'object', - 'required': [ 'name', 'url' ], - 'properties': { - 'name': { - 'type': 'string', - 'example': 'gold-silver' - }, - 'url': { - 'type': 'string', - 'format': 'uri', - 'example': 'https://pokeapi.co/api/v2/version-group/3/' - } - } - } - } - } - }) + @extend_schema_field( + field={ + "type": "array", + "items": { + "type": "object", + "required": ["effect_entries", "version_group"], + "properties": { + "effect_entries": { + "type": "array", + "items": { + "type": "object", + "required": ["effect", "language"], + "properties": { + "effect": { + "type": "string", + "example": "Hits Pokémon under the effects of dig and fly.", + }, + "language": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "example": "en"}, + "url": { + "type": "string", + "format": "uri", + "example": "https://pokeapi.co/api/v2/language/9/", + }, + }, + }, + }, + }, + }, + "version_group": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "example": "gold-silver"}, + "url": { + "type": "string", + "format": "uri", + "example": "https://pokeapi.co/api/v2/version-group/3/", + }, + }, + }, + }, + }, + } + ) def get_effect_change_text(self, obj): effect_changes = MoveEffectChange.objects.filter(move_effect=obj.move_effect) data = MoveEffectChangeSerializer( @@ -3539,33 +3473,30 @@ class MoveDetailSerializer(serializers.ModelSerializer): return data - @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/' - } - } - } - } - } - }) + @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( @@ -3610,37 +3541,31 @@ class PalParkAreaDetailSerializer(serializers.ModelSerializer): model = PalParkArea fields = ("id", "name", "names", "pokemon_encounters") - @extend_schema_field(field={'type': 'array', - 'items': { - 'type': 'object', - 'required': [ 'base_score', 'pokemon-species', 'rate' ], - 'properties': { - 'base_score': { - 'type': 'number', - 'example': 50 - }, - 'pokemon-species': { - 'type': 'object', - 'required': [ 'name', 'url' ], - 'properties': { - 'name': { - 'type': 'string', - 'example': 'bulbasaur' - }, - 'url': { - 'type': 'string', - 'format': 'uri', - 'example': 'https://pokeapi.co/api/v2/pokemon-species/1/' - } - } - }, - 'rate': { - 'type': 'number', - 'example': 30 - }, - } - } - }) + @extend_schema_field( + field={ + "type": "array", + "items": { + "type": "object", + "required": ["base_score", "pokemon-species", "rate"], + "properties": { + "base_score": {"type": "number", "example": 50}, + "pokemon-species": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "example": "bulbasaur"}, + "url": { + "type": "string", + "format": "uri", + "example": "https://pokeapi.co/api/v2/pokemon-species/1/", + }, + }, + }, + "rate": {"type": "number", "example": 30}, + }, + }, + } + ) def get_encounters(self, obj): pal_park_objects = PalPark.objects.filter(pal_park_area=obj) parks = PalParkSerializer( @@ -3725,33 +3650,30 @@ class PokemonFormDetailSerializer(serializers.ModelSerializer): "types", ) - @extend_schema_field(field={'type': 'array', - 'items': { - 'type': 'object', - 'required': [ 'language', 'name' ], - 'properties': { - 'language': { - 'type': 'object', - 'required': [ 'name', 'url' ], - 'properties': { - 'name': { - 'type': 'string', - 'example': 'en' - }, - 'url': { - 'type': 'string', - 'format': 'uri', - 'example': 'https://pokeapi.co/api/v2/language/9/' - } - } - }, - 'name': { - 'type': 'string', - 'example': 'Plant Cloak' - } - } - } - }) + @extend_schema_field( + field={ + "type": "array", + "items": { + "type": "object", + "required": ["language", "name"], + "properties": { + "language": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "example": "en"}, + "url": { + "type": "string", + "format": "uri", + "example": "https://pokeapi.co/api/v2/language/9/", + }, + }, + }, + "name": {"type": "string", "example": "Plant Cloak"}, + }, + }, + } + ) def get_pokemon_form_names(self, obj): form_results = PokemonFormName.objects.filter( pokemon_form=obj, name__regex=".+" @@ -3767,33 +3689,30 @@ class PokemonFormDetailSerializer(serializers.ModelSerializer): return data - @extend_schema_field(field={'type': 'array', - 'items': { - 'type': 'object', - 'required': [ 'language', 'name' ], - 'properties': { - 'language': { - 'type': 'object', - 'required': [ 'name', 'url' ], - 'properties': { - 'name': { - 'type': 'string', - 'example': 'en' - }, - 'url': { - 'type': 'string', - 'format': 'uri', - 'example': 'https://pokeapi.co/api/v2/language/9/' - } - } - }, - 'name': { - 'type': 'string', - 'example': 'Plant Cloak' - } - } - } - }) + @extend_schema_field( + field={ + "type": "array", + "items": { + "type": "object", + "required": ["language", "name"], + "properties": { + "language": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "example": "en"}, + "url": { + "type": "string", + "format": "uri", + "example": "https://pokeapi.co/api/v2/language/9/", + }, + }, + }, + "name": {"type": "string", "example": "Plant Cloak"}, + }, + }, + } + ) def get_pokemon_form_pokemon_names(self, obj): form_results = PokemonFormName.objects.filter( pokemon_form=obj, pokemon_name__regex=".+" @@ -3810,62 +3729,62 @@ class PokemonFormDetailSerializer(serializers.ModelSerializer): return data - @extend_schema_field(field={'type': 'object', - 'properties': { - 'default': { - 'type': 'string', - 'format': 'uri', - 'example': 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/412.png', - } - }, - 'additionalProperties': { # Stoplight Elements doesn't render this well - 'type': 'string', - 'format': 'uri', - 'nullable': True, - 'example': 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/shiny/412.png' - }, - 'example': { - 'back_default': 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/412.png', - 'back_female': None, - 'back_shiny': 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/shiny/412.png', - 'back_shiny_female': None, - 'front_default': 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/412.png', - 'front_female': None, - 'front_shiny': 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/shiny/412.png', - 'front_shiny_female': None - } - }) + @extend_schema_field( + field={ + "type": "object", + "properties": { + "default": { + "type": "string", + "format": "uri", + "example": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/412.png", + } + }, + "additionalProperties": { # Stoplight Elements doesn't render this well + "type": "string", + "format": "uri", + "nullable": True, + "example": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/shiny/412.png", + }, + "example": { + "back_default": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/412.png", + "back_female": None, + "back_shiny": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/shiny/412.png", + "back_shiny_female": None, + "front_default": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/412.png", + "front_female": None, + "front_shiny": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/shiny/412.png", + "front_shiny_female": None, + }, + } + ) def get_pokemon_form_sprites(self, obj): sprites_object = PokemonFormSprites.objects.get(pokemon_form_id=obj) return sprites_object.sprites - @extend_schema_field(field={'type': 'array', - 'items': { - 'type': 'object', - 'required': [ 'slot', 'type' ], - 'properties': { - 'slot': { - 'type': 'number', - 'example': 1 - }, - 'type': { - 'type': 'object', - 'required': [ 'name', 'url' ], - 'properties': { - 'name': { - 'type': 'string', - 'example': 'bug' - }, - 'url': { - 'type': 'string', - 'format': 'uri', - 'example': 'https://pokeapi.co/api/v2/type/7/' - } - } - }, - } - } - }) + @extend_schema_field( + field={ + "type": "array", + "items": { + "type": "object", + "required": ["slot", "type"], + "properties": { + "slot": {"type": "number", "example": 1}, + "type": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "example": "bug"}, + "url": { + "type": "string", + "format": "uri", + "example": "https://pokeapi.co/api/v2/type/7/", + }, + }, + }, + }, + }, + } + ) def get_pokemon_form_types(self, obj): form_type_objects = PokemonFormType.objects.filter(pokemon_form=obj) form_types = PokemonFormTypeSerializer( @@ -3949,28 +3868,29 @@ class MoveLearnMethodDetailSerializer(serializers.ModelSerializer): model = MoveLearnMethod fields = ("id", "name", "names", "descriptions", "version_groups") - # "version_groups": [ - # { - # "name": "red-blue", - # "url": "https://pokeapi.co/api/v2/version-group/1/" - # }, - @extend_schema_field(field={'type': 'array', - 'items': { - 'type': 'object', - 'required': [ 'name', 'url' ], - 'properties': { - 'name': { - 'type': 'string', - 'example': 'red-blue' - }, - 'url': { - 'type': 'string', - 'format': 'uri', - 'example': 'https://pokeapi.co/api/v2/version-group/1/' - } - } - } - }) + # "version_groups": [ + # { + # "name": "red-blue", + # "url": "https://pokeapi.co/api/v2/version-group/1/" + # }, + + @extend_schema_field( + field={ + "type": "array", + "items": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "example": "red-blue"}, + "url": { + "type": "string", + "format": "uri", + "example": "https://pokeapi.co/api/v2/version-group/1/", + }, + }, + }, + } + ) def get_method_version_groups(self, obj): version_group_objects = VersionGroupMoveLearnMethod.objects.filter( move_learn_method=obj @@ -4015,23 +3935,23 @@ class PokemonShapeDetailSerializer(serializers.ModelSerializer): model = PokemonShape fields = ("id", "name", "awesome_names", "names", "pokemon_species") - @extend_schema_field(field={'type': 'array', - 'items': { - 'type': 'object', - 'required': [ 'url', 'name' ], - 'properties': { - 'url': { - 'type': 'string', - 'format': 'uri', - 'example': 'https://pokeapi.co/api/v2/language/9/' - }, - 'name': { - 'type': 'string', - 'example': 'Ball' - } - } - } - }) + @extend_schema_field( + field={ + "type": "array", + "items": { + "type": "object", + "required": ["url", "name"], + "properties": { + "url": { + "type": "string", + "format": "uri", + "example": "https://pokeapi.co/api/v2/language/9/", + }, + "name": {"type": "string", "example": "Ball"}, + }, + }, + } + ) def get_shape_names(self, obj): results = PokemonShapeName.objects.filter(pokemon_shape_id=obj) serializer = PokemonShapeNameSerializer( @@ -4044,49 +3964,46 @@ class PokemonShapeDetailSerializer(serializers.ModelSerializer): return data - # "awesome_names": [ - # { - # "awesome_name": "Pomacé", - # "language": { - # "name": "fr", - # "url": "https://pokeapi.co/api/v2/language/5/" - # } - # }, - # { - # "awesome_name": "Pomaceous", - # "language": { - # "name": "en", - # "url": "https://pokeapi.co/api/v2/language/9/" - # } - # } - # ], - @extend_schema_field(field={'type': 'array', - 'items': { - 'type': 'object', - 'required': [ 'awesome_name', 'language' ], - 'properties': { - 'awesome_name': { - 'type': 'string', - 'example': 'Pomaceous' - }, - 'language': { - 'type': 'object', - 'required': [ 'name', 'url' ], - 'properties': { - 'name': { - 'type': 'string', - 'example': 'en' - }, - 'url': { - 'type': 'string', - 'format': 'uri', - 'example': 'https://pokeapi.co/api/v2/language/9/' - } - } - } - } - } - }) + # "awesome_names": [ + # { + # "awesome_name": "Pomacé", + # "language": { + # "name": "fr", + # "url": "https://pokeapi.co/api/v2/language/5/" + # } + # }, + # { + # "awesome_name": "Pomaceous", + # "language": { + # "name": "en", + # "url": "https://pokeapi.co/api/v2/language/9/" + # } + # } + # ], + @extend_schema_field( + field={ + "type": "array", + "items": { + "type": "object", + "required": ["awesome_name", "language"], + "properties": { + "awesome_name": {"type": "string", "example": "Pomaceous"}, + "language": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "example": "en"}, + "url": { + "type": "string", + "format": "uri", + "example": "https://pokeapi.co/api/v2/language/9/", + }, + }, + }, + }, + }, + } + ) def get_shape_awesome_names(self, obj): results = PokemonShapeName.objects.filter(pokemon_shape_id=obj) serializer = PokemonShapeNameSerializer( @@ -4180,50 +4097,56 @@ class PokemonDetailSerializer(serializers.ModelSerializer): "past_types", ) - @extend_schema_field(field={'type': 'object', - 'properties': { - 'front_default': { - 'type': 'string', - 'format': 'uri', - 'exmaple': 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/1.png', - } - }, - 'additionalProperties': { # Stoplight Elements doesn't render this well - 'type': 'string', - 'format': 'uri', - 'nullable': True, - 'example': 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/shiny/1.png' - }, - 'example': { - 'back_default': 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/1.png', - 'back_female': None, - 'back_shiny': 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/shiny/1.png', - 'back_shiny_female': None, - 'front_default': 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/1.png', - 'front_female': None, - 'front_shiny': 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/shiny/1.png', - 'front_shiny_female': None, - } - }) + @extend_schema_field( + field={ + "type": "object", + "properties": { + "front_default": { + "type": "string", + "format": "uri", + "exmaple": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/1.png", + } + }, + "additionalProperties": { # Stoplight Elements doesn't render this well + "type": "string", + "format": "uri", + "nullable": True, + "example": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/shiny/1.png", + }, + "example": { + "back_default": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/1.png", + "back_female": None, + "back_shiny": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/shiny/1.png", + "back_shiny_female": None, + "front_default": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/1.png", + "front_female": None, + "front_shiny": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/shiny/1.png", + "front_shiny_female": None, + }, + } + ) def get_pokemon_sprites(self, obj): sprites_object = PokemonSprites.objects.get(pokemon_id=obj) return sprites_object.sprites - @extend_schema_field(field={'type': 'object', - 'required': [ 'latest', 'legacy' ], - 'properties': { - 'latest': { - 'type': 'string', - 'format': 'uri', - 'example': 'https://raw.githubusercontent.com/PokeAPI/cries/main/cries/pokemon/latest/50.ogg' - }, - 'legacy': { - 'type': 'string', - 'format': 'uri', - 'example': 'https://raw.githubusercontent.com/PokeAPI/cries/main/cries/pokemon/legacy/50.ogg' - } - } - }) + @extend_schema_field( + field={ + "type": "object", + "required": ["latest", "legacy"], + "properties": { + "latest": { + "type": "string", + "format": "uri", + "example": "https://raw.githubusercontent.com/PokeAPI/cries/main/cries/pokemon/latest/50.ogg", + }, + "legacy": { + "type": "string", + "format": "uri", + "example": "https://raw.githubusercontent.com/PokeAPI/cries/main/cries/pokemon/legacy/50.ogg", + }, + }, + } + ) def get_pokemon_cries(self, obj): cries_object = PokemonCries.objects.get(pokemon_id=obj) return cries_object.cries @@ -4495,72 +4418,73 @@ class PokemonDetailSerializer(serializers.ModelSerializer): # "url": "https://pokeapi.co/api/v2/version-group/1/" # } # }, - @extend_schema_field(field={'type': 'array', - 'items': { - 'type': 'object', - 'required': [ 'move', 'version_group_details' ], - 'properties': { - 'move': { - 'type': 'object', - 'required': [ 'name', 'url' ], - 'properties': { - 'name': { - 'type': 'string', - 'example': 'scratch' - }, - 'url': { - 'type': 'string', - 'format': 'uri', - 'example': 'https://pokeapi.co/api/v2/move/10/' - } - } - }, - 'version_group_details': { - 'type': 'array', - 'items': { - 'type': 'object', - 'required': [ 'level_learned_at', 'move_learn_method', 'version_group' ], - 'properties': { - 'level_learned_at': { - 'type': 'number', - 'example': 1 - }, - 'move_learn_method': { - 'type': 'object', - 'required': [ 'name', 'url' ], - 'properties': { - 'name': { - 'type': 'string', - 'example': 'level-up' - }, - 'url': { - 'type': 'string', - 'format': 'uri', - 'example': 'https://pokeapi.co/api/v2/move-learn-method/1/' - } - } - }, - 'version_group': { - 'type': 'object', - 'required': [ 'name', 'url' ], - 'properties': { - 'name': { - 'type': 'string', - 'example': 'red-blue' - }, - 'url': { - 'type': 'string', - 'format': 'uri', - 'example': 'https://pokeapi.co/api/v2/version-group/1/' - } - } - } - } - } - } - } - } - }) + @extend_schema_field( + field={ + "type": "array", + "items": { + "type": "object", + "required": ["move", "version_group_details"], + "properties": { + "move": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "example": "scratch"}, + "url": { + "type": "string", + "format": "uri", + "example": "https://pokeapi.co/api/v2/move/10/", + }, + }, + }, + "version_group_details": { + "type": "array", + "items": { + "type": "object", + "required": [ + "level_learned_at", + "move_learn_method", + "version_group", + ], + "properties": { + "level_learned_at": {"type": "number", "example": 1}, + "move_learn_method": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": { + "type": "string", + "example": "level-up", + }, + "url": { + "type": "string", + "format": "uri", + "example": "https://pokeapi.co/api/v2/move-learn-method/1/", + }, + }, + }, + "version_group": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": { + "type": "string", + "example": "red-blue", + }, + "url": { + "type": "string", + "format": "uri", + "example": "https://pokeapi.co/api/v2/version-group/1/", + }, + }, + }, + }, + }, + }, + }, + }, + } + ) def get_pokemon_moves(self, obj): version_objects = VersionGroup.objects.all() version_data = VersionGroupSummarySerializer( @@ -4625,54 +4549,48 @@ class PokemonDetailSerializer(serializers.ModelSerializer): # "url": "https://pokeapi.co/api/v2/version/12/" # } # }, - @extend_schema_field(field={'type': 'object', - 'required': [ 'item', 'version_details' ], - 'properties': { - 'item': { - 'type': 'object', - 'required': [ 'name', 'url' ], - 'properties': { - 'name': { - 'type': 'string', - 'example': 'soft-sand' - }, - 'url': { - 'type': 'string', - 'format': 'uri', - 'example': 'https://pokeapi.co/api/v2/item/214/' - } - } - }, - 'version_details': { - 'type': 'array', - 'items': { - 'type': 'object', - 'required': [ 'rarity', 'version' ], - 'properties': { - 'rarity': { - 'type': 'number', - 'example': 5 - }, - 'version': { - 'type': 'object', - 'required': [ 'name', 'url' ], - 'properties': { - 'name': { - 'type': 'string', - 'example': 'diamond' - }, - 'url': { - 'type': 'string', - 'format': 'uri', - 'example': 'https://pokeapi.co/api/v2/version/12/' - } - } - } - } - } - }, - } - }) + @extend_schema_field( + field={ + "type": "object", + "required": ["item", "version_details"], + "properties": { + "item": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "example": "soft-sand"}, + "url": { + "type": "string", + "format": "uri", + "example": "https://pokeapi.co/api/v2/item/214/", + }, + }, + }, + "version_details": { + "type": "array", + "items": { + "type": "object", + "required": ["rarity", "version"], + "properties": { + "rarity": {"type": "number", "example": 5}, + "version": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "example": "diamond"}, + "url": { + "type": "string", + "format": "uri", + "example": "https://pokeapi.co/api/v2/version/12/", + }, + }, + }, + }, + }, + }, + }, + } + ) def get_pokemon_held_items(self, obj): # Get items related to this pokemon and pull out unique Item IDs pokemon_items = PokemonItem.objects.filter(pokemon_id=obj).order_by("item_id") @@ -4714,37 +4632,31 @@ class PokemonDetailSerializer(serializers.ModelSerializer): # "is_hidden": false, # "slot": 1 # }, - @extend_schema_field(field={'type': 'array', - 'items': { - 'type': 'object', - 'required': [ 'ability', 'is_hidden', 'slot' ], - 'properties': { - 'ability': { - 'type': 'object', - 'required': [ 'name', 'url' ], - 'properties': { - 'name': { - 'type': 'string', - 'example': 'sand-veil' - }, - 'url': { - 'type': 'string', - 'format': 'uri', - 'example': 'https://pokeapi.co/api/v2/ability/8/' - } - } - }, - 'is_hidden': { - 'type': 'boolean', - 'example': False - }, - 'slot': { - 'type': 'number', - 'example': 1 - }, - } - } - }) + @extend_schema_field( + field={ + "type": "array", + "items": { + "type": "object", + "required": ["ability", "is_hidden", "slot"], + "properties": { + "ability": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "example": "sand-veil"}, + "url": { + "type": "string", + "format": "uri", + "example": "https://pokeapi.co/api/v2/ability/8/", + }, + }, + }, + "is_hidden": {"type": "boolean", "example": False}, + "slot": {"type": "number", "example": 1}, + }, + }, + } + ) def get_pokemon_abilities(self, obj): pokemon_ability_objects = PokemonAbility.objects.filter(pokemon=obj) data = PokemonAbilitySerializer( @@ -4774,61 +4686,55 @@ class PokemonDetailSerializer(serializers.ModelSerializer): # "url": "https://pokeapi.co/api/v2/generation/6/" # } # } - @extend_schema_field(field={'type': 'array', - 'items': { - 'type': 'object', - 'required': [ 'abilities', 'generation' ], - 'properties': { - 'abilities': { - 'type': 'array', - 'items': { - 'type': 'object', - 'required': [ 'ability', 'is_hidden', 'slot' ], - 'properties': { - 'ability': { - 'type': 'object', - 'required': [ 'name', 'url' ], - 'properties': { - 'name': { - 'type': 'string', - 'example': 'levitate' - }, - 'url': { - 'type': 'string', - 'format': 'uri', - 'example': 'https://pokeapi.co/api/v2/ability/26/' - } - } - }, - 'is_hidden': { - 'type': 'boolean', - 'example': False - }, - 'slot': { - 'type': 'number', - 'example': 1 - } - } - } - }, - 'generation': { - 'type': 'object', - 'required': [ 'name', 'url' ], - 'properties': { - 'name': { - 'type': 'string', - 'example': 'generation-vi' - }, - 'url': { - 'type': 'string', - 'format': 'uri', - 'example': 'https://pokeapi.co/api/v2/generation/6/' - } - } - }, - } - } - }) + @extend_schema_field( + field={ + "type": "array", + "items": { + "type": "object", + "required": ["abilities", "generation"], + "properties": { + "abilities": { + "type": "array", + "items": { + "type": "object", + "required": ["ability", "is_hidden", "slot"], + "properties": { + "ability": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": { + "type": "string", + "example": "levitate", + }, + "url": { + "type": "string", + "format": "uri", + "example": "https://pokeapi.co/api/v2/ability/26/", + }, + }, + }, + "is_hidden": {"type": "boolean", "example": False}, + "slot": {"type": "number", "example": 1}, + }, + }, + }, + "generation": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "example": "generation-vi"}, + "url": { + "type": "string", + "format": "uri", + "example": "https://pokeapi.co/api/v2/generation/6/", + }, + }, + }, + }, + }, + } + ) def get_past_pokemon_abilities(self, obj): pokemon_past_ability_objects = PokemonAbilityPast.objects.filter(pokemon=obj) pokemon_past_abilities = PokemonAbilityPastSerializer( @@ -4871,33 +4777,30 @@ class PokemonDetailSerializer(serializers.ModelSerializer): # "url": "https://pokeapi.co/api/v2/type/8/" # } # }, - @extend_schema_field(field={'type': 'array', - 'items': { - 'type': 'object', - 'required': [ 'slot', 'type' ], - 'properties': { - 'slot': { - 'type': 'number', - 'example': 1 - }, - 'type': { - 'type': 'object', - 'required': [ 'name', 'url' ], - 'properties': { - 'name': { - 'type': 'string', - 'example': 'ghost' - }, - 'url': { - 'type': 'string', - 'format': 'uri', - 'example': 'https://pokeapi.co/api/v2/type/8/' - } - } - } - } - } - }) + @extend_schema_field( + field={ + "type": "array", + "items": { + "type": "object", + "required": ["slot", "type"], + "properties": { + "slot": {"type": "number", "example": 1}, + "type": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "example": "ghost"}, + "url": { + "type": "string", + "format": "uri", + "example": "https://pokeapi.co/api/v2/type/8/", + }, + }, + }, + }, + }, + } + ) def get_pokemon_types(self, obj): poke_type_objects = PokemonType.objects.filter(pokemon=obj) poke_types = PokemonTypeSerializer( @@ -4909,74 +4812,68 @@ class PokemonDetailSerializer(serializers.ModelSerializer): return poke_types - # "past_types": [ - # { - # "generation": { - # "name": "generation-v", - # "url": "https://pokeapi.co/api/v2/generation/5/" - # }, - # "types": [ - # { - # "slot": 1, - # "type": { - # "name": "normal", - # "url": "https://pokeapi.co/api/v2/type/1/" - # } - # } - # ] - # } - # ], - @extend_schema_field(field={'type': 'array', - 'items': { - 'type': 'object', - 'required': [ 'generation', 'types' ], - 'properties':{ - 'generation': { - 'type': 'object', - 'required': [ 'name', 'url' ], - 'properties': { - 'name': { - 'type': 'string', - 'example': 'generation-v' - }, - 'url': { - 'type': 'string', - 'format': 'uri', - 'example': 'https://pokeapi.co/api/v2/generation/5/' - } - } - }, - 'types': { - 'type': 'array', - 'items': { - 'type': 'object', - 'required': [ 'slot', 'type' ], - 'properties': { - 'slot': { - 'type': 'number', - 'example': 1 - }, - 'type': { - 'type': 'object', - 'required': [ 'name', 'url' ], - 'properties': { - 'name': { - 'type': 'string', - 'example': 'normal' - }, - 'url': { - 'type': 'string', - 'format': 'uri', - 'example': 'https://pokeapi.co/api/v2/type/1/' - } - } - }, - } - } - }, - } - } - }) + # "past_types": [ + # { + # "generation": { + # "name": "generation-v", + # "url": "https://pokeapi.co/api/v2/generation/5/" + # }, + # "types": [ + # { + # "slot": 1, + # "type": { + # "name": "normal", + # "url": "https://pokeapi.co/api/v2/type/1/" + # } + # } + # ] + # } + # ], + @extend_schema_field( + field={ + "type": "array", + "items": { + "type": "object", + "required": ["generation", "types"], + "properties": { + "generation": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "example": "generation-v"}, + "url": { + "type": "string", + "format": "uri", + "example": "https://pokeapi.co/api/v2/generation/5/", + }, + }, + }, + "types": { + "type": "array", + "items": { + "type": "object", + "required": ["slot", "type"], + "properties": { + "slot": {"type": "number", "example": 1}, + "type": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "example": "normal"}, + "url": { + "type": "string", + "format": "uri", + "example": "https://pokeapi.co/api/v2/type/1/", + }, + }, + }, + }, + }, + }, + }, + }, + } + ) def get_past_pokemon_types(self, obj): poke_past_type_objects = PokemonTypePast.objects.filter(pokemon=obj) poke_past_types = PokemonTypePastSerializer( @@ -5012,10 +4909,12 @@ class PokemonDetailSerializer(serializers.ModelSerializer): return final_data - @extend_schema_field(field={ - 'type': 'string', - 'example': 'https://pokeapi.co/api/v2/pokemon/1/encounters' - }) + @extend_schema_field( + field={ + "type": "string", + "example": "https://pokeapi.co/api/v2/pokemon/1/encounters", + } + ) def get_encounters(self, obj): return reverse("pokemon_encounters", kwargs={"pokemon_id": obj.pk}) @@ -5041,24 +4940,23 @@ class EvolutionTriggerDetailSerializer(serializers.HyperlinkedModelSerializer): model = EvolutionTrigger fields = ("id", "name", "names", "pokemon_species") - @extend_schema_field(field={ - 'type': 'array', - 'items': { - 'type': 'object', - 'required': [ 'name', 'url' ], - 'properties': { - 'name': { - 'type': 'string', - 'example': 'ivysaur' - }, - 'url': { - 'type': 'string', - 'format': 'uri', - 'example': 'https://pokeapi.co/api/v2/pokemon-species/2/' - } - } - } - }) + @extend_schema_field( + field={ + "type": "array", + "items": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "example": "ivysaur"}, + "url": { + "type": "string", + "format": "uri", + "example": "https://pokeapi.co/api/v2/pokemon-species/2/", + }, + }, + }, + } + ) def get_species(self, obj): evo_objects = PokemonEvolution.objects.filter(evolution_trigger=obj) species_list = [] @@ -5166,33 +5064,30 @@ class PokemonSpeciesDetailSerializer(serializers.ModelSerializer): "varieties", ) - @extend_schema_field(field={'type': 'array', - 'items': { - 'type': 'object', - 'required': [ 'language', 'name' ], - 'properties': { - 'language': { - 'type': 'object', - 'required': [ 'name', 'url' ], - 'properties': { - 'name': { - 'type': 'string', - 'example': 'en' - }, - 'url': { - 'type': 'string', - 'format': 'uri', - 'example': 'https://pokeapi.co/api/v2/language/9/' - } - } - }, - 'name': { - 'type': 'string', - 'example': 'bulbasaur' - } - } - } - }) + @extend_schema_field( + field={ + "type": "array", + "items": { + "type": "object", + "required": ["language", "name"], + "properties": { + "language": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "example": "en"}, + "url": { + "type": "string", + "format": "uri", + "example": "https://pokeapi.co/api/v2/language/9/", + }, + }, + }, + "name": {"type": "string", "example": "bulbasaur"}, + }, + }, + } + ) def get_pokemon_names(self, obj): species_results = PokemonSpeciesName.objects.filter(pokemon_species=obj) species_serializer = PokemonSpeciesNameSerializer( @@ -5213,33 +5108,30 @@ class PokemonSpeciesDetailSerializer(serializers.ModelSerializer): # "url": "https://pokeapi.co/api/v2/language/9/" # } # }, - @extend_schema_field(field={'type': 'array', - 'items': { - 'type': 'object', - 'required': [ 'genus', 'language' ], - 'properties': { - 'genus': { - 'type': 'string', - 'example': 'Seed Pokémon' - }, - 'language': { - 'type': 'object', - 'required': [ 'name', 'url' ], - 'properties': { - 'name': { - 'type': 'string', - 'example': 'en' - }, - 'url': { - 'type': 'string', - 'format': 'uri', - 'example': 'https://pokeapi.co/api/v2/language/9/' - } - } - } - } - } - }) + @extend_schema_field( + field={ + "type": "array", + "items": { + "type": "object", + "required": ["genus", "language"], + "properties": { + "genus": {"type": "string", "example": "Seed Pokémon"}, + "language": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "example": "en"}, + "url": { + "type": "string", + "format": "uri", + "example": "https://pokeapi.co/api/v2/language/9/", + }, + }, + }, + }, + }, + } + ) def get_pokemon_genera(self, obj): results = PokemonSpeciesName.objects.filter(pokemon_species=obj) serializer = PokemonSpeciesNameSerializer( @@ -5255,23 +5147,23 @@ class PokemonSpeciesDetailSerializer(serializers.ModelSerializer): return genera - @extend_schema_field(field={'type': 'array', - 'items': { - 'type': 'object', - 'required': [ 'name', 'url' ], - 'properties': { - 'name': { - 'type': 'string', - 'example': 'monster' - }, - 'url': { - 'type': 'string', - 'format': 'uri', - 'example': 'https://pokeapi.co/api/v2/egg-group/1/' - } - } - } - }) + @extend_schema_field( + field={ + "type": "array", + "items": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "example": "monster"}, + "url": { + "type": "string", + "format": "uri", + "example": "https://pokeapi.co/api/v2/egg-group/1/", + }, + }, + }, + } + ) def get_pokemon_egg_groups(self, obj): results = PokemonEggGroup.objects.filter(pokemon_species=obj) data = PokemonEggGroupSerializer(results, many=True, context=self.context).data @@ -5281,33 +5173,30 @@ class PokemonSpeciesDetailSerializer(serializers.ModelSerializer): return groups - @extend_schema_field(field={'type': 'array', - 'items': { - 'type': 'object', - 'required': [ 'is_default', 'pokemon' ], - 'properties': { - 'is_default': { - 'type': 'boolean', - 'example': True - }, - 'pokemon': { - 'type': 'object', - 'required': [ 'name', 'url' ], - 'properties': { - 'name': { - 'type': 'string', - 'example': 'bulbasaur' - }, - 'url': { - 'type': 'string', - 'format': 'uri', - 'example': 'https://pokeapi.co/api/v2/pokemon/1/' - } - } - } - } - } - }) + @extend_schema_field( + field={ + "type": "array", + "items": { + "type": "object", + "required": ["is_default", "pokemon"], + "properties": { + "is_default": {"type": "boolean", "example": True}, + "pokemon": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "example": "bulbasaur"}, + "url": { + "type": "string", + "format": "uri", + "example": "https://pokeapi.co/api/v2/pokemon/1/", + }, + }, + }, + }, + }, + } + ) def get_pokemon_varieties(self, obj): results = Pokemon.objects.filter(pokemon_species=obj) summary_data = PokemonSummarySerializer( @@ -5327,37 +5216,31 @@ class PokemonSpeciesDetailSerializer(serializers.ModelSerializer): return varieties - @extend_schema_field(field={'type': 'array', - 'items': { - 'type': 'object', - 'required': [ 'area', 'base_score', 'rate' ], - 'properties': { - 'area': { - 'type': 'object', - 'required': [ 'name', 'url' ], - 'properties': { - 'name': { - 'type': 'string', - 'example': 'field' - }, - 'url': { - 'type': 'string', - 'format': 'uri', - 'example': 'https://pokeapi.co/api/v2/pal-park-area/2/' - } - } - }, - 'base_score': { - 'type': 'number', - 'example': 50 - }, - 'rate': { - 'type': 'number', - 'example': 30 - } - } - } - }) + @extend_schema_field( + field={ + "type": "array", + "items": { + "type": "object", + "required": ["area", "base_score", "rate"], + "properties": { + "area": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "example": "field"}, + "url": { + "type": "string", + "format": "uri", + "example": "https://pokeapi.co/api/v2/pal-park-area/2/", + }, + }, + }, + "base_score": {"type": "number", "example": 50}, + "rate": {"type": "number", "example": 30}, + }, + }, + } + ) def get_encounters(self, obj): pal_park_objects = PalPark.objects.filter(pokemon_species=obj) parks = PalParkSerializer( @@ -5416,228 +5299,205 @@ class EvolutionChainDetailSerializer(serializers.ModelSerializer): fields = ("id", "baby_trigger_item", "chain") # TODO: Revisit Schema - @extend_schema_field(field={'type': 'object', - 'required': [ - 'evolution_details', - 'evolves_to', - 'is_baby', - 'species' - ], - 'properties': { - 'evolution_details': { - 'type': 'array', - 'items': { - }, - 'example': [] - }, - 'evolves_to': { - 'type': 'array', - 'items': { - 'type': 'object', - 'required': [ - 'evolution_details', - 'evolves_to', - 'is_baby', - 'species' - ], - 'properties': { - 'evolution_details': { - 'type': 'array', - 'items': { - 'type': 'object', - 'required': [ - 'gender', - 'held_item', - 'item', - 'known_move', - 'known_move_type', - 'location', - 'min_affection', - 'min_beauty', - 'min_happiness', - 'min_level', - 'needs_overworld_rain', - 'party_species', - 'party_type', - 'relative_physical_stats', - 'time_of_day', - 'trade_species', - 'trigger', - 'turn_upside_down' - ], - 'properties': { - 'gender': { - 'type': '', - 'nullable': True, - 'type': 'object', - 'required': [ 'name', 'url' ], - 'properties': { - 'name': { - 'type': 'string', - 'example': 1 - }, - 'url': { - 'type': 'string', - 'format': 'uri', - 'example': 2 - } - } - }, - 'held_item': { - 'type': 'object', - 'nullable': True, - 'required': [ 'name', 'url' ], - 'properties': { - 'name': { - 'type': 'string', - 'example': 1 - }, - 'url': { - 'type': 'string', - 'format': 'uri', - 'example': 2 - } - } - }, - 'item': { - 'type': 'object', - 'nullable': True, - 'required': [ 'name', 'url' ], - 'properties': { - 'name': { - 'type': 'string', - 'example': 1 - }, - 'url': { - 'type': 'string', - 'format': 'uri', - 'example': 2 - } - } - }, - 'known_move': { - 'type': '', - 'nullable': True, - }, - 'known_move_type': { - 'type': '', - 'nullable': True, - }, - 'location': { - 'type': 'object', - 'nullable': True, - 'required': [ 'name', 'url' ], - 'properties': { - 'name': { - 'type': 'string', - }, - 'url': { - 'type': 'string', - 'format': 'uri', - } - } - }, - 'min_affection': { - 'type': 'number', - 'nullable': True - }, - 'min_beauty': { - 'type': 'number', - 'nullable': True - }, - 'min_happiness': { - 'type': 'number', - 'nullable': True - }, - 'min_level': { - 'type': 'number', - 'nullable': True - }, - 'needs_overworld_rain': { - 'type': 'boolean', - 'nullable': True - }, - 'party_species': { - 'type': 'string', - 'nullable': True - }, - 'party_type': { - 'type': 'string', - 'nullable': True - }, - 'relative_physical_stats': { - 'type': 'string', - 'nullable': True - }, - 'time_of_day': { - 'type': 'string' - }, - 'trade_species': { - 'type': 'string', - 'nullable': True - }, - 'trigger': { - 'type': 'object', - 'required': [ 'name', 'url' ], - 'properties': { - 'name': { - 'type': 'string', - }, - 'url': { - 'type': 'string', - 'format': 'uri' - } - } - }, - 'turn_upside_down': { - 'type': 'boolean' - } - } - } - }, - 'is_baby': { - 'type': 'boolean', - 'example': True - }, - 'species': { - 'type': 'object', - 'required': [ 'name', 'url' ], - 'properties': { - 'name': { - 'type': 'string', - 'example': 'happiny' - }, - 'url': { - 'type': 'string', - 'format': 'uri', - 'example': 'https://pokeapi.co/api/v2/pokemon-species/440/' - } - } - } - } - } - }, - 'is_baby': { - 'type': 'boolean', - 'example': True - }, - 'species': { - 'type': 'object', - 'required': [ 'name', 'url' ], - 'properties': { - 'name': { - 'type': 'string', - 'example': 'happiny' - }, - 'url': { - 'type': 'string', - 'format': 'uri', - 'example': 'https://pokeapi.co/api/v2/pokemon-species/440/' - } - } - } - } - }) + @extend_schema_field( + field={ + "type": "object", + "required": ["evolution_details", "evolves_to", "is_baby", "species"], + "properties": { + "evolution_details": {"type": "array", "items": {}, "example": []}, + "evolves_to": { + "type": "array", + "items": { + "type": "object", + "required": [ + "evolution_details", + "evolves_to", + "is_baby", + "species", + ], + "properties": { + "evolution_details": { + "type": "array", + "items": { + "type": "object", + "required": [ + "gender", + "held_item", + "item", + "known_move", + "known_move_type", + "location", + "min_affection", + "min_beauty", + "min_happiness", + "min_level", + "needs_overworld_rain", + "party_species", + "party_type", + "relative_physical_stats", + "time_of_day", + "trade_species", + "trigger", + "turn_upside_down", + ], + "properties": { + "gender": { + "type": "", + "nullable": True, + "type": "object", + "required": ["name", "url"], + "properties": { + "name": { + "type": "string", + "example": 1, + }, + "url": { + "type": "string", + "format": "uri", + "example": 2, + }, + }, + }, + "held_item": { + "type": "object", + "nullable": True, + "required": ["name", "url"], + "properties": { + "name": { + "type": "string", + "example": 1, + }, + "url": { + "type": "string", + "format": "uri", + "example": 2, + }, + }, + }, + "item": { + "type": "object", + "nullable": True, + "required": ["name", "url"], + "properties": { + "name": { + "type": "string", + "example": 1, + }, + "url": { + "type": "string", + "format": "uri", + "example": 2, + }, + }, + }, + "known_move": { + "type": "", + "nullable": True, + }, + "known_move_type": { + "type": "", + "nullable": True, + }, + "location": { + "type": "object", + "nullable": True, + "required": ["name", "url"], + "properties": { + "name": { + "type": "string", + }, + "url": { + "type": "string", + "format": "uri", + }, + }, + }, + "min_affection": { + "type": "number", + "nullable": True, + }, + "min_beauty": { + "type": "number", + "nullable": True, + }, + "min_happiness": { + "type": "number", + "nullable": True, + }, + "min_level": { + "type": "number", + "nullable": True, + }, + "needs_overworld_rain": { + "type": "boolean", + "nullable": True, + }, + "party_species": { + "type": "string", + "nullable": True, + }, + "party_type": { + "type": "string", + "nullable": True, + }, + "relative_physical_stats": { + "type": "string", + "nullable": True, + }, + "time_of_day": {"type": "string"}, + "trade_species": { + "type": "string", + "nullable": True, + }, + "trigger": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": { + "type": "string", + }, + "url": { + "type": "string", + "format": "uri", + }, + }, + }, + "turn_upside_down": {"type": "boolean"}, + }, + }, + }, + "is_baby": {"type": "boolean", "example": True}, + "species": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "example": "happiny"}, + "url": { + "type": "string", + "format": "uri", + "example": "https://pokeapi.co/api/v2/pokemon-species/440/", + }, + }, + }, + }, + }, + }, + "is_baby": {"type": "boolean", "example": True}, + "species": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "example": "happiny"}, + "url": { + "type": "string", + "format": "uri", + "example": "https://pokeapi.co/api/v2/pokemon-species/440/", + }, + }, + }, + }, + } + ) def build_chain(self, obj): chain_id = obj.id @@ -5750,69 +5610,66 @@ class PokeathlonStatDetailSerializer(serializers.HyperlinkedModelSerializer): model = PokeathlonStat fields = ("id", "name", "affecting_natures", "names") - @extend_schema_field(field={'type': 'object', - 'required': [ 'decrease', 'increase' ], - 'properties': { - 'decrease': { - 'type': 'array', - 'items': { - 'type': 'object', - 'required': [ 'max_change', 'nature' ], - 'properties': { - 'max_change': { - 'type': 'number', - 'maximum': -1, - 'example': -1 - }, - 'nature': { - 'type': 'object', - 'required': [ 'name', 'url' ], - 'properties': { - 'name': { - 'type': 'string', - 'example': 'hardy' - }, - 'url': { - 'type': 'string', - 'format': 'uri', - 'example': 'https://pokeapi.co/api/v2/nature/1/' - } - } - } - } - } - }, - 'increase': { - 'type': 'array', - 'items': { - 'type': 'object', - 'required': [ 'max_change', 'nature' ], - 'properties': { - 'max_change': { - 'type': 'number', - 'minimum': 1, - 'example': 2 - }, - 'nature': { - 'type': 'object', - 'required': [ 'name', 'url' ], - 'properties': { - 'name': { - 'type': 'string', - 'example': 'hardy' - }, - 'url': { - 'type': 'string', - 'format': 'uri', - 'example': 'https://pokeapi.co/api/v2/nature/1/' - } - } - } - } - } - } - } - }) + @extend_schema_field( + field={ + "type": "object", + "required": ["decrease", "increase"], + "properties": { + "decrease": { + "type": "array", + "items": { + "type": "object", + "required": ["max_change", "nature"], + "properties": { + "max_change": { + "type": "number", + "maximum": -1, + "example": -1, + }, + "nature": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "example": "hardy"}, + "url": { + "type": "string", + "format": "uri", + "example": "https://pokeapi.co/api/v2/nature/1/", + }, + }, + }, + }, + }, + }, + "increase": { + "type": "array", + "items": { + "type": "object", + "required": ["max_change", "nature"], + "properties": { + "max_change": { + "type": "number", + "minimum": 1, + "example": 2, + }, + "nature": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "example": "hardy"}, + "url": { + "type": "string", + "format": "uri", + "example": "https://pokeapi.co/api/v2/nature/1/", + }, + }, + }, + }, + }, + }, + }, + } + ) def get_natures_that_affect(self, obj): stat_change_objects = NaturePokeathlonStat.objects.filter(pokeathlon_stat=obj) stat_changes = NaturePokeathlonStatSerializer( @@ -5871,33 +5728,30 @@ class PokedexDetailSerializer(serializers.ModelSerializer): "version_groups", ) - @extend_schema_field(field={'type': 'array', - 'items': { - 'type': 'object', - 'required': [ 'entry_number', 'pokemon_species' ], - 'properties': { - 'entry_number': { - 'type': 'number', - 'example': 1 - }, - 'pokemon_species': { - 'type': 'object', - 'required': [ 'name', 'url' ], - 'properties': { - 'name': { - 'type': 'string', - 'example': 'bulbasaur' - }, - 'url': { - 'type': 'string', - 'format': 'uri', - 'example': 'https://pokeapi.co/api/v2/pokemon-species/1/' - } - } - } - } - } - }) + @extend_schema_field( + field={ + "type": "array", + "items": { + "type": "object", + "required": ["entry_number", "pokemon_species"], + "properties": { + "entry_number": {"type": "number", "example": 1}, + "pokemon_species": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "example": "bulbasaur"}, + "url": { + "type": "string", + "format": "uri", + "example": "https://pokeapi.co/api/v2/pokemon-species/1/", + }, + }, + }, + }, + }, + } + ) def get_pokedex_entries(self, obj): results = PokemonDexNumber.objects.filter(pokedex=obj).order_by( "pokedex_number" @@ -5912,23 +5766,23 @@ class PokedexDetailSerializer(serializers.ModelSerializer): return data - @extend_schema_field(field={'type': 'array', - 'items': { - 'type': 'object', - 'required': [ 'name', 'url' ], - 'properties': { - 'name': { - 'type': 'string', - 'example': 'the-teal-mask' - }, - 'url': { - 'type': 'string', - 'format': 'uri', - 'example': 'https://pokeapi.co/api/v2/version-group/26/' - } - } - } - }) + @extend_schema_field( + field={ + "type": "array", + "items": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "example": "the-teal-mask"}, + "url": { + "type": "string", + "format": "uri", + "example": "https://pokeapi.co/api/v2/version-group/26/", + }, + }, + }, + } + ) def get_pokedex_version_groups(self, obj): dex_group_objects = PokedexVersionGroup.objects.filter(pokedex=obj) dex_groups = PokedexVersionGroupSerializer( @@ -5988,24 +5842,23 @@ class VersionGroupDetailSerializer(serializers.ModelSerializer): "versions", ) - @extend_schema_field(field={ - 'type': 'array', - 'items': { - 'type': 'object', - 'required': [ 'name', 'url' ], - 'properties': { - 'name': { - 'type': 'string', - 'example': 'kanto' - }, - 'url': { - 'type': 'string', - 'format': 'uri', - 'example': 'https://pokeapi.co/api/v2/region/1/' - } - } - } - }) + @extend_schema_field( + field={ + "type": "array", + "items": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "example": "kanto"}, + "url": { + "type": "string", + "format": "uri", + "example": "https://pokeapi.co/api/v2/region/1/", + }, + }, + }, + } + ) def get_version_group_regions(self, obj): vg_regions = VersionGroupRegion.objects.filter(version_group=obj) data = VersionGroupRegionSerializer( @@ -6018,26 +5871,25 @@ class VersionGroupDetailSerializer(serializers.ModelSerializer): return regions - # "name": "level-up", - # "url": "https://pokeapi.co/api/v2/move-learn-method/1/" - @extend_schema_field(field={ - 'type': 'array', - 'items': { - 'type': 'object', - 'required': [ 'name', 'url' ], - 'properties': { - 'name': { - 'type': 'string', - 'example': 'level-up' - }, - 'url': { - 'type': 'string', - 'format': 'uri', - 'example': 'https://pokeapi.co/api/v2/move-learn-method/1/' - } - } - } - }) + # "name": "level-up", + # "url": "https://pokeapi.co/api/v2/move-learn-method/1/" + @extend_schema_field( + field={ + "type": "array", + "items": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "example": "level-up"}, + "url": { + "type": "string", + "format": "uri", + "example": "https://pokeapi.co/api/v2/move-learn-method/1/", + }, + }, + }, + } + ) def get_learn_methods(self, obj): learn_method_objects = VersionGroupMoveLearnMethod.objects.filter( version_group=obj @@ -6052,24 +5904,23 @@ class VersionGroupDetailSerializer(serializers.ModelSerializer): return methods - @extend_schema_field(field={ - 'type': 'array', - 'items': { - 'type': 'object', - 'required': [ 'name', 'url' ], - 'properties': { - 'name': { - 'type': 'string', - 'example': 'kanto' - }, - 'url': { - 'type': 'string', - 'format': 'uri', - 'example': 'https://pokeapi.co/api/v2/pokedex/2/' - } - } - } - }) + @extend_schema_field( + field={ + "type": "array", + "items": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "example": "kanto"}, + "url": { + "type": "string", + "format": "uri", + "example": "https://pokeapi.co/api/v2/pokedex/2/", + }, + }, + }, + } + ) def get_version_groups_pokedexes(self, obj): dex_group_objects = PokedexVersionGroup.objects.filter(version_group=obj) dex_groups = PokedexVersionGroupSerializer( From 77a4570b1586017cd11b1278e842f6e9e877fdf1 Mon Sep 17 00:00:00 2001 From: indyandie <1058837+Indyandie@users.noreply.github.com> Date: Wed, 6 Mar 2024 22:27:43 -0600 Subject: [PATCH 42/76] fix: misplace `required` (PR review) --- pokemon_v2/serializers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pokemon_v2/serializers.py b/pokemon_v2/serializers.py index 463b60f4..6ac8754c 100644 --- a/pokemon_v2/serializers.py +++ b/pokemon_v2/serializers.py @@ -3228,8 +3228,8 @@ class MoveDetailSerializer(serializers.ModelSerializer): @extend_schema_field( field={ "type": "object", + "required": ["normal", "super"], "properties": { - "required": ["normal", "super"], "normal": { "type": "object", "required": ["use_before", "use_after"], From 89e55332c94c7705e0b16daeba03e29d38a473b1 Mon Sep 17 00:00:00 2001 From: indyandie <1058837+Indyandie@users.noreply.github.com> Date: Wed, 6 Mar 2024 23:17:01 -0600 Subject: [PATCH 43/76] feat: id parameter (not working) --- openapi.yml | 6 +++--- pokemon_v2/api.py | 13 ++++++++++++- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/openapi.yml b/openapi.yml index 19550827..51fb83e6 100644 --- a/openapi.yml +++ b/openapi.yml @@ -5164,10 +5164,10 @@ components: minimum: -2147483648 contest_combos: type: object + required: + - normal + - super properties: - required: - - normal - - super normal: type: object required: diff --git a/pokemon_v2/api.py b/pokemon_v2/api.py index 77512e0e..ba2a0ef5 100644 --- a/pokemon_v2/api.py +++ b/pokemon_v2/api.py @@ -4,7 +4,8 @@ from rest_framework.response import Response from rest_framework.views import APIView from django.shortcuts import get_object_or_404 from django.http import Http404 -from drf_spectacular.utils import extend_schema, extend_schema_view +from drf_spectacular.utils import extend_schema, extend_schema_view, OpenApiParameter +from drf_spectacular.types import OpenApiTypes from .models import * from .serializers import * @@ -39,6 +40,16 @@ class NameOrIdRetrieval: idPattern = re.compile(r"^-?[0-9]+$") namePattern = re.compile(r"^[0-9A-Za-z\-\+]+$") + @extend_schema( + parameters=[ + OpenApiParameter( + name="id", + description="This parameter can be a string or an integer.", + location=OpenApiParameter.PATH, + type=OpenApiTypes.STR, + ), + ] + ) def get_object(self): queryset = self.get_queryset() queryset = self.filter_queryset(queryset) From a5aff843c9cad97620062122d1f673357a00c919 Mon Sep 17 00:00:00 2001 From: indyandie <1058837+Indyandie@users.noreply.github.com> Date: Thu, 7 Mar 2024 01:27:05 -0600 Subject: [PATCH 44/76] docs: overview --- config/settings.py | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/config/settings.py b/config/settings.py index 98d3bbdf..5459cc7d 100755 --- a/config/settings.py +++ b/config/settings.py @@ -140,8 +140,23 @@ TEMPLATES = [ DEFAULT_AUTO_FIELD = "django.db.models.AutoField" SPECTACULAR_SETTINGS = { - "TITLE": "pokeapi", - "DESCRIPTION": "A RESTful API for Pokémon.", + "TITLE": "PokéAPI", + "DESCRIPTION": """All the Pokémon data you'll ever need in one place, easily accessible through a modern free open-source RESTful API. + +## What is this? + +This is a full RESTful API linked to an extensive database detailing everything about the Pokémon main game series. + +We've covered everything from Pokémon to Berry Flavors. + +## Where do I start? + +We have awesome [documentation](https://pokeapi.co/docs/v2) on how to use this API. It takes minutes to get started. + +This API will always be publicly available and will never require any extensive setup process to consume. + +Created by [**Paul Hallett**(]https://github.com/phalt) and other [**PokéAPI contributors***](https://github.com/PokeAPI/pokeapi#contributing) around the world. Pokémon and Pokémon character names are trademarks of Nintendo. + """, "SERVERS": [{"url": "https://pokeapi.co"}], "EXTERNAL_DOCS": {"url": "https://pokeapi.co/docs/v2"}, "VERSION": "2.7.0", From 777abcc6560f94085cdb587e2f01eaf500157f41 Mon Sep 17 00:00:00 2001 From: indyandie <1058837+Indyandie@users.noreply.github.com> Date: Thu, 7 Mar 2024 01:28:42 -0600 Subject: [PATCH 45/76] docs: overview --- openapi.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/openapi.yml b/openapi.yml index 51fb83e6..a0fef926 100644 --- a/openapi.yml +++ b/openapi.yml @@ -1,8 +1,18 @@ openapi: 3.1.0 info: - title: pokeapi + title: PokéAPI version: 2.7.0 - description: A RESTful API for Pokémon. + description: "All the Pokémon data you'll ever need in one place, easily accessible\ + \ through a modern free open-source RESTful API.\n\n## What is this?\n\nThis is\ + \ a full RESTful API linked to an extensive database detailing everything about\ + \ the Pokémon main game series.\n\nWe've covered everything from Pokémon to Berry\ + \ Flavors.\n\n## Where do I start?\n\nWe have awesome [documentation](https://pokeapi.co/docs/v2)\ + \ on how to use this API. It takes minutes to get started.\n\nThis API will always\ + \ be publicly available and will never require any extensive setup process to\ + \ consume.\n\nCreated by [**Paul Hallett**(]https://github.com/phalt) and other\ + \ [**PokéAPI contributors***](https://github.com/PokeAPI/pokeapi#contributing)\ + \ around the world. Pokémon and Pokémon character names are trademarks of Nintendo.\n\ + \ " paths: /api/v2/ability/: get: From 5e02a377cddc1539d50e43ed1427b00b7ac3e889 Mon Sep 17 00:00:00 2001 From: indyandie <1058837+Indyandie@users.noreply.github.com> Date: Tue, 26 Mar 2024 23:59:57 -0500 Subject: [PATCH 46/76] fix: use correct type, add format --- openapi.yml | 93 ++++++++++++++++++++++++++------------- pokemon_v2/serializers.py | 62 +++++++++++++------------- 2 files changed, 93 insertions(+), 62 deletions(-) diff --git a/openapi.yml b/openapi.yml index a0fef926..51601192 100644 --- a/openapi.yml +++ b/openapi.yml @@ -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 diff --git a/pokemon_v2/serializers.py b/pokemon_v2/serializers.py index 6ac8754c..47e19509 100644 --- a/pokemon_v2/serializers.py +++ b/pokemon_v2/serializers.py @@ -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"], From a5158e216440258485a88d3cd83e49d30c28f9c3 Mon Sep 17 00:00:00 2001 From: indyandie <1058837+Indyandie@users.noreply.github.com> Date: Wed, 27 Mar 2024 23:12:13 -0500 Subject: [PATCH 47/76] fix: use `examples` property (`example` is deprecated), fix typo --- openapi.yml | 697 +++++++++++++++++++++++++------------- pokemon_v2/api.py | 2 +- pokemon_v2/serializers.py | 468 ++++++++++++------------- 3 files changed, 692 insertions(+), 475 deletions(-) diff --git a/openapi.yml b/openapi.yml index 51601192..f262ee3b 100644 --- a/openapi.yml +++ b/openapi.yml @@ -295,7 +295,7 @@ paths: IV. A Pokémon's Characteristic is determined by the remainder of its highest IV divided by 5 (gene_modulo). Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Characteristic) for greater detail. - summary: Get charecterictic + summary: Get characteristic parameters: - in: path name: id @@ -3047,11 +3047,11 @@ components: properties: is_hidden: type: boolean - example: true slot: type: integer format: int32 - example: 3 + examples: + - 3 pokemon: type: object required: @@ -3060,11 +3060,13 @@ components: properties: name: type: string - example: gloom + examples: + - gloom url: type: string format: uri - example: https://pokeapi.co/api/v2/pokemon/44/ + examples: + - https://pokeapi.co/api/v2/pokemon/44/ readOnly: true required: - effect_changes @@ -3172,7 +3174,8 @@ components: properties: potency: type: integer - example: 10 + examples: + - 10 flavor: type: object require: @@ -3182,12 +3185,14 @@ components: name: type: string description: The name of the flavor - example: spicy + examples: + - spicy url: type: string format: uri description: The URL to get more information about the flavor - example: https://pokeapi.co/api/v2/berry-flavor/1/ + examples: + - https://pokeapi.co/api/v2/berry-flavor/1/ readOnly: true item: $ref: '#/components/schemas/ItemSummary' @@ -3273,7 +3278,8 @@ components: properties: potency: type: integer - example: 10 + examples: + - 10 berry: type: object require: @@ -3283,12 +3289,14 @@ components: name: type: string description: The name of the berry - example: rowap + examples: + - rowap url: type: string format: uri description: The URL to get more information about the berry - example: https://pokeapi.co/api/v2/berry/64/ + examples: + - https://pokeapi.co/api/v2/berry/64/ readOnly: true contest_type: $ref: '#/components/schemas/ContestTypeSummary' @@ -3363,14 +3371,14 @@ components: items: type: integer format: int32 - example: - - 0 - - 5 - - 10 - - 15 - - 20 - - 25 - - 30 + examples: + - - 0 + - 5 + - 10 + - 15 + - 20 + - 25 + - 30 readOnly: true highest_stat: $ref: '#/components/schemas/StatSummary' @@ -3531,12 +3539,14 @@ components: name: type: string description: Pokemon species name. - example: bulbasaur + examples: + - bulbasaur url: type: string format: uri description: The URL to get more information about the species - example: https://pokeapi.co/api/v2/pokemon-species/1/ + examples: + - https://pokeapi.co/api/v2/pokemon-species/1/ readOnly: true required: - id @@ -3727,7 +3737,7 @@ components: evolution_details: type: array items: {} - example: [] + examples: [] evolves_to: type: array items: @@ -3771,11 +3781,13 @@ components: properties: name: type: string - example: 1 + examples: + - 1 url: type: string format: uri - example: 2 + examples: + - 2 held_item: type: object nullable: true @@ -3785,11 +3797,13 @@ components: properties: name: type: string - example: 1 + examples: + - 1 url: type: string format: uri - example: 2 + examples: + - 2 item: type: object nullable: true @@ -3799,11 +3813,13 @@ components: properties: name: type: string - example: 1 + examples: + - 1 url: type: string format: uri - example: 2 + examples: + - 2 known_move: type: '' nullable: true @@ -3870,7 +3886,6 @@ components: type: boolean is_baby: type: boolean - example: true species: type: object required: @@ -3879,14 +3894,15 @@ components: properties: name: type: string - example: happiny + examples: + - happiny url: type: string format: uri - example: https://pokeapi.co/api/v2/pokemon-species/440/ + examples: + - https://pokeapi.co/api/v2/pokemon-species/440/ is_baby: type: boolean - example: true species: type: object required: @@ -3895,11 +3911,13 @@ components: properties: name: type: string - example: happiny + examples: + - happiny url: type: string format: uri - example: https://pokeapi.co/api/v2/pokemon-species/440/ + examples: + - https://pokeapi.co/api/v2/pokemon-species/440/ readOnly: true required: - baby_trigger_item @@ -3938,11 +3956,13 @@ components: properties: name: type: string - example: ivysaur + examples: + - ivysaur url: type: string format: uri - example: https://pokeapi.co/api/v2/pokemon-species/2/ + examples: + - https://pokeapi.co/api/v2/pokemon-species/2/ readOnly: true required: - id @@ -4007,7 +4027,8 @@ components: rate: type: integer format: int32 - example: 1 + examples: + - 1 pokemon_species: type: object required: @@ -4016,11 +4037,13 @@ components: properties: name: type: string - example: bulbasaur + examples: + - bulbasaur url: type: string format: uri - example: https://pokeapi.co/api/v2/pokemon-species/1/ + examples: + - https://pokeapi.co/api/v2/pokemon-species/1/ readOnly: true required_for_evolution: type: array @@ -4032,11 +4055,13 @@ components: properties: name: type: string - example: wormadam + examples: + - wormadam url: type: string format: uri - example: https://pokeapi.co/api/v2/pokemon-species/413/ + examples: + - https://pokeapi.co/api/v2/pokemon-species/413/ readOnly: true required: - id @@ -4222,11 +4247,13 @@ components: properties: name: type: string - example: master-ball + examples: + - master-ball url: type: string format: uri - example: https://pokeapi.co/api/v2/item/1/ + examples: + - https://pokeapi.co/api/v2/item/1/ readOnly: true names: type: array @@ -4347,11 +4374,13 @@ components: properties: name: type: string - example: countable + examples: + - countable url: type: string format: uri - example: https://pokeapi.co/api/v2/item-attribute/1/ + examples: + - https://pokeapi.co/api/v2/item-attribute/1/ readOnly: true category: $ref: '#/components/schemas/ItemCategorySummary' @@ -4391,11 +4420,13 @@ components: properties: name: type: string - example: farfetchd + examples: + - farfetchd url: type: string format: uri - example: https://pokeapi.co/api/v2/pokemon/83/ + examples: + - https://pokeapi.co/api/v2/pokemon/83/ version-details: type: array items: @@ -4407,7 +4438,8 @@ components: rarity: type: integer format: int32 - example: 5 + examples: + - 5 version: type: object required: @@ -4416,11 +4448,13 @@ components: properties: name: type: string - example: ruby + examples: + - ruby url: type: string format: uri - example: https://pokeapi.co/api/v2/version/7/ + examples: + - https://pokeapi.co/api/v2/version/7/ readOnly: true sprites: type: object @@ -4430,7 +4464,8 @@ components: default: type: string format: uri - example: https://pokeapi.co/media/sprites/items/master-ball.png + examples: + - https://pokeapi.co/media/sprites/items/master-ball.png readOnly: true baby_trigger_for: type: object @@ -4440,7 +4475,8 @@ components: url: type: string format: uri - example: '"https://pokeapi.co/api/v2/evolution-chain/51/' + examples: + - https://pokeapi.co/api/v2/evolution-chain/51/ readOnly: true machines: type: array @@ -4453,7 +4489,8 @@ components: machine: type: string format: uri - example: https://pokeapi.co/api/v2/machine/1/ + examples: + - https://pokeapi.co/api/v2/machine/1/ version_group: type: object required: @@ -4462,11 +4499,13 @@ components: properties: name: type: string - example: sword-shield + examples: + - sword-shield url: type: string format: uri - example: https://pokeapi.co/api/v2/version-group/20/ + examples: + - https://pokeapi.co/api/v2/version-group/20/ readOnly: true required: - attributes @@ -4723,11 +4762,13 @@ components: properties: name: type: string - example: old-rod + examples: + - old-rod url: type: string format: uri - example: https://pokeapi.co/api/v2/encounter-method/2/ + examples: + - https://pokeapi.co/api/v2/encounter-method/2/ version_details: type: array items: @@ -4739,7 +4780,8 @@ components: rate: type: integer format: int32 - example: 5 + examples: + - 5 version: type: object required: @@ -4748,11 +4790,13 @@ components: properties: name: type: string - example: platinum + examples: + - platinum url: type: string format: uri - example: https://pokeapi.co/api/v2/version/14/ + examples: + - https://pokeapi.co/api/v2/version/14/ readOnly: true location: $ref: '#/components/schemas/LocationSummary' @@ -4777,11 +4821,13 @@ components: properties: name: type: string - example: tentacool + examples: + - tentacool url: type: string format: uri - example: ttps://pokeapi.co/api/v2/pokemon/72/ + examples: + - https://pokeapi.co/api/v2/pokemon/72/ version_details: type: array items: @@ -4799,15 +4845,18 @@ components: properties: name: type: string - example: diamond + examples: + - diamond url: type: string format: uri - example: https://pokeapi.co/api/v2/version/12/ + examples: + - https://pokeapi.co/api/v2/version/12/ max_chance: type: integer format: int32 - example: 60 + examples: + - 60 encounter_details: type: object required: @@ -4820,11 +4869,13 @@ components: min_level: type: integer format: int32 - example: 20 + examples: + - 20 max_level: type: integer format: int32 - example: 30 + examples: + - 30 condition_values: type: object required: @@ -4833,15 +4884,18 @@ components: properties: name: type: string - example: slot2-sapphire + examples: + - slot2-sapphire url: type: string format: uri - example: https://pokeapi.co/api/v2/encounter-condition-value/10/ + examples: + - https://pokeapi.co/api/v2/encounter-condition-value/10/ chance: type: integer format: int32 - example: 60 + examples: + - 60 method: type: object required: @@ -4850,11 +4904,13 @@ components: properties: name: type: string - example: surf + examples: + - surf url: type: string format: uri - example: https://pokeapi.co/api/v2/encounter-method/5/ + examples: + - https://pokeapi.co/api/v2/encounter-method/5/ readOnly: true required: - encounter_method_rates @@ -5059,10 +5115,12 @@ components: properties: effect: type: string - example: Inflicts [regular damage]{mechanic:regular-damage}. + examples: + - Inflicts [regular damage]{mechanic:regular-damage}. short_effect: type: string - example: Inflicts regular damage with no additional effect. + examples: + - Inflicts regular damage with no additional effect. language: type: object required: @@ -5071,11 +5129,13 @@ components: properties: name: type: string - example: en + examples: + - en url: type: string format: uri - example: https://pokeapi.co/api/v2/language/9/ + examples: + - https://pokeapi.co/api/v2/language/9/ readOnly: true type: $ref: '#/components/schemas/TypeSummary' @@ -5208,11 +5268,13 @@ components: properties: name: type: string - example: fire-punch + examples: + - fire-punch url: type: string format: uri - example: https://pokeapi.co/api/v2/move/7/ + examples: + - https://pokeapi.co/api/v2/move/7/ use_after: type: array nullable: true @@ -5224,11 +5286,13 @@ components: properties: name: type: string - example: ice-punch + examples: + - ice-punch url: type: string format: uri - example: https://pokeapi.co/api/v2/move/8/ + examples: + - https://pokeapi.co/api/v2/move/8/ super: type: object required: @@ -5246,11 +5310,13 @@ components: properties: name: type: string - example: night-slash + examples: + - night-slash url: type: string format: uri - example: https://pokeapi.co/api/v2/move/400/ + examples: + - https://pokeapi.co/api/v2/move/400/ use_after: type: array nullable: true @@ -5262,11 +5328,13 @@ components: properties: name: type: string - example: focus-energy + examples: + - focus-energy url: type: string format: uri - example: https://pokeapi.co/api/v2/move/116/ + examples: + - https://pokeapi.co/api/v2/move/116/ readOnly: true contest_type: $ref: '#/components/schemas/ContestTypeSummary' @@ -5285,10 +5353,12 @@ components: properties: effect: type: string - example: Inflicts [regular damage]{mechanic:regular-damage}. + examples: + - Inflicts [regular damage]{mechanic:regular-damage}. short_effect: type: string - example: Inflicts regular damage with no additional effect. + examples: + - Inflicts regular damage with no additional effect. language: type: object required: @@ -5297,11 +5367,13 @@ components: properties: name: type: string - example: en + examples: + - en url: type: string format: uri - example: https://pokeapi.co/api/v2/language/9/ + examples: + - https://pokeapi.co/api/v2/language/9/ readOnly: true effect_changes: type: array @@ -5321,7 +5393,8 @@ components: properties: effect: type: string - example: Hits Pokémon under the effects of dig and fly. + examples: + - Hits Pokémon under the effects of dig and fly. language: type: object required: @@ -5330,11 +5403,13 @@ components: properties: name: type: string - example: en + examples: + - en url: type: string format: uri - example: https://pokeapi.co/api/v2/language/9/ + examples: + - https://pokeapi.co/api/v2/language/9/ version_group: type: object required: @@ -5343,11 +5418,13 @@ components: properties: name: type: string - example: gold-silver + examples: + - gold-silver url: type: string format: uri - example: https://pokeapi.co/api/v2/version-group/3/ + examples: + - https://pokeapi.co/api/v2/version-group/3/ readOnly: true generation: $ref: '#/components/schemas/GenerationSummary' @@ -5376,7 +5453,8 @@ components: change: type: integer format: int32 - example: 2 + examples: + - 2 stat: type: object required: @@ -5385,11 +5463,13 @@ components: properties: name: type: string - example: attack + examples: + - attack url: type: string format: uri - example: https://pokeapi.co/api/v2/stat/1/ + examples: + - https://pokeapi.co/api/v2/stat/1/ readOnly: true super_contest_effect: $ref: '#/components/schemas/SuperContestEffectSummary' @@ -5413,7 +5493,8 @@ components: url: type: string format: uri - example: https://pokeapi.co/api/v2/machine/1/ + examples: + - https://pokeapi.co/api/v2/machine/1/ version_group: type: object required: @@ -5422,11 +5503,13 @@ components: properties: name: type: string - example: sword-shield + examples: + - sword-shield url: type: string format: uri - example: https://pokeapi.co/api/v2/version-group/1/ + examples: + - https://pokeapi.co/api/v2/version-group/1/ readOnly: true flavor_text_entries: type: array @@ -5443,11 +5526,13 @@ components: properties: name: type: string - example: clefairy + examples: + - clefairy url: type: string format: uri - example: https://pokeapi.co/api/v2/pokemon/35/ + examples: + - https://pokeapi.co/api/v2/pokemon/35/ readOnly: true required: - contest_combos @@ -5522,11 +5607,13 @@ components: properties: name: type: string - example: red-blue + examples: + - red-blue url: type: string format: uri - example: https://pokeapi.co/api/v2/version-group/1/ + examples: + - https://pokeapi.co/api/v2/version-group/1/ readOnly: true required: - descriptions @@ -5647,11 +5734,13 @@ components: properties: name: type: string - example: thunder-punch + examples: + - thunder-punch url: type: string format: uri - example: https://pokeapi.co/api/v2/move/9/ + examples: + - https://pokeapi.co/api/v2/move/9/ readOnly: true names: type: array @@ -5721,11 +5810,13 @@ components: properties: name: type: string - example: sing + examples: + - sing url: type: string format: uri - example: https://pokeapi.co/api/v2/move/47/ + examples: + - https://pokeapi.co/api/v2/move/47/ readOnly: true required: - descriptions @@ -5883,7 +5974,8 @@ components: max_change: type: integer format: int32 - example: 1 + examples: + - 1 pokeathlon_stat: type: object required: @@ -5892,11 +5984,13 @@ components: properties: name: type: string - example: power + examples: + - power url: type: string format: uri - example: https://pokeapi.co/api/v2/pokeathlon-stat/2/ + examples: + - https://pokeapi.co/api/v2/pokeathlon-stat/2/ readOnly: true move_battle_style_preferences: type: array @@ -6929,7 +7023,8 @@ components: base_score: type: integer format: int32 - example: 50 + examples: + - 50 pokemon-species: type: object required: @@ -6938,15 +7033,18 @@ components: properties: name: type: string - example: bulbasaur + examples: + - bulbasaur url: type: string format: uri - example: https://pokeapi.co/api/v2/pokemon-species/1/ + examples: + - https://pokeapi.co/api/v2/pokemon-species/1/ rate: type: integer format: int32 - example: 30 + examples: + - 30 readOnly: true required: - id @@ -7004,7 +7102,8 @@ components: type: integer format: int32 maximum: -1 - example: -1 + examples: + - -1 nature: type: object required: @@ -7013,11 +7112,13 @@ components: properties: name: type: string - example: hardy + examples: + - hardy url: type: string format: uri - example: https://pokeapi.co/api/v2/nature/1/ + examples: + - https://pokeapi.co/api/v2/nature/1/ increase: type: array items: @@ -7030,7 +7131,8 @@ components: type: integer format: int32 minimum: 1 - example: 2 + examples: + - 2 nature: type: object required: @@ -7039,11 +7141,13 @@ components: properties: name: type: string - example: hardy + examples: + - hardy url: type: string format: uri - example: https://pokeapi.co/api/v2/nature/1/ + examples: + - https://pokeapi.co/api/v2/nature/1/ readOnly: true names: type: array @@ -7121,7 +7225,8 @@ components: entry_number: type: integer format: int32 - example: 1 + examples: + - 1 pokemon_species: type: object required: @@ -7130,11 +7235,13 @@ components: properties: name: type: string - example: bulbasaur + examples: + - bulbasaur url: type: string format: uri - example: https://pokeapi.co/api/v2/pokemon-species/1/ + examples: + - https://pokeapi.co/api/v2/pokemon-species/1/ readOnly: true region: $ref: '#/components/schemas/RegionSummary' @@ -7148,11 +7255,13 @@ components: properties: name: type: string - example: the-teal-mask + examples: + - the-teal-mask url: type: string format: uri - example: https://pokeapi.co/api/v2/version-group/26/ + examples: + - https://pokeapi.co/api/v2/version-group/26/ readOnly: true required: - descriptions @@ -7286,18 +7395,20 @@ components: properties: name: type: string - example: sand-veil + examples: + - sand-veil url: type: string format: uri - example: https://pokeapi.co/api/v2/ability/8/ + examples: + - https://pokeapi.co/api/v2/ability/8/ is_hidden: type: boolean - example: false slot: type: integer format: int32 - example: 1 + examples: + - 1 readOnly: true past_abilities: type: array @@ -7324,18 +7435,20 @@ components: properties: name: type: string - example: levitate + examples: + - levitate url: type: string format: uri - example: https://pokeapi.co/api/v2/ability/26/ + examples: + - https://pokeapi.co/api/v2/ability/26/ is_hidden: type: boolean - example: false slot: type: integer format: int32 - example: 1 + examples: + - 1 generation: type: object required: @@ -7344,11 +7457,13 @@ components: properties: name: type: string - example: generation-vi + examples: + - generation-vi url: type: string format: uri - example: https://pokeapi.co/api/v2/generation/6/ + examples: + - https://pokeapi.co/api/v2/generation/6/ readOnly: true forms: type: array @@ -7374,11 +7489,13 @@ components: properties: name: type: string - example: soft-sand + examples: + - soft-sand url: type: string format: uri - example: https://pokeapi.co/api/v2/item/214/ + examples: + - https://pokeapi.co/api/v2/item/214/ version_details: type: array items: @@ -7390,7 +7507,8 @@ components: rarity: type: integer format: int32 - example: 5 + examples: + - 5 version: type: object required: @@ -7399,15 +7517,18 @@ components: properties: name: type: string - example: diamond + examples: + - diamond url: type: string format: uri - example: https://pokeapi.co/api/v2/version/12/ + examples: + - https://pokeapi.co/api/v2/version/12/ readOnly: true location_area_encounters: type: string - example: https://pokeapi.co/api/v2/pokemon/1/encounters + examples: + - https://pokeapi.co/api/v2/pokemon/1/encounters readOnly: true moves: type: array @@ -7425,11 +7546,13 @@ components: properties: name: type: string - example: scratch + examples: + - scratch url: type: string format: uri - example: https://pokeapi.co/api/v2/move/10/ + examples: + - https://pokeapi.co/api/v2/move/10/ version_group_details: type: array items: @@ -7442,7 +7565,8 @@ components: level_learned_at: type: integer format: int32 - example: 1 + examples: + - 1 move_learn_method: type: object required: @@ -7451,11 +7575,13 @@ components: properties: name: type: string - example: level-up + examples: + - level-up url: type: string format: uri - example: https://pokeapi.co/api/v2/move-learn-method/1/ + examples: + - https://pokeapi.co/api/v2/move-learn-method/1/ version_group: type: object required: @@ -7464,11 +7590,13 @@ components: properties: name: type: string - example: red-blue + examples: + - red-blue url: type: string format: uri - example: https://pokeapi.co/api/v2/version-group/1/ + examples: + - https://pokeapi.co/api/v2/version-group/1/ readOnly: true species: $ref: '#/components/schemas/PokemonSpeciesSummary' @@ -7483,9 +7611,10 @@ components: type: string format: uri nullable: true - example: https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/shiny/1.png - example: - back_default: https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/1.png + examples: + - https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/shiny/1.png + examples: + - back_default: https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/1.png back_female: null back_shiny: https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/shiny/1.png back_shiny_female: null @@ -7503,11 +7632,13 @@ components: latest: type: string format: uri - example: https://raw.githubusercontent.com/PokeAPI/cries/main/cries/pokemon/latest/50.ogg + examples: + - https://raw.githubusercontent.com/PokeAPI/cries/main/cries/pokemon/latest/50.ogg legacy: type: string format: uri - example: https://raw.githubusercontent.com/PokeAPI/cries/main/cries/pokemon/legacy/50.ogg + examples: + - https://raw.githubusercontent.com/PokeAPI/cries/main/cries/pokemon/legacy/50.ogg readOnly: true stats: type: array @@ -7525,7 +7656,8 @@ components: slot: type: integer format: int32 - example: 1 + examples: + - 1 type: type: object required: @@ -7534,11 +7666,13 @@ components: properties: name: type: string - example: ghost + examples: + - ghost url: type: string format: uri - example: https://pokeapi.co/api/v2/type/8/ + examples: + - https://pokeapi.co/api/v2/type/8/ readOnly: true past_types: type: array @@ -7556,11 +7690,13 @@ components: properties: name: type: string - example: generation-v + examples: + - generation-v url: type: string format: uri - example: https://pokeapi.co/api/v2/generation/5/ + examples: + - https://pokeapi.co/api/v2/generation/5/ types: type: array items: @@ -7572,7 +7708,8 @@ components: slot: type: integer format: int32 - example: 1 + examples: + - 1 type: type: object required: @@ -7581,11 +7718,13 @@ components: properties: name: type: string - example: normal + examples: + - normal url: type: string format: uri - example: https://pokeapi.co/api/v2/type/1/ + examples: + - https://pokeapi.co/api/v2/type/1/ readOnly: true required: - abilities @@ -7651,14 +7790,16 @@ components: default: type: string format: uri - example: https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/412.png + examples: + - https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/412.png additionalProperties: type: string format: uri nullable: true - example: https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/shiny/412.png - example: - back_default: https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/412.png + examples: + - https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/shiny/412.png + examples: + - back_default: https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/412.png back_female: null back_shiny: https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/shiny/412.png back_shiny_female: null @@ -7685,14 +7826,17 @@ components: properties: name: type: string - example: en + examples: + - en url: type: string format: uri - example: https://pokeapi.co/api/v2/language/9/ + examples: + - https://pokeapi.co/api/v2/language/9/ name: type: string - example: Plant Cloak + examples: + - Plant Cloak readOnly: true names: type: array @@ -7710,14 +7854,17 @@ components: properties: name: type: string - example: en + examples: + - en url: type: string format: uri - example: https://pokeapi.co/api/v2/language/9/ + examples: + - https://pokeapi.co/api/v2/language/9/ name: type: string - example: Plant Cloak + examples: + - Plant Cloak readOnly: true types: type: array @@ -7730,7 +7877,8 @@ components: slot: type: integer format: int32 - example: 1 + examples: + - 1 type: type: object required: @@ -7739,11 +7887,13 @@ components: properties: name: type: string - example: bug + examples: + - bug url: type: string format: uri - example: https://pokeapi.co/api/v2/type/7/ + examples: + - https://pokeapi.co/api/v2/type/7/ readOnly: true required: - form_name @@ -7847,7 +7997,8 @@ components: properties: awesome_name: type: string - example: Pomaceous + examples: + - Pomaceous language: type: object required: @@ -7856,11 +8007,13 @@ components: properties: name: type: string - example: en + examples: + - en url: type: string format: uri - example: https://pokeapi.co/api/v2/language/9/ + examples: + - https://pokeapi.co/api/v2/language/9/ readOnly: true names: type: array @@ -7873,10 +8026,12 @@ components: url: type: string format: uri - example: https://pokeapi.co/api/v2/language/9/ + examples: + - https://pokeapi.co/api/v2/language/9/ name: type: string - example: Ball + examples: + - Ball readOnly: true pokemon_species: type: array @@ -7978,11 +8133,13 @@ components: properties: name: type: string - example: monster + examples: + - monster url: type: string format: uri - example: https://pokeapi.co/api/v2/egg-group/1/ + examples: + - https://pokeapi.co/api/v2/egg-group/1/ readOnly: true color: $ref: '#/components/schemas/PokemonColorSummary' @@ -8012,14 +8169,17 @@ components: properties: name: type: string - example: en + examples: + - en url: type: string format: uri - example: https://pokeapi.co/api/v2/language/9/ + examples: + - https://pokeapi.co/api/v2/language/9/ name: type: string - example: bulbasaur + examples: + - bulbasaur readOnly: true pal_park_encounters: type: array @@ -8038,19 +8198,23 @@ components: properties: name: type: string - example: field + examples: + - field url: type: string format: uri - example: https://pokeapi.co/api/v2/pal-park-area/2/ + examples: + - https://pokeapi.co/api/v2/pal-park-area/2/ base_score: type: integer format: int32 - example: 50 + examples: + - 50 rate: type: integer format: int32 - example: 30 + examples: + - 30 readOnly: true form_descriptions: type: array @@ -8072,7 +8236,8 @@ components: properties: genus: type: string - example: Seed Pokémon + examples: + - Seed Pokémon language: type: object required: @@ -8081,11 +8246,13 @@ components: properties: name: type: string - example: en + examples: + - en url: type: string format: uri - example: https://pokeapi.co/api/v2/language/9/ + examples: + - https://pokeapi.co/api/v2/language/9/ readOnly: true varieties: type: array @@ -8097,7 +8264,6 @@ components: properties: is_default: type: boolean - example: true pokemon: type: object required: @@ -8106,11 +8272,13 @@ components: properties: name: type: string - example: bulbasaur + examples: + - bulbasaur url: type: string format: uri - example: https://pokeapi.co/api/v2/pokemon/1/ + examples: + - https://pokeapi.co/api/v2/pokemon/1/ readOnly: true required: - color @@ -8224,11 +8392,13 @@ components: properties: name: type: string - example: red-blue + examples: + - red-blue url: type: string format: uri - example: https://pokeapi.co/api/v2/version-group/1/ + examples: + - https://pokeapi.co/api/v2/version-group/1/ readOnly: true required: - id @@ -8294,7 +8464,8 @@ components: change: type: integer format: int32 - example: -1 + examples: + - -1 move: type: object required: @@ -8303,11 +8474,13 @@ components: properties: name: type: string - example: swords-dance + examples: + - swords-dance url: type: string format: uri - example: https://pokeapi.co/api/v2/move/14/ + examples: + - https://pokeapi.co/api/v2/move/14/ decrease: type: array items: @@ -8319,7 +8492,8 @@ components: change: type: integer format: int32 - example: 5 + examples: + - 5 move: type: object required: @@ -8328,11 +8502,13 @@ components: properties: name: type: string - example: growl + examples: + - growl url: type: string format: uri - example: https://pokeapi.co/api/v2/move/45/ + examples: + - https://pokeapi.co/api/v2/move/45/ readOnly: true affecting_natures: type: object @@ -8350,11 +8526,13 @@ components: properties: name: type: string - example: lonely + examples: + - lonely url: type: string format: uri - example: https://pokeapi.co/api/v2/nature/6/ + examples: + - https://pokeapi.co/api/v2/nature/6/ decrease: type: array items: @@ -8365,11 +8543,13 @@ components: properties: name: type: string - example: bold + examples: + - bold url: type: string format: uri - example: https://pokeapi.co/api/v2/nature/2/ + examples: + - https://pokeapi.co/api/v2/nature/2/ readOnly: true characteristics: type: array @@ -8491,11 +8671,13 @@ components: properties: name: type: string - example: flying + examples: + - flying url: type: string format: uri - example: https://pokeapi.co/api/v2/type/3/ + examples: + - https://pokeapi.co/api/v2/type/3/ half_damage_to: type: array items: @@ -8506,11 +8688,13 @@ components: properties: name: type: string - example: bug + examples: + - bug url: type: string format: uri - example: https://pokeapi.co/api/v2/type/7/ + examples: + - https://pokeapi.co/api/v2/type/7/ double_damage_to: type: array items: @@ -8521,11 +8705,13 @@ components: properties: name: type: string - example: poison + examples: + - poison url: type: string format: uri - example: https://pokeapi.co/api/v2/type/4/ + examples: + - https://pokeapi.co/api/v2/type/4/ no_damage_from: type: array items: @@ -8536,11 +8722,13 @@ components: properties: name: type: string - example: electric + examples: + - electric url: type: string format: uri - example: https://pokeapi.co/api/v2/type/13/ + examples: + - https://pokeapi.co/api/v2/type/13/ half_damage_from: type: array items: @@ -8551,11 +8739,13 @@ components: properties: name: type: string - example: poison + examples: + - poison url: type: string format: uri - example: https://pokeapi.co/api/v2/type/4/ + examples: + - https://pokeapi.co/api/v2/type/4/ double_damage_from: type: array items: @@ -8566,11 +8756,13 @@ components: properties: name: type: string - example: water + examples: + - water url: type: string format: uri - example: https://pokeapi.co/api/v2/type/11/ + examples: + - https://pokeapi.co/api/v2/type/11/ readOnly: true past_damage_relations: type: array @@ -8588,11 +8780,13 @@ components: properties: name: type: string - example: generation-v + examples: + - generation-v url: type: string format: uri - example: https://pokeapi.co/api/v2/generation/5/ + examples: + - https://pokeapi.co/api/v2/generation/5/ damage_relations: type: object required: @@ -8613,11 +8807,13 @@ components: properties: name: type: string - example: flying + examples: + - flying url: type: string format: uri - example: https://pokeapi.co/api/v2/type/3/ + examples: + - https://pokeapi.co/api/v2/type/3/ half_damage_to: type: array items: @@ -8628,11 +8824,13 @@ components: properties: name: type: string - example: bug + examples: + - bug url: type: string format: uri - example: https://pokeapi.co/api/v2/type/7/ + examples: + - https://pokeapi.co/api/v2/type/7/ double_damage_to: type: array items: @@ -8643,11 +8841,13 @@ components: properties: name: type: string - example: poison + examples: + - poison url: type: string format: uri - example: https://pokeapi.co/api/v2/type/4/ + examples: + - https://pokeapi.co/api/v2/type/4/ no_damage_from: type: array items: @@ -8658,11 +8858,13 @@ components: properties: name: type: string - example: electric + examples: + - electric url: type: string format: uri - example: https://pokeapi.co/api/v2/type/13/ + examples: + - https://pokeapi.co/api/v2/type/13/ half_damage_from: type: array items: @@ -8673,11 +8875,13 @@ components: properties: name: type: string - example: poison + examples: + - poison url: type: string format: uri - example: https://pokeapi.co/api/v2/type/4/ + examples: + - https://pokeapi.co/api/v2/type/4/ double_damage_from: type: array items: @@ -8688,11 +8892,13 @@ components: properties: name: type: string - example: water + examples: + - water url: type: string format: uri - example: https://pokeapi.co/api/v2/type/11/ + examples: + - https://pokeapi.co/api/v2/type/11/ readOnly: true game_indices: type: array @@ -8718,7 +8924,8 @@ components: properties: slot: type: integer - example: 1 + examples: + - 1 pokemon: type: object require: @@ -8728,12 +8935,14 @@ components: name: type: string description: The name of the pokemon - example: sandshrew + examples: + - sandshrew url: type: string format: uri description: The URL to get more information about the pokemon - example: https://pokeapi.co/api/v2/pokemon/27/ + examples: + - https://pokeapi.co/api/v2/pokemon/27/ readOnly: true moves: type: array @@ -8828,11 +9037,13 @@ components: properties: name: type: string - example: level-up + examples: + - level-up url: type: string format: uri - example: https://pokeapi.co/api/v2/move-learn-method/1/ + examples: + - https://pokeapi.co/api/v2/move-learn-method/1/ readOnly: true pokedexes: type: array @@ -8844,11 +9055,13 @@ components: properties: name: type: string - example: kanto + examples: + - kanto url: type: string format: uri - example: https://pokeapi.co/api/v2/pokedex/2/ + examples: + - https://pokeapi.co/api/v2/pokedex/2/ readOnly: true regions: type: array @@ -8860,11 +9073,13 @@ components: properties: name: type: string - example: kanto + examples: + - kanto url: type: string format: uri - example: https://pokeapi.co/api/v2/region/1/ + examples: + - https://pokeapi.co/api/v2/region/1/ readOnly: true versions: type: array diff --git a/pokemon_v2/api.py b/pokemon_v2/api.py index ba2a0ef5..7154aeea 100644 --- a/pokemon_v2/api.py +++ b/pokemon_v2/api.py @@ -142,7 +142,7 @@ class BerryFlavorResource(PokeapiCommonViewset): @extend_schema( description="Characteristics indicate which stat contains a Pokémon's highest IV. A Pokémon's Characteristic is determined by the remainder of its highest IV divided by 5 (gene_modulo). Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Characteristic) for greater detail.", - summary="Get charecterictic", + summary="Get characteristic", tags=["pokemon"], ) @extend_schema_view( diff --git a/pokemon_v2/serializers.py b/pokemon_v2/serializers.py index 47e19509..f2213c32 100644 --- a/pokemon_v2/serializers.py +++ b/pokemon_v2/serializers.py @@ -484,7 +484,9 @@ class CharacteristicDetailSerializer(serializers.ModelSerializer): "items": { "type": "integer", "format": "int32", }, - "example": [0, 5, 10, 15, 20, 25, 30], + "examples": [ + [0, 5, 10, 15, 20, 25, 30] + ] } ) def get_values(self, obj): @@ -626,11 +628,11 @@ class RegionDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "example": "red-blue"}, + "name": {"type": "string", "examples": [ "red-blue" ]}, "url": { "type": "string", "format": "uri", - "example": "https://pokeapi.co/api/v2/version-group/1/", + "examples": [ "https://pokeapi.co/api/v2/version-group/1/" ], }, }, }, @@ -710,16 +712,16 @@ class GenderDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["rate", "pokemon_species"], "properties": { - "rate": {"type": "integer", "format": "int32", "example": 1}, + "rate": {"type": "integer", "format": "int32", "examples": [ 1 ]}, "pokemon_species": { "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "example": "bulbasaur"}, + "name": {"type": "string", "examples": [ "bulbasaur" ]}, "url": { "type": "string", "format": "uri", - "example": "https://pokeapi.co/api/v2/pokemon-species/1/", + "examples": [ "https://pokeapi.co/api/v2/pokemon-species/1/" ], }, }, }, @@ -756,11 +758,11 @@ class GenderDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "example": "wormadam"}, + "name": {"type": "string", "examples": [ "wormadam" ]}, "url": { "type": "string", "format": "uri", - "example": "https://pokeapi.co/api/v2/pokemon-species/413/", + "examples": [ "https://pokeapi.co/api/v2/pokemon-species/413/" ], }, }, }, @@ -986,11 +988,11 @@ class LocationAreaDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "example": "old-rod"}, + "name": {"type": "string", "examples": [ "old-rod" ]}, "url": { "type": "string", "format": "uri", - "example": "https://pokeapi.co/api/v2/encounter-method/2/", + "examples": [ "https://pokeapi.co/api/v2/encounter-method/2/" ], }, }, }, @@ -1000,19 +1002,19 @@ class LocationAreaDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["rate", "version"], "properties": { - "rate": {"type": "integer", "format": "int32", "example": 5}, + "rate": {"type": "integer", "format": "int32", "examples": [ 5 ]}, "version": { "type": "object", "required": ["name", "url"], "properties": { "name": { "type": "string", - "example": "platinum", + "examples": [ "platinum" ], }, "url": { "type": "string", "format": "uri", - "example": "https://pokeapi.co/api/v2/version/14/", + "examples": [ "https://pokeapi.co/api/v2/version/14/" ], }, }, }, @@ -1075,11 +1077,11 @@ class LocationAreaDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "example": "tentacool"}, + "name": {"type": "string", "examples": [ "tentacool" ]}, "url": { "type": "string", "format": "uri", - "example": "ttps://pokeapi.co/api/v2/pokemon/72/", + "examples": [ "https://pokeapi.co/api/v2/pokemon/72/" ], }, }, }, @@ -1095,16 +1097,16 @@ class LocationAreaDetailSerializer(serializers.ModelSerializer): "properties": { "name": { "type": "string", - "example": "diamond", + "examples": [ "diamond" ], }, "url": { "type": "string", "format": "uri", - "example": "https://pokeapi.co/api/v2/version/12/", + "examples": [ "https://pokeapi.co/api/v2/version/12/" ], }, }, }, - "max_chance": {"type": "integer", "format": "int32", "example": 60}, + "max_chance": {"type": "integer", "format": "int32", "examples": [ 60 ]}, "encounter_details": { "type": "object", "required": [ @@ -1115,36 +1117,36 @@ class LocationAreaDetailSerializer(serializers.ModelSerializer): "method", ], "properties": { - "min_level": {"type": "integer", "format": "int32", "example": 20}, - "max_level": {"type": "integer", "format": "int32", "example": 30}, + "min_level": {"type": "integer", "format": "int32", "examples": [ 20 ]}, + "max_level": {"type": "integer", "format": "int32", "examples": [ 30 ]}, "condition_values": { "type": "object", "required": ["name", "url"], "properties": { "name": { "type": "string", - "example": "slot2-sapphire", + "examples": [ "slot2-sapphire" ], }, "url": { "type": "string", "format": "uri", - "example": "https://pokeapi.co/api/v2/encounter-condition-value/10/", + "examples": [ "https://pokeapi.co/api/v2/encounter-condition-value/10/" ], }, }, }, - "chance": {"type": "integer", "format": "int32", "example": 60}, + "chance": {"type": "integer", "format": "int32", "examples": [ 60 ]}, "method": { "type": "object", "required": ["name", "url"], "properties": { "name": { "type": "string", - "example": "surf", + "examples": [ "surf" ], }, "url": { "type": "string", "format": "uri", - "example": "https://pokeapi.co/api/v2/encounter-method/5/", + "examples": [ "https://pokeapi.co/api/v2/encounter-method/5/" ], }, }, }, @@ -1335,17 +1337,17 @@ class AbilityDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["is_hidden", "slot", "pokemon"], "properties": { - "is_hidden": {"type": "boolean", "example": True}, - "slot": {"type": "integer", "format": "int32", "example": 3}, + "is_hidden": {"type": "boolean"}, + "slot": {"type": "integer", "format": "int32", "examples": [ 3 ]}, "pokemon": { "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "example": "gloom"}, + "name": {"type": "string", "examples": [ "gloom" ]}, "url": { "type": "string", "format": "uri", - "example": "https://pokeapi.co/api/v2/pokemon/44/", + "examples": [ "https://pokeapi.co/api/v2/pokemon/44/" ], }, }, }, @@ -1414,19 +1416,19 @@ class StatDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["change", "move"], "properties": { - "change": {"type": "integer", "format": "int32", "example": -1}, + "change": {"type": "integer", "format": "int32", "examples": [ -1 ]}, "move": { "type": "object", "required": ["name", "url"], "properties": { "name": { "type": "string", - "example": "swords-dance", + "examples": [ "swords-dance" ], }, "url": { "type": "string", "format": "uri", - "example": "https://pokeapi.co/api/v2/move/14/", + "examples": [ "https://pokeapi.co/api/v2/move/14/" ], }, }, }, @@ -1439,16 +1441,16 @@ class StatDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["change", "move"], "properties": { - "change": {"type": "integer", "format": "int32", "example": 5}, + "change": {"type": "integer", "format": "int32", "examples": [ 5 ]}, "move": { "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "example": "growl"}, + "name": {"type": "string", "examples": [ "growl" ]}, "url": { "type": "string", "format": "uri", - "example": "https://pokeapi.co/api/v2/move/45/", + "examples": [ "https://pokeapi.co/api/v2/move/45/" ], }, }, }, @@ -1485,11 +1487,11 @@ class StatDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "example": "lonely"}, + "name": {"type": "string", "examples": [ "lonely" ]}, "url": { "type": "string", "format": "uri", - "example": "https://pokeapi.co/api/v2/nature/6/", + "examples": [ "https://pokeapi.co/api/v2/nature/6/" ], }, }, }, @@ -1500,11 +1502,11 @@ class StatDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "example": "bold"}, + "name": {"type": "string", "examples": [ "bold" ]}, "url": { "type": "string", "format": "uri", - "example": "https://pokeapi.co/api/v2/nature/2/", + "examples": [ "https://pokeapi.co/api/v2/nature/2/" ], }, }, }, @@ -1613,11 +1615,11 @@ class ItemAttributeDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "example": "master-ball"}, + "name": {"type": "string", "examples": [ "master-ball" ]}, "url": { "type": "string", "format": "uri", - "example": "https://pokeapi.co/api/v2/item/1/", + "examples": [ "https://pokeapi.co/api/v2/item/1/" ], }, }, }, @@ -1749,17 +1751,17 @@ class ItemDetailSerializer(serializers.ModelSerializer): "machine": { "type": "string", "format": "uri", - "example": "https://pokeapi.co/api/v2/machine/1/", + "examples": [ "https://pokeapi.co/api/v2/machine/1/" ], }, "version_group": { "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "example": "sword-shield"}, + "name": {"type": "string", "examples": [ "sword-shield" ]}, "url": { "type": "string", "format": "uri", - "example": "https://pokeapi.co/api/v2/version-group/20/", + "examples": [ "https://pokeapi.co/api/v2/version-group/20/" ], }, }, }, @@ -1795,7 +1797,7 @@ class ItemDetailSerializer(serializers.ModelSerializer): "default": { "type": "string", "format": "uri", - "example": "https://pokeapi.co/media/sprites/items/master-ball.png", + "examples": [ "https://pokeapi.co/media/sprites/items/master-ball.png" ], } }, } @@ -1811,11 +1813,11 @@ class ItemDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "example": "countable"}, + "name": {"type": "string", "examples": [ "countable" ]}, "url": { "type": "string", "format": "uri", - "example": "https://pokeapi.co/api/v2/item-attribute/1/", + "examples": [ "https://pokeapi.co/api/v2/item-attribute/1/" ], }, }, }, @@ -1849,11 +1851,11 @@ class ItemDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "example": "farfetchd"}, + "name": {"type": "string", "examples": [ "farfetchd" ]}, "url": { "type": "string", "format": "uri", - "example": "https://pokeapi.co/api/v2/pokemon/83/", + "examples": [ "https://pokeapi.co/api/v2/pokemon/83/" ], }, }, }, @@ -1863,16 +1865,16 @@ class ItemDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["rarity", "version"], "properties": { - "rarity": {"type": "integer", "format": "int32", "example": 5}, + "rarity": {"type": "integer", "format": "int32", "examples": [ 5 ]}, "version": { "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "example": "ruby"}, + "name": {"type": "string", "examples": [ "ruby" ]}, "url": { "type": "string", "format": "uri", - "example": "https://pokeapi.co/api/v2/version/7/", + "examples": [ "https://pokeapi.co/api/v2/version/7/" ], }, }, }, @@ -1923,7 +1925,7 @@ class ItemDetailSerializer(serializers.ModelSerializer): "url": { "type": "string", "format": "uri", - "example": '"https://pokeapi.co/api/v2/evolution-chain/51/', + "examples": [ "https://pokeapi.co/api/v2/evolution-chain/51/" ], } }, } @@ -1999,16 +2001,16 @@ class NatureDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["max_change", "pokeathlon_stat"], "properties": { - "max_change": {"type": "integer", "format": "int32", "example": 1}, + "max_change": {"type": "integer", "format": "int32", "examples": [ 1 ]}, "pokeathlon_stat": { "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "example": "power"}, + "name": {"type": "string", "examples": [ "power" ]}, "url": { "type": "string", "format": "uri", - "example": "https://pokeapi.co/api/v2/pokeathlon-stat/2/", + "examples": [ "https://pokeapi.co/api/v2/pokeathlon-stat/2/" ], }, }, }, @@ -2078,7 +2080,7 @@ class BerryFlavorDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["potency", "berry"], "properties": { - "potency": {"type": "integer", "example": 10}, + "potency": {"type": "integer", "examples": [ 10 ]}, "berry": { "type": "object", "require": ["name", "url"], @@ -2086,13 +2088,13 @@ class BerryFlavorDetailSerializer(serializers.ModelSerializer): "name": { "type": "string", "description": "The name of the berry", - "example": "rowap", + "examples": [ "rowap" ], }, "url": { "type": "string", "format": "uri", "description": "The URL to get more information about the berry", - "example": "https://pokeapi.co/api/v2/berry/64/", + "examples": [ "https://pokeapi.co/api/v2/berry/64/" ], }, }, }, @@ -2144,7 +2146,7 @@ class BerryDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["potency", "flavor"], "properties": { - "potency": {"type": "integer", "example": 10}, + "potency": {"type": "integer", "examples": [ 10 ]}, "flavor": { "type": "object", "require": ["name", "url"], @@ -2152,13 +2154,13 @@ class BerryDetailSerializer(serializers.ModelSerializer): "name": { "type": "string", "description": "The name of the flavor", - "example": "spicy", + "examples": [ "spicy" ], }, "url": { "type": "string", "format": "uri", "description": "The URL to get more information about the flavor", - "example": "https://pokeapi.co/api/v2/berry-flavor/1/", + "examples": [ "https://pokeapi.co/api/v2/berry-flavor/1/" ], }, }, }, @@ -2218,13 +2220,13 @@ class EggGroupDetailSerializer(serializers.ModelSerializer): "name": { "type": "string", "description": "Pokemon species name.", - "example": "bulbasaur", + "examples": [ "bulbasaur" ], }, "url": { "type": "string", "format": "uri", "description": "The URL to get more information about the species", - "example": "https://pokeapi.co/api/v2/pokemon-species/1/", + "examples": [ "https://pokeapi.co/api/v2/pokemon-species/1/" ], }, }, }, @@ -2342,11 +2344,11 @@ class TypeDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "example": "flying"}, + "name": {"type": "string", "examples": [ "flying" ]}, "url": { "type": "string", "format": "uri", - "example": "https://pokeapi.co/api/v2/type/3/", + "examples": [ "https://pokeapi.co/api/v2/type/3/" ], }, }, }, @@ -2357,11 +2359,11 @@ class TypeDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "example": "bug"}, + "name": {"type": "string", "examples": [ "bug" ]}, "url": { "type": "string", "format": "uri", - "example": "https://pokeapi.co/api/v2/type/7/", + "examples": [ "https://pokeapi.co/api/v2/type/7/" ], }, }, }, @@ -2372,11 +2374,11 @@ class TypeDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "example": "poison"}, + "name": {"type": "string", "examples": [ "poison" ]}, "url": { "type": "string", "format": "uri", - "example": "https://pokeapi.co/api/v2/type/4/", + "examples": [ "https://pokeapi.co/api/v2/type/4/" ], }, }, }, @@ -2387,11 +2389,11 @@ class TypeDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "example": "electric"}, + "name": {"type": "string", "examples": [ "electric" ]}, "url": { "type": "string", "format": "uri", - "example": "https://pokeapi.co/api/v2/type/13/", + "examples": [ "https://pokeapi.co/api/v2/type/13/" ], }, }, }, @@ -2402,11 +2404,11 @@ class TypeDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "example": "poison"}, + "name": {"type": "string", "examples": [ "poison" ]}, "url": { "type": "string", "format": "uri", - "example": "https://pokeapi.co/api/v2/type/4/", + "examples": [ "https://pokeapi.co/api/v2/type/4/" ], }, }, }, @@ -2417,11 +2419,11 @@ class TypeDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "example": "water"}, + "name": {"type": "string", "examples": [ "water" ]}, "url": { "type": "string", "format": "uri", - "example": "https://pokeapi.co/api/v2/type/11/", + "examples": [ "https://pokeapi.co/api/v2/type/11/" ], }, }, }, @@ -2504,11 +2506,11 @@ class TypeDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "example": "generation-v"}, + "name": {"type": "string", "examples": [ "generation-v" ]}, "url": { "type": "string", "format": "uri", - "example": "https://pokeapi.co/api/v2/generation/5/", + "examples": [ "https://pokeapi.co/api/v2/generation/5/" ], }, }, }, @@ -2529,11 +2531,11 @@ class TypeDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "example": "flying"}, + "name": {"type": "string", "examples": [ "flying" ]}, "url": { "type": "string", "format": "uri", - "example": "https://pokeapi.co/api/v2/type/3/", + "examples": [ "https://pokeapi.co/api/v2/type/3/" ], }, }, }, @@ -2544,11 +2546,11 @@ class TypeDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "example": "bug"}, + "name": {"type": "string", "examples": [ "bug" ]}, "url": { "type": "string", "format": "uri", - "example": "https://pokeapi.co/api/v2/type/7/", + "examples": [ "https://pokeapi.co/api/v2/type/7/" ], }, }, }, @@ -2559,11 +2561,11 @@ class TypeDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "example": "poison"}, + "name": {"type": "string", "examples": [ "poison" ]}, "url": { "type": "string", "format": "uri", - "example": "https://pokeapi.co/api/v2/type/4/", + "examples": [ "https://pokeapi.co/api/v2/type/4/" ], }, }, }, @@ -2576,12 +2578,12 @@ class TypeDetailSerializer(serializers.ModelSerializer): "properties": { "name": { "type": "string", - "example": "electric", + "examples": [ "electric" ], }, "url": { "type": "string", "format": "uri", - "example": "https://pokeapi.co/api/v2/type/13/", + "examples": [ "https://pokeapi.co/api/v2/type/13/" ], }, }, }, @@ -2592,11 +2594,11 @@ class TypeDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "example": "poison"}, + "name": {"type": "string", "examples": [ "poison" ]}, "url": { "type": "string", "format": "uri", - "example": "https://pokeapi.co/api/v2/type/4/", + "examples": [ "https://pokeapi.co/api/v2/type/4/" ], }, }, }, @@ -2607,11 +2609,11 @@ class TypeDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "example": "water"}, + "name": {"type": "string", "examples": [ "water" ]}, "url": { "type": "string", "format": "uri", - "example": "https://pokeapi.co/api/v2/type/11/", + "examples": [ "https://pokeapi.co/api/v2/type/11/" ], }, }, }, @@ -2723,7 +2725,7 @@ class TypeDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["potency", "flavor"], "properties": { - "slot": {"type": "integer", "example": 1}, + "slot": {"type": "integer", "examples": [ 1 ]}, "pokemon": { "type": "object", "require": ["name", "url"], @@ -2731,13 +2733,13 @@ class TypeDetailSerializer(serializers.ModelSerializer): "name": { "type": "string", "description": "The name of the pokemon", - "example": "sandshrew", + "examples": [ "sandshrew" ], }, "url": { "type": "string", "format": "uri", "description": "The URL to get more information about the pokemon", - "example": "https://pokeapi.co/api/v2/pokemon/27/", + "examples": [ "https://pokeapi.co/api/v2/pokemon/27/" ], }, }, }, @@ -2858,11 +2860,11 @@ class MoveMetaAilmentDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "example": "thunder-punch"}, + "name": {"type": "string", "examples": [ "thunder-punch" ]}, "url": { "type": "string", "format": "uri", - "example": "https://pokeapi.co/api/v2/move/9/", + "examples": [ "https://pokeapi.co/api/v2/move/9/" ], }, }, }, @@ -2905,11 +2907,11 @@ class MoveMetaCategoryDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "example": "sing"}, + "name": {"type": "string", "examples": [ "sing" ]}, "url": { "type": "string", "format": "uri", - "example": "https://pokeapi.co/api/v2/move/47/", + "examples": [ "https://pokeapi.co/api/v2/move/47/" ], }, }, }, @@ -3018,21 +3020,21 @@ class MoveChangeSerializer(serializers.ModelSerializer): "properties": { "effect": { "type": "string", - "example": "Inflicts [regular damage]{mechanic:regular-damage}.", + "examples": [ "Inflicts [regular damage]{mechanic:regular-damage}." ], }, "short_effect": { "type": "string", - "example": "Inflicts regular damage with no additional effect.", + "examples": [ "Inflicts regular damage with no additional effect." ], }, "language": { "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "example": "en"}, + "name": {"type": "string", "examples": [ "en" ]}, "url": { "type": "string", "format": "uri", - "example": "https://pokeapi.co/api/v2/language/9/", + "examples": [ "https://pokeapi.co/api/v2/language/9/" ], }, }, }, @@ -3144,11 +3146,11 @@ class MoveDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "example": "clefairy"}, + "name": {"type": "string", "examples": [ "clefairy" ]}, "url": { "type": "string", "format": "uri", - "example": "https://pokeapi.co/api/v2/pokemon/35/", + "examples": [ "https://pokeapi.co/api/v2/pokemon/35/" ], }, }, }, @@ -3185,7 +3187,7 @@ class MoveDetailSerializer(serializers.ModelSerializer): "url": { "type": "string", "format": "uri", - "example": "https://pokeapi.co/api/v2/machine/1/", + "examples": [ "https://pokeapi.co/api/v2/machine/1/" ], } }, }, @@ -3193,11 +3195,11 @@ class MoveDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "example": "sword-shield"}, + "name": {"type": "string", "examples": [ "sword-shield" ]}, "url": { "type": "string", "format": "uri", - "example": "https://pokeapi.co/api/v2/version-group/1/", + "examples": [ "https://pokeapi.co/api/v2/version-group/1/" ], }, }, }, @@ -3241,11 +3243,11 @@ class MoveDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "example": "fire-punch"}, + "name": {"type": "string", "examples": [ "fire-punch" ]}, "url": { "type": "string", "format": "uri", - "example": "https://pokeapi.co/api/v2/move/7/", + "examples": [ "https://pokeapi.co/api/v2/move/7/" ], }, }, }, @@ -3257,11 +3259,11 @@ class MoveDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "example": "ice-punch"}, + "name": {"type": "string", "examples": [ "ice-punch" ]}, "url": { "type": "string", "format": "uri", - "example": "https://pokeapi.co/api/v2/move/8/", + "examples": [ "https://pokeapi.co/api/v2/move/8/" ], }, }, }, @@ -3281,12 +3283,12 @@ class MoveDetailSerializer(serializers.ModelSerializer): "properties": { "name": { "type": "string", - "example": "night-slash", + "examples": [ "night-slash" ], }, "url": { "type": "string", "format": "uri", - "example": "https://pokeapi.co/api/v2/move/400/", + "examples": [ "https://pokeapi.co/api/v2/move/400/" ], }, }, }, @@ -3300,12 +3302,12 @@ class MoveDetailSerializer(serializers.ModelSerializer): "properties": { "name": { "type": "string", - "example": "focus-energy", + "examples": [ "focus-energy" ], }, "url": { "type": "string", "format": "uri", - "example": "https://pokeapi.co/api/v2/move/116/", + "examples": [ "https://pokeapi.co/api/v2/move/116/" ], }, }, }, @@ -3381,21 +3383,21 @@ class MoveDetailSerializer(serializers.ModelSerializer): "properties": { "effect": { "type": "string", - "example": "Inflicts [regular damage]{mechanic:regular-damage}.", + "examples": [ "Inflicts [regular damage]{mechanic:regular-damage}." ], }, "short_effect": { "type": "string", - "example": "Inflicts regular damage with no additional effect.", + "examples": [ "Inflicts regular damage with no additional effect." ], }, "language": { "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "example": "en"}, + "name": {"type": "string", "examples": [ "en" ]}, "url": { "type": "string", "format": "uri", - "example": "https://pokeapi.co/api/v2/language/9/", + "examples": [ "https://pokeapi.co/api/v2/language/9/" ], }, }, }, @@ -3432,17 +3434,17 @@ class MoveDetailSerializer(serializers.ModelSerializer): "properties": { "effect": { "type": "string", - "example": "Hits Pokémon under the effects of dig and fly.", + "examples": [ "Hits Pokémon under the effects of dig and fly." ], }, "language": { "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "example": "en"}, + "name": {"type": "string", "examples": [ "en" ]}, "url": { "type": "string", "format": "uri", - "example": "https://pokeapi.co/api/v2/language/9/", + "examples": [ "https://pokeapi.co/api/v2/language/9/" ], }, }, }, @@ -3453,11 +3455,11 @@ class MoveDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "example": "gold-silver"}, + "name": {"type": "string", "examples": [ "gold-silver" ]}, "url": { "type": "string", "format": "uri", - "example": "https://pokeapi.co/api/v2/version-group/3/", + "examples": [ "https://pokeapi.co/api/v2/version-group/3/" ], }, }, }, @@ -3480,16 +3482,16 @@ class MoveDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["change", "stat"], "properties": { - "change": {"type": "integer", "format": "int32", "example": 2}, + "change": {"type": "integer", "format": "int32", "examples": [ 2 ]}, "stat": { "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "example": "attack"}, + "name": {"type": "string", "examples": [ "attack" ]}, "url": { "type": "string", "format": "uri", - "example": "https://pokeapi.co/api/v2/stat/1/", + "examples": [ "https://pokeapi.co/api/v2/stat/1/" ], }, }, }, @@ -3548,20 +3550,20 @@ class PalParkAreaDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["base_score", "pokemon-species", "rate"], "properties": { - "base_score": {"type": "integer", "format": "int32", "example": 50}, + "base_score": {"type": "integer", "format": "int32", "examples": [ 50 ]}, "pokemon-species": { "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "example": "bulbasaur"}, + "name": {"type": "string", "examples": [ "bulbasaur" ]}, "url": { "type": "string", "format": "uri", - "example": "https://pokeapi.co/api/v2/pokemon-species/1/", + "examples": [ "https://pokeapi.co/api/v2/pokemon-species/1/" ], }, }, }, - "rate": {"type": "integer", "format": "int32", "example": 30}, + "rate": {"type": "integer", "format": "int32", "examples": [ 30 ]}, }, }, } @@ -3661,15 +3663,15 @@ class PokemonFormDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "example": "en"}, + "name": {"type": "string", "examples": [ "en" ]}, "url": { "type": "string", "format": "uri", - "example": "https://pokeapi.co/api/v2/language/9/", + "examples": [ "https://pokeapi.co/api/v2/language/9/" ], }, }, }, - "name": {"type": "string", "example": "Plant Cloak"}, + "name": {"type": "string", "examples": [ "Plant Cloak" ]}, }, }, } @@ -3700,15 +3702,15 @@ class PokemonFormDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "example": "en"}, + "name": {"type": "string", "examples": [ "en" ]}, "url": { "type": "string", "format": "uri", - "example": "https://pokeapi.co/api/v2/language/9/", + "examples": [ "https://pokeapi.co/api/v2/language/9/" ], }, }, }, - "name": {"type": "string", "example": "Plant Cloak"}, + "name": {"type": "string", "examples": [ "Plant Cloak" ]}, }, }, } @@ -3736,16 +3738,16 @@ class PokemonFormDetailSerializer(serializers.ModelSerializer): "default": { "type": "string", "format": "uri", - "example": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/412.png", + "examples": [ "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/412.png" ], } }, "additionalProperties": { # Stoplight Elements doesn't render this well "type": "string", "format": "uri", "nullable": True, - "example": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/shiny/412.png", + "examples": [ "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/shiny/412.png" ], }, - "example": { + "examples": [ { "back_default": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/412.png", "back_female": None, "back_shiny": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/shiny/412.png", @@ -3754,7 +3756,7 @@ class PokemonFormDetailSerializer(serializers.ModelSerializer): "front_female": None, "front_shiny": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/shiny/412.png", "front_shiny_female": None, - }, + } ], } ) def get_pokemon_form_sprites(self, obj): @@ -3768,16 +3770,16 @@ class PokemonFormDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["slot", "type"], "properties": { - "slot": {"type": "integer", "format": "int32", "example": 1}, + "slot": {"type": "integer", "format": "int32", "examples": [ 1 ]}, "type": { "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "example": "bug"}, + "name": {"type": "string", "examples": [ "bug" ]}, "url": { "type": "string", "format": "uri", - "example": "https://pokeapi.co/api/v2/type/7/", + "examples": [ "https://pokeapi.co/api/v2/type/7/" ], }, }, }, @@ -3881,11 +3883,11 @@ class MoveLearnMethodDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "example": "red-blue"}, + "name": {"type": "string", "examples": [ "red-blue" ]}, "url": { "type": "string", "format": "uri", - "example": "https://pokeapi.co/api/v2/version-group/1/", + "examples": [ "https://pokeapi.co/api/v2/version-group/1/" ], }, }, }, @@ -3945,9 +3947,9 @@ class PokemonShapeDetailSerializer(serializers.ModelSerializer): "url": { "type": "string", "format": "uri", - "example": "https://pokeapi.co/api/v2/language/9/", + "examples": [ "https://pokeapi.co/api/v2/language/9/" ], }, - "name": {"type": "string", "example": "Ball"}, + "name": {"type": "string", "examples": [ "Ball" ]}, }, }, } @@ -3987,16 +3989,16 @@ class PokemonShapeDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["awesome_name", "language"], "properties": { - "awesome_name": {"type": "string", "example": "Pomaceous"}, + "awesome_name": {"type": "string", "examples": [ "Pomaceous" ]}, "language": { "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "example": "en"}, + "name": {"type": "string", "examples": [ "en" ]}, "url": { "type": "string", "format": "uri", - "example": "https://pokeapi.co/api/v2/language/9/", + "examples": [ "https://pokeapi.co/api/v2/language/9/" ], }, }, }, @@ -4111,9 +4113,9 @@ class PokemonDetailSerializer(serializers.ModelSerializer): "type": "string", "format": "uri", "nullable": True, - "example": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/shiny/1.png", + "examples": [ "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/shiny/1.png" ], }, - "example": { + "examples": [ { "back_default": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/1.png", "back_female": None, "back_shiny": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/shiny/1.png", @@ -4122,7 +4124,7 @@ class PokemonDetailSerializer(serializers.ModelSerializer): "front_female": None, "front_shiny": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/shiny/1.png", "front_shiny_female": None, - }, + } ], } ) def get_pokemon_sprites(self, obj): @@ -4137,12 +4139,12 @@ class PokemonDetailSerializer(serializers.ModelSerializer): "latest": { "type": "string", "format": "uri", - "example": "https://raw.githubusercontent.com/PokeAPI/cries/main/cries/pokemon/latest/50.ogg", + "examples": [ "https://raw.githubusercontent.com/PokeAPI/cries/main/cries/pokemon/latest/50.ogg" ], }, "legacy": { "type": "string", "format": "uri", - "example": "https://raw.githubusercontent.com/PokeAPI/cries/main/cries/pokemon/legacy/50.ogg", + "examples": [ "https://raw.githubusercontent.com/PokeAPI/cries/main/cries/pokemon/legacy/50.ogg" ], }, }, } @@ -4429,11 +4431,11 @@ class PokemonDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "example": "scratch"}, + "name": {"type": "string", "examples": [ "scratch" ]}, "url": { "type": "string", "format": "uri", - "example": "https://pokeapi.co/api/v2/move/10/", + "examples": [ "https://pokeapi.co/api/v2/move/10/" ], }, }, }, @@ -4447,19 +4449,19 @@ class PokemonDetailSerializer(serializers.ModelSerializer): "version_group", ], "properties": { - "level_learned_at": {"type": "integer", "format": "int32", "example": 1}, + "level_learned_at": {"type": "integer", "format": "int32", "examples": [ 1 ]}, "move_learn_method": { "type": "object", "required": ["name", "url"], "properties": { "name": { "type": "string", - "example": "level-up", + "examples": [ "level-up" ], }, "url": { "type": "string", "format": "uri", - "example": "https://pokeapi.co/api/v2/move-learn-method/1/", + "examples": [ "https://pokeapi.co/api/v2/move-learn-method/1/" ], }, }, }, @@ -4469,12 +4471,12 @@ class PokemonDetailSerializer(serializers.ModelSerializer): "properties": { "name": { "type": "string", - "example": "red-blue", + "examples": [ "red-blue" ], }, "url": { "type": "string", "format": "uri", - "example": "https://pokeapi.co/api/v2/version-group/1/", + "examples": [ "https://pokeapi.co/api/v2/version-group/1/" ], }, }, }, @@ -4558,11 +4560,11 @@ class PokemonDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "example": "soft-sand"}, + "name": {"type": "string", "examples": [ "soft-sand" ]}, "url": { "type": "string", "format": "uri", - "example": "https://pokeapi.co/api/v2/item/214/", + "examples": [ "https://pokeapi.co/api/v2/item/214/" ], }, }, }, @@ -4572,16 +4574,16 @@ class PokemonDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["rarity", "version"], "properties": { - "rarity": {"type": "integer", "format": "int32", "example": 5}, + "rarity": {"type": "integer", "format": "int32", "examples": [ 5 ]}, "version": { "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "example": "diamond"}, + "name": {"type": "string", "examples": [ "diamond" ]}, "url": { "type": "string", "format": "uri", - "example": "https://pokeapi.co/api/v2/version/12/", + "examples": [ "https://pokeapi.co/api/v2/version/12/" ], }, }, }, @@ -4643,16 +4645,16 @@ class PokemonDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "example": "sand-veil"}, + "name": {"type": "string", "examples": [ "sand-veil" ]}, "url": { "type": "string", "format": "uri", - "example": "https://pokeapi.co/api/v2/ability/8/", + "examples": [ "https://pokeapi.co/api/v2/ability/8/" ], }, }, }, - "is_hidden": {"type": "boolean", "example": False}, - "slot": {"type": "integer", "format": "int32", "example": 1}, + "is_hidden": {"type": "boolean"}, + "slot": {"type": "integer", "format": "int32", "examples": [ 1 ]}, }, }, } @@ -4705,17 +4707,17 @@ class PokemonDetailSerializer(serializers.ModelSerializer): "properties": { "name": { "type": "string", - "example": "levitate", + "examples": [ "levitate" ], }, "url": { "type": "string", "format": "uri", - "example": "https://pokeapi.co/api/v2/ability/26/", + "examples": [ "https://pokeapi.co/api/v2/ability/26/" ], }, }, }, - "is_hidden": {"type": "boolean", "example": False}, - "slot": {"type": "integer", "format": "int32", "example": 1}, + "is_hidden": {"type": "boolean"}, + "slot": {"type": "integer", "format": "int32", "examples": [ 1 ]}, }, }, }, @@ -4723,11 +4725,11 @@ class PokemonDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "example": "generation-vi"}, + "name": {"type": "string", "examples": [ "generation-vi" ]}, "url": { "type": "string", "format": "uri", - "example": "https://pokeapi.co/api/v2/generation/6/", + "examples": [ "https://pokeapi.co/api/v2/generation/6/" ], }, }, }, @@ -4784,16 +4786,16 @@ class PokemonDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["slot", "type"], "properties": { - "slot": {"type": "integer", "format": "int32", "example": 1}, + "slot": {"type": "integer", "format": "int32", "examples": [ 1 ]}, "type": { "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "example": "ghost"}, + "name": {"type": "string", "examples": [ "ghost" ]}, "url": { "type": "string", "format": "uri", - "example": "https://pokeapi.co/api/v2/type/8/", + "examples": [ "https://pokeapi.co/api/v2/type/8/" ], }, }, }, @@ -4840,11 +4842,11 @@ class PokemonDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "example": "generation-v"}, + "name": {"type": "string", "examples": [ "generation-v" ]}, "url": { "type": "string", "format": "uri", - "example": "https://pokeapi.co/api/v2/generation/5/", + "examples": [ "https://pokeapi.co/api/v2/generation/5/" ], }, }, }, @@ -4854,16 +4856,16 @@ class PokemonDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["slot", "type"], "properties": { - "slot": {"type": "integer", "format": "int32", "example": 1}, + "slot": {"type": "integer", "format": "int32", "examples": [ 1 ]}, "type": { "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "example": "normal"}, + "name": {"type": "string", "examples": [ "normal" ]}, "url": { "type": "string", "format": "uri", - "example": "https://pokeapi.co/api/v2/type/1/", + "examples": [ "https://pokeapi.co/api/v2/type/1/" ], }, }, }, @@ -4912,7 +4914,7 @@ class PokemonDetailSerializer(serializers.ModelSerializer): @extend_schema_field( field={ "type": "string", - "example": "https://pokeapi.co/api/v2/pokemon/1/encounters", + "examples": [ "https://pokeapi.co/api/v2/pokemon/1/encounters" ], } ) def get_encounters(self, obj): @@ -4947,11 +4949,11 @@ class EvolutionTriggerDetailSerializer(serializers.HyperlinkedModelSerializer): "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "example": "ivysaur"}, + "name": {"type": "string", "examples": [ "ivysaur" ]}, "url": { "type": "string", "format": "uri", - "example": "https://pokeapi.co/api/v2/pokemon-species/2/", + "examples": [ "https://pokeapi.co/api/v2/pokemon-species/2/" ], }, }, }, @@ -5075,15 +5077,15 @@ class PokemonSpeciesDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "example": "en"}, + "name": {"type": "string", "examples": [ "en" ]}, "url": { "type": "string", "format": "uri", - "example": "https://pokeapi.co/api/v2/language/9/", + "examples": [ "https://pokeapi.co/api/v2/language/9/" ], }, }, }, - "name": {"type": "string", "example": "bulbasaur"}, + "name": {"type": "string", "examples": [ "bulbasaur" ]}, }, }, } @@ -5115,16 +5117,16 @@ class PokemonSpeciesDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["genus", "language"], "properties": { - "genus": {"type": "string", "example": "Seed Pokémon"}, + "genus": {"type": "string", "examples": [ "Seed Pokémon" ]}, "language": { "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "example": "en"}, + "name": {"type": "string", "examples": [ "en" ]}, "url": { "type": "string", "format": "uri", - "example": "https://pokeapi.co/api/v2/language/9/", + "examples": [ "https://pokeapi.co/api/v2/language/9/" ], }, }, }, @@ -5154,11 +5156,11 @@ class PokemonSpeciesDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "example": "monster"}, + "name": {"type": "string", "examples": [ "monster" ]}, "url": { "type": "string", "format": "uri", - "example": "https://pokeapi.co/api/v2/egg-group/1/", + "examples": [ "https://pokeapi.co/api/v2/egg-group/1/" ], }, }, }, @@ -5180,16 +5182,16 @@ class PokemonSpeciesDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["is_default", "pokemon"], "properties": { - "is_default": {"type": "boolean", "example": True}, + "is_default": {"type": "boolean"}, "pokemon": { "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "example": "bulbasaur"}, + "name": {"type": "string", "examples": [ "bulbasaur" ]}, "url": { "type": "string", "format": "uri", - "example": "https://pokeapi.co/api/v2/pokemon/1/", + "examples": [ "https://pokeapi.co/api/v2/pokemon/1/" ], }, }, }, @@ -5227,16 +5229,16 @@ class PokemonSpeciesDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "example": "field"}, + "name": {"type": "string", "examples": [ "field" ]}, "url": { "type": "string", "format": "uri", - "example": "https://pokeapi.co/api/v2/pal-park-area/2/", + "examples": [ "https://pokeapi.co/api/v2/pal-park-area/2/" ], }, }, }, - "base_score": {"type": "integer", "format": "int32", "example": 50}, - "rate": {"type": "integer", "format": "int32", "example": 30}, + "base_score": {"type": "integer", "format": "int32", "examples": [ 50 ]}, + "rate": {"type": "integer", "format": "int32", "examples": [ 30 ]}, }, }, } @@ -5304,7 +5306,7 @@ class EvolutionChainDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["evolution_details", "evolves_to", "is_baby", "species"], "properties": { - "evolution_details": {"type": "array", "items": {}, "example": []}, + "evolution_details": {"type": "array", "items": {}, "examples": []}, "evolves_to": { "type": "array", "items": { @@ -5349,12 +5351,12 @@ class EvolutionChainDetailSerializer(serializers.ModelSerializer): "properties": { "name": { "type": "string", - "example": 1, + "examples": [ 1 ], }, "url": { "type": "string", "format": "uri", - "example": 2, + "examples": [ 2 ], }, }, }, @@ -5365,12 +5367,12 @@ class EvolutionChainDetailSerializer(serializers.ModelSerializer): "properties": { "name": { "type": "string", - "example": 1, + "examples": [ 1 ], }, "url": { "type": "string", "format": "uri", - "example": 2, + "examples": [ 2 ], }, }, }, @@ -5381,12 +5383,12 @@ class EvolutionChainDetailSerializer(serializers.ModelSerializer): "properties": { "name": { "type": "string", - "example": 1, + "examples": [ 1 ], }, "url": { "type": "string", "format": "uri", - "example": 2, + "examples": [ 2 ], }, }, }, @@ -5466,32 +5468,32 @@ class EvolutionChainDetailSerializer(serializers.ModelSerializer): }, }, }, - "is_baby": {"type": "boolean", "example": True}, + "is_baby": {"type": "boolean"}, "species": { "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "example": "happiny"}, + "name": {"type": "string", "examples": [ "happiny" ]}, "url": { "type": "string", "format": "uri", - "example": "https://pokeapi.co/api/v2/pokemon-species/440/", + "examples": [ "https://pokeapi.co/api/v2/pokemon-species/440/" ], }, }, }, }, }, }, - "is_baby": {"type": "boolean", "example": True}, + "is_baby": {"type": "boolean"}, "species": { "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "example": "happiny"}, + "name": {"type": "string", "examples": [ "happiny" ]}, "url": { "type": "string", "format": "uri", - "example": "https://pokeapi.co/api/v2/pokemon-species/440/", + "examples": [ "https://pokeapi.co/api/v2/pokemon-species/440/" ], }, }, }, @@ -5624,17 +5626,17 @@ class PokeathlonStatDetailSerializer(serializers.HyperlinkedModelSerializer): "max_change": { "type": "integer", "format": "int32", "maximum": -1, - "example": -1, + "examples": [ -1 ], }, "nature": { "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "example": "hardy"}, + "name": {"type": "string", "examples": [ "hardy" ]}, "url": { "type": "string", "format": "uri", - "example": "https://pokeapi.co/api/v2/nature/1/", + "examples": [ "https://pokeapi.co/api/v2/nature/1/" ], }, }, }, @@ -5650,17 +5652,17 @@ class PokeathlonStatDetailSerializer(serializers.HyperlinkedModelSerializer): "max_change": { "type": "integer", "format": "int32", "minimum": 1, - "example": 2, + "examples": [ 2 ], }, "nature": { "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "example": "hardy"}, + "name": {"type": "string", "examples": [ "hardy" ]}, "url": { "type": "string", "format": "uri", - "example": "https://pokeapi.co/api/v2/nature/1/", + "examples": [ "https://pokeapi.co/api/v2/nature/1/" ], }, }, }, @@ -5735,16 +5737,16 @@ class PokedexDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["entry_number", "pokemon_species"], "properties": { - "entry_number": {"type": "integer", "format": "int32", "example": 1}, + "entry_number": {"type": "integer", "format": "int32", "examples": [ 1 ]}, "pokemon_species": { "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "example": "bulbasaur"}, + "name": {"type": "string", "examples": [ "bulbasaur" ]}, "url": { "type": "string", "format": "uri", - "example": "https://pokeapi.co/api/v2/pokemon-species/1/", + "examples": [ "https://pokeapi.co/api/v2/pokemon-species/1/" ], }, }, }, @@ -5773,11 +5775,11 @@ class PokedexDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "example": "the-teal-mask"}, + "name": {"type": "string", "examples": [ "the-teal-mask" ]}, "url": { "type": "string", "format": "uri", - "example": "https://pokeapi.co/api/v2/version-group/26/", + "examples": [ "https://pokeapi.co/api/v2/version-group/26/" ], }, }, }, @@ -5849,11 +5851,11 @@ class VersionGroupDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "example": "kanto"}, + "name": {"type": "string", "examples": [ "kanto" ]}, "url": { "type": "string", "format": "uri", - "example": "https://pokeapi.co/api/v2/region/1/", + "examples": [ "https://pokeapi.co/api/v2/region/1/" ], }, }, }, @@ -5880,11 +5882,11 @@ class VersionGroupDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "example": "level-up"}, + "name": {"type": "string", "examples": [ "level-up" ]}, "url": { "type": "string", "format": "uri", - "example": "https://pokeapi.co/api/v2/move-learn-method/1/", + "examples": [ "https://pokeapi.co/api/v2/move-learn-method/1/" ], }, }, }, @@ -5911,11 +5913,11 @@ class VersionGroupDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "example": "kanto"}, + "name": {"type": "string", "examples": [ "kanto" ]}, "url": { "type": "string", "format": "uri", - "example": "https://pokeapi.co/api/v2/pokedex/2/", + "examples": [ "https://pokeapi.co/api/v2/pokedex/2/" ], }, }, }, From bf195f948c53bd48fcbd7ccaee271433d5b0e1fa Mon Sep 17 00:00:00 2001 From: indyandie <1058837+Indyandie@users.noreply.github.com> Date: Wed, 27 Mar 2024 23:16:38 -0500 Subject: [PATCH 48/76] chore: `make format` --- pokemon_v2/serializers.py | 695 ++++++++++++++++++++++++-------------- 1 file changed, 444 insertions(+), 251 deletions(-) diff --git a/pokemon_v2/serializers.py b/pokemon_v2/serializers.py index f2213c32..3b5df51f 100644 --- a/pokemon_v2/serializers.py +++ b/pokemon_v2/serializers.py @@ -482,11 +482,10 @@ class CharacteristicDetailSerializer(serializers.ModelSerializer): field={ "type": "array", "items": { - "type": "integer", "format": "int32", + "type": "integer", + "format": "int32", }, - "examples": [ - [0, 5, 10, 15, 20, 25, 30] - ] + "examples": [[0, 5, 10, 15, 20, 25, 30]], } ) def get_values(self, obj): @@ -628,11 +627,11 @@ class RegionDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "examples": [ "red-blue" ]}, + "name": {"type": "string", "examples": ["red-blue"]}, "url": { "type": "string", "format": "uri", - "examples": [ "https://pokeapi.co/api/v2/version-group/1/" ], + "examples": ["https://pokeapi.co/api/v2/version-group/1/"], }, }, }, @@ -712,16 +711,18 @@ class GenderDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["rate", "pokemon_species"], "properties": { - "rate": {"type": "integer", "format": "int32", "examples": [ 1 ]}, + "rate": {"type": "integer", "format": "int32", "examples": [1]}, "pokemon_species": { "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "examples": [ "bulbasaur" ]}, + "name": {"type": "string", "examples": ["bulbasaur"]}, "url": { "type": "string", "format": "uri", - "examples": [ "https://pokeapi.co/api/v2/pokemon-species/1/" ], + "examples": [ + "https://pokeapi.co/api/v2/pokemon-species/1/" + ], }, }, }, @@ -758,11 +759,11 @@ class GenderDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "examples": [ "wormadam" ]}, + "name": {"type": "string", "examples": ["wormadam"]}, "url": { "type": "string", "format": "uri", - "examples": [ "https://pokeapi.co/api/v2/pokemon-species/413/" ], + "examples": ["https://pokeapi.co/api/v2/pokemon-species/413/"], }, }, }, @@ -988,11 +989,13 @@ class LocationAreaDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "examples": [ "old-rod" ]}, + "name": {"type": "string", "examples": ["old-rod"]}, "url": { "type": "string", "format": "uri", - "examples": [ "https://pokeapi.co/api/v2/encounter-method/2/" ], + "examples": [ + "https://pokeapi.co/api/v2/encounter-method/2/" + ], }, }, }, @@ -1002,19 +1005,25 @@ class LocationAreaDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["rate", "version"], "properties": { - "rate": {"type": "integer", "format": "int32", "examples": [ 5 ]}, + "rate": { + "type": "integer", + "format": "int32", + "examples": [5], + }, "version": { "type": "object", "required": ["name", "url"], "properties": { "name": { "type": "string", - "examples": [ "platinum" ], + "examples": ["platinum"], }, "url": { "type": "string", "format": "uri", - "examples": [ "https://pokeapi.co/api/v2/version/14/" ], + "examples": [ + "https://pokeapi.co/api/v2/version/14/" + ], }, }, }, @@ -1077,11 +1086,11 @@ class LocationAreaDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "examples": [ "tentacool" ]}, + "name": {"type": "string", "examples": ["tentacool"]}, "url": { "type": "string", "format": "uri", - "examples": [ "https://pokeapi.co/api/v2/pokemon/72/" ], + "examples": ["https://pokeapi.co/api/v2/pokemon/72/"], }, }, }, @@ -1097,16 +1106,22 @@ class LocationAreaDetailSerializer(serializers.ModelSerializer): "properties": { "name": { "type": "string", - "examples": [ "diamond" ], + "examples": ["diamond"], }, "url": { "type": "string", "format": "uri", - "examples": [ "https://pokeapi.co/api/v2/version/12/" ], + "examples": [ + "https://pokeapi.co/api/v2/version/12/" + ], }, }, }, - "max_chance": {"type": "integer", "format": "int32", "examples": [ 60 ]}, + "max_chance": { + "type": "integer", + "format": "int32", + "examples": [60], + }, "encounter_details": { "type": "object", "required": [ @@ -1117,36 +1132,52 @@ class LocationAreaDetailSerializer(serializers.ModelSerializer): "method", ], "properties": { - "min_level": {"type": "integer", "format": "int32", "examples": [ 20 ]}, - "max_level": {"type": "integer", "format": "int32", "examples": [ 30 ]}, + "min_level": { + "type": "integer", + "format": "int32", + "examples": [20], + }, + "max_level": { + "type": "integer", + "format": "int32", + "examples": [30], + }, "condition_values": { "type": "object", "required": ["name", "url"], "properties": { "name": { "type": "string", - "examples": [ "slot2-sapphire" ], + "examples": ["slot2-sapphire"], }, "url": { "type": "string", "format": "uri", - "examples": [ "https://pokeapi.co/api/v2/encounter-condition-value/10/" ], + "examples": [ + "https://pokeapi.co/api/v2/encounter-condition-value/10/" + ], }, }, }, - "chance": {"type": "integer", "format": "int32", "examples": [ 60 ]}, + "chance": { + "type": "integer", + "format": "int32", + "examples": [60], + }, "method": { "type": "object", "required": ["name", "url"], "properties": { "name": { "type": "string", - "examples": [ "surf" ], + "examples": ["surf"], }, "url": { "type": "string", "format": "uri", - "examples": [ "https://pokeapi.co/api/v2/encounter-method/5/" ], + "examples": [ + "https://pokeapi.co/api/v2/encounter-method/5/" + ], }, }, }, @@ -1338,16 +1369,16 @@ class AbilityDetailSerializer(serializers.ModelSerializer): "required": ["is_hidden", "slot", "pokemon"], "properties": { "is_hidden": {"type": "boolean"}, - "slot": {"type": "integer", "format": "int32", "examples": [ 3 ]}, + "slot": {"type": "integer", "format": "int32", "examples": [3]}, "pokemon": { "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "examples": [ "gloom" ]}, + "name": {"type": "string", "examples": ["gloom"]}, "url": { "type": "string", "format": "uri", - "examples": [ "https://pokeapi.co/api/v2/pokemon/44/" ], + "examples": ["https://pokeapi.co/api/v2/pokemon/44/"], }, }, }, @@ -1416,19 +1447,25 @@ class StatDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["change", "move"], "properties": { - "change": {"type": "integer", "format": "int32", "examples": [ -1 ]}, + "change": { + "type": "integer", + "format": "int32", + "examples": [-1], + }, "move": { "type": "object", "required": ["name", "url"], "properties": { "name": { "type": "string", - "examples": [ "swords-dance" ], + "examples": ["swords-dance"], }, "url": { "type": "string", "format": "uri", - "examples": [ "https://pokeapi.co/api/v2/move/14/" ], + "examples": [ + "https://pokeapi.co/api/v2/move/14/" + ], }, }, }, @@ -1441,16 +1478,22 @@ class StatDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["change", "move"], "properties": { - "change": {"type": "integer", "format": "int32", "examples": [ 5 ]}, + "change": { + "type": "integer", + "format": "int32", + "examples": [5], + }, "move": { "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "examples": [ "growl" ]}, + "name": {"type": "string", "examples": ["growl"]}, "url": { "type": "string", "format": "uri", - "examples": [ "https://pokeapi.co/api/v2/move/45/" ], + "examples": [ + "https://pokeapi.co/api/v2/move/45/" + ], }, }, }, @@ -1487,11 +1530,11 @@ class StatDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "examples": [ "lonely" ]}, + "name": {"type": "string", "examples": ["lonely"]}, "url": { "type": "string", "format": "uri", - "examples": [ "https://pokeapi.co/api/v2/nature/6/" ], + "examples": ["https://pokeapi.co/api/v2/nature/6/"], }, }, }, @@ -1502,11 +1545,11 @@ class StatDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "examples": [ "bold" ]}, + "name": {"type": "string", "examples": ["bold"]}, "url": { "type": "string", "format": "uri", - "examples": [ "https://pokeapi.co/api/v2/nature/2/" ], + "examples": ["https://pokeapi.co/api/v2/nature/2/"], }, }, }, @@ -1615,11 +1658,11 @@ class ItemAttributeDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "examples": [ "master-ball" ]}, + "name": {"type": "string", "examples": ["master-ball"]}, "url": { "type": "string", "format": "uri", - "examples": [ "https://pokeapi.co/api/v2/item/1/" ], + "examples": ["https://pokeapi.co/api/v2/item/1/"], }, }, }, @@ -1751,17 +1794,19 @@ class ItemDetailSerializer(serializers.ModelSerializer): "machine": { "type": "string", "format": "uri", - "examples": [ "https://pokeapi.co/api/v2/machine/1/" ], + "examples": ["https://pokeapi.co/api/v2/machine/1/"], }, "version_group": { "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "examples": [ "sword-shield" ]}, + "name": {"type": "string", "examples": ["sword-shield"]}, "url": { "type": "string", "format": "uri", - "examples": [ "https://pokeapi.co/api/v2/version-group/20/" ], + "examples": [ + "https://pokeapi.co/api/v2/version-group/20/" + ], }, }, }, @@ -1797,7 +1842,9 @@ class ItemDetailSerializer(serializers.ModelSerializer): "default": { "type": "string", "format": "uri", - "examples": [ "https://pokeapi.co/media/sprites/items/master-ball.png" ], + "examples": [ + "https://pokeapi.co/media/sprites/items/master-ball.png" + ], } }, } @@ -1813,11 +1860,11 @@ class ItemDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "examples": [ "countable" ]}, + "name": {"type": "string", "examples": ["countable"]}, "url": { "type": "string", "format": "uri", - "examples": [ "https://pokeapi.co/api/v2/item-attribute/1/" ], + "examples": ["https://pokeapi.co/api/v2/item-attribute/1/"], }, }, }, @@ -1851,11 +1898,11 @@ class ItemDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "examples": [ "farfetchd" ]}, + "name": {"type": "string", "examples": ["farfetchd"]}, "url": { "type": "string", "format": "uri", - "examples": [ "https://pokeapi.co/api/v2/pokemon/83/" ], + "examples": ["https://pokeapi.co/api/v2/pokemon/83/"], }, }, }, @@ -1865,16 +1912,25 @@ class ItemDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["rarity", "version"], "properties": { - "rarity": {"type": "integer", "format": "int32", "examples": [ 5 ]}, + "rarity": { + "type": "integer", + "format": "int32", + "examples": [5], + }, "version": { "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "examples": [ "ruby" ]}, + "name": { + "type": "string", + "examples": ["ruby"], + }, "url": { "type": "string", "format": "uri", - "examples": [ "https://pokeapi.co/api/v2/version/7/" ], + "examples": [ + "https://pokeapi.co/api/v2/version/7/" + ], }, }, }, @@ -1925,7 +1981,7 @@ class ItemDetailSerializer(serializers.ModelSerializer): "url": { "type": "string", "format": "uri", - "examples": [ "https://pokeapi.co/api/v2/evolution-chain/51/" ], + "examples": ["https://pokeapi.co/api/v2/evolution-chain/51/"], } }, } @@ -2001,16 +2057,22 @@ class NatureDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["max_change", "pokeathlon_stat"], "properties": { - "max_change": {"type": "integer", "format": "int32", "examples": [ 1 ]}, + "max_change": { + "type": "integer", + "format": "int32", + "examples": [1], + }, "pokeathlon_stat": { "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "examples": [ "power" ]}, + "name": {"type": "string", "examples": ["power"]}, "url": { "type": "string", "format": "uri", - "examples": [ "https://pokeapi.co/api/v2/pokeathlon-stat/2/" ], + "examples": [ + "https://pokeapi.co/api/v2/pokeathlon-stat/2/" + ], }, }, }, @@ -2080,7 +2142,7 @@ class BerryFlavorDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["potency", "berry"], "properties": { - "potency": {"type": "integer", "examples": [ 10 ]}, + "potency": {"type": "integer", "examples": [10]}, "berry": { "type": "object", "require": ["name", "url"], @@ -2088,13 +2150,13 @@ class BerryFlavorDetailSerializer(serializers.ModelSerializer): "name": { "type": "string", "description": "The name of the berry", - "examples": [ "rowap" ], + "examples": ["rowap"], }, "url": { "type": "string", "format": "uri", "description": "The URL to get more information about the berry", - "examples": [ "https://pokeapi.co/api/v2/berry/64/" ], + "examples": ["https://pokeapi.co/api/v2/berry/64/"], }, }, }, @@ -2146,7 +2208,7 @@ class BerryDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["potency", "flavor"], "properties": { - "potency": {"type": "integer", "examples": [ 10 ]}, + "potency": {"type": "integer", "examples": [10]}, "flavor": { "type": "object", "require": ["name", "url"], @@ -2154,13 +2216,15 @@ class BerryDetailSerializer(serializers.ModelSerializer): "name": { "type": "string", "description": "The name of the flavor", - "examples": [ "spicy" ], + "examples": ["spicy"], }, "url": { "type": "string", "format": "uri", "description": "The URL to get more information about the flavor", - "examples": [ "https://pokeapi.co/api/v2/berry-flavor/1/" ], + "examples": [ + "https://pokeapi.co/api/v2/berry-flavor/1/" + ], }, }, }, @@ -2220,13 +2284,13 @@ class EggGroupDetailSerializer(serializers.ModelSerializer): "name": { "type": "string", "description": "Pokemon species name.", - "examples": [ "bulbasaur" ], + "examples": ["bulbasaur"], }, "url": { "type": "string", "format": "uri", "description": "The URL to get more information about the species", - "examples": [ "https://pokeapi.co/api/v2/pokemon-species/1/" ], + "examples": ["https://pokeapi.co/api/v2/pokemon-species/1/"], }, }, }, @@ -2344,11 +2408,11 @@ class TypeDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "examples": [ "flying" ]}, + "name": {"type": "string", "examples": ["flying"]}, "url": { "type": "string", "format": "uri", - "examples": [ "https://pokeapi.co/api/v2/type/3/" ], + "examples": ["https://pokeapi.co/api/v2/type/3/"], }, }, }, @@ -2359,11 +2423,11 @@ class TypeDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "examples": [ "bug" ]}, + "name": {"type": "string", "examples": ["bug"]}, "url": { "type": "string", "format": "uri", - "examples": [ "https://pokeapi.co/api/v2/type/7/" ], + "examples": ["https://pokeapi.co/api/v2/type/7/"], }, }, }, @@ -2374,11 +2438,11 @@ class TypeDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "examples": [ "poison" ]}, + "name": {"type": "string", "examples": ["poison"]}, "url": { "type": "string", "format": "uri", - "examples": [ "https://pokeapi.co/api/v2/type/4/" ], + "examples": ["https://pokeapi.co/api/v2/type/4/"], }, }, }, @@ -2389,11 +2453,11 @@ class TypeDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "examples": [ "electric" ]}, + "name": {"type": "string", "examples": ["electric"]}, "url": { "type": "string", "format": "uri", - "examples": [ "https://pokeapi.co/api/v2/type/13/" ], + "examples": ["https://pokeapi.co/api/v2/type/13/"], }, }, }, @@ -2404,11 +2468,11 @@ class TypeDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "examples": [ "poison" ]}, + "name": {"type": "string", "examples": ["poison"]}, "url": { "type": "string", "format": "uri", - "examples": [ "https://pokeapi.co/api/v2/type/4/" ], + "examples": ["https://pokeapi.co/api/v2/type/4/"], }, }, }, @@ -2419,11 +2483,11 @@ class TypeDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "examples": [ "water" ]}, + "name": {"type": "string", "examples": ["water"]}, "url": { "type": "string", "format": "uri", - "examples": [ "https://pokeapi.co/api/v2/type/11/" ], + "examples": ["https://pokeapi.co/api/v2/type/11/"], }, }, }, @@ -2506,11 +2570,11 @@ class TypeDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "examples": [ "generation-v" ]}, + "name": {"type": "string", "examples": ["generation-v"]}, "url": { "type": "string", "format": "uri", - "examples": [ "https://pokeapi.co/api/v2/generation/5/" ], + "examples": ["https://pokeapi.co/api/v2/generation/5/"], }, }, }, @@ -2531,11 +2595,16 @@ class TypeDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "examples": [ "flying" ]}, + "name": { + "type": "string", + "examples": ["flying"], + }, "url": { "type": "string", "format": "uri", - "examples": [ "https://pokeapi.co/api/v2/type/3/" ], + "examples": [ + "https://pokeapi.co/api/v2/type/3/" + ], }, }, }, @@ -2546,11 +2615,13 @@ class TypeDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "examples": [ "bug" ]}, + "name": {"type": "string", "examples": ["bug"]}, "url": { "type": "string", "format": "uri", - "examples": [ "https://pokeapi.co/api/v2/type/7/" ], + "examples": [ + "https://pokeapi.co/api/v2/type/7/" + ], }, }, }, @@ -2561,11 +2632,16 @@ class TypeDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "examples": [ "poison" ]}, + "name": { + "type": "string", + "examples": ["poison"], + }, "url": { "type": "string", "format": "uri", - "examples": [ "https://pokeapi.co/api/v2/type/4/" ], + "examples": [ + "https://pokeapi.co/api/v2/type/4/" + ], }, }, }, @@ -2578,12 +2654,14 @@ class TypeDetailSerializer(serializers.ModelSerializer): "properties": { "name": { "type": "string", - "examples": [ "electric" ], + "examples": ["electric"], }, "url": { "type": "string", "format": "uri", - "examples": [ "https://pokeapi.co/api/v2/type/13/" ], + "examples": [ + "https://pokeapi.co/api/v2/type/13/" + ], }, }, }, @@ -2594,11 +2672,16 @@ class TypeDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "examples": [ "poison" ]}, + "name": { + "type": "string", + "examples": ["poison"], + }, "url": { "type": "string", "format": "uri", - "examples": [ "https://pokeapi.co/api/v2/type/4/" ], + "examples": [ + "https://pokeapi.co/api/v2/type/4/" + ], }, }, }, @@ -2609,11 +2692,16 @@ class TypeDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "examples": [ "water" ]}, + "name": { + "type": "string", + "examples": ["water"], + }, "url": { "type": "string", "format": "uri", - "examples": [ "https://pokeapi.co/api/v2/type/11/" ], + "examples": [ + "https://pokeapi.co/api/v2/type/11/" + ], }, }, }, @@ -2725,7 +2813,7 @@ class TypeDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["potency", "flavor"], "properties": { - "slot": {"type": "integer", "examples": [ 1 ]}, + "slot": {"type": "integer", "examples": [1]}, "pokemon": { "type": "object", "require": ["name", "url"], @@ -2733,13 +2821,13 @@ class TypeDetailSerializer(serializers.ModelSerializer): "name": { "type": "string", "description": "The name of the pokemon", - "examples": [ "sandshrew" ], + "examples": ["sandshrew"], }, "url": { "type": "string", "format": "uri", "description": "The URL to get more information about the pokemon", - "examples": [ "https://pokeapi.co/api/v2/pokemon/27/" ], + "examples": ["https://pokeapi.co/api/v2/pokemon/27/"], }, }, }, @@ -2860,11 +2948,11 @@ class MoveMetaAilmentDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "examples": [ "thunder-punch" ]}, + "name": {"type": "string", "examples": ["thunder-punch"]}, "url": { "type": "string", "format": "uri", - "examples": [ "https://pokeapi.co/api/v2/move/9/" ], + "examples": ["https://pokeapi.co/api/v2/move/9/"], }, }, }, @@ -2907,11 +2995,11 @@ class MoveMetaCategoryDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "examples": [ "sing" ]}, + "name": {"type": "string", "examples": ["sing"]}, "url": { "type": "string", "format": "uri", - "examples": [ "https://pokeapi.co/api/v2/move/47/" ], + "examples": ["https://pokeapi.co/api/v2/move/47/"], }, }, }, @@ -3020,21 +3108,25 @@ class MoveChangeSerializer(serializers.ModelSerializer): "properties": { "effect": { "type": "string", - "examples": [ "Inflicts [regular damage]{mechanic:regular-damage}." ], + "examples": [ + "Inflicts [regular damage]{mechanic:regular-damage}." + ], }, "short_effect": { "type": "string", - "examples": [ "Inflicts regular damage with no additional effect." ], + "examples": [ + "Inflicts regular damage with no additional effect." + ], }, "language": { "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "examples": [ "en" ]}, + "name": {"type": "string", "examples": ["en"]}, "url": { "type": "string", "format": "uri", - "examples": [ "https://pokeapi.co/api/v2/language/9/" ], + "examples": ["https://pokeapi.co/api/v2/language/9/"], }, }, }, @@ -3146,11 +3238,11 @@ class MoveDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "examples": [ "clefairy" ]}, + "name": {"type": "string", "examples": ["clefairy"]}, "url": { "type": "string", "format": "uri", - "examples": [ "https://pokeapi.co/api/v2/pokemon/35/" ], + "examples": ["https://pokeapi.co/api/v2/pokemon/35/"], }, }, }, @@ -3187,7 +3279,7 @@ class MoveDetailSerializer(serializers.ModelSerializer): "url": { "type": "string", "format": "uri", - "examples": [ "https://pokeapi.co/api/v2/machine/1/" ], + "examples": ["https://pokeapi.co/api/v2/machine/1/"], } }, }, @@ -3195,11 +3287,13 @@ class MoveDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "examples": [ "sword-shield" ]}, + "name": {"type": "string", "examples": ["sword-shield"]}, "url": { "type": "string", "format": "uri", - "examples": [ "https://pokeapi.co/api/v2/version-group/1/" ], + "examples": [ + "https://pokeapi.co/api/v2/version-group/1/" + ], }, }, }, @@ -3243,11 +3337,16 @@ class MoveDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "examples": [ "fire-punch" ]}, + "name": { + "type": "string", + "examples": ["fire-punch"], + }, "url": { "type": "string", "format": "uri", - "examples": [ "https://pokeapi.co/api/v2/move/7/" ], + "examples": [ + "https://pokeapi.co/api/v2/move/7/" + ], }, }, }, @@ -3259,11 +3358,16 @@ class MoveDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "examples": [ "ice-punch" ]}, + "name": { + "type": "string", + "examples": ["ice-punch"], + }, "url": { "type": "string", "format": "uri", - "examples": [ "https://pokeapi.co/api/v2/move/8/" ], + "examples": [ + "https://pokeapi.co/api/v2/move/8/" + ], }, }, }, @@ -3283,12 +3387,14 @@ class MoveDetailSerializer(serializers.ModelSerializer): "properties": { "name": { "type": "string", - "examples": [ "night-slash" ], + "examples": ["night-slash"], }, "url": { "type": "string", "format": "uri", - "examples": [ "https://pokeapi.co/api/v2/move/400/" ], + "examples": [ + "https://pokeapi.co/api/v2/move/400/" + ], }, }, }, @@ -3302,12 +3408,14 @@ class MoveDetailSerializer(serializers.ModelSerializer): "properties": { "name": { "type": "string", - "examples": [ "focus-energy" ], + "examples": ["focus-energy"], }, "url": { "type": "string", "format": "uri", - "examples": [ "https://pokeapi.co/api/v2/move/116/" ], + "examples": [ + "https://pokeapi.co/api/v2/move/116/" + ], }, }, }, @@ -3383,21 +3491,25 @@ class MoveDetailSerializer(serializers.ModelSerializer): "properties": { "effect": { "type": "string", - "examples": [ "Inflicts [regular damage]{mechanic:regular-damage}." ], + "examples": [ + "Inflicts [regular damage]{mechanic:regular-damage}." + ], }, "short_effect": { "type": "string", - "examples": [ "Inflicts regular damage with no additional effect." ], + "examples": [ + "Inflicts regular damage with no additional effect." + ], }, "language": { "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "examples": [ "en" ]}, + "name": {"type": "string", "examples": ["en"]}, "url": { "type": "string", "format": "uri", - "examples": [ "https://pokeapi.co/api/v2/language/9/" ], + "examples": ["https://pokeapi.co/api/v2/language/9/"], }, }, }, @@ -3434,17 +3546,21 @@ class MoveDetailSerializer(serializers.ModelSerializer): "properties": { "effect": { "type": "string", - "examples": [ "Hits Pokémon under the effects of dig and fly." ], + "examples": [ + "Hits Pokémon under the effects of dig and fly." + ], }, "language": { "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "examples": [ "en" ]}, + "name": {"type": "string", "examples": ["en"]}, "url": { "type": "string", "format": "uri", - "examples": [ "https://pokeapi.co/api/v2/language/9/" ], + "examples": [ + "https://pokeapi.co/api/v2/language/9/" + ], }, }, }, @@ -3455,11 +3571,13 @@ class MoveDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "examples": [ "gold-silver" ]}, + "name": {"type": "string", "examples": ["gold-silver"]}, "url": { "type": "string", "format": "uri", - "examples": [ "https://pokeapi.co/api/v2/version-group/3/" ], + "examples": [ + "https://pokeapi.co/api/v2/version-group/3/" + ], }, }, }, @@ -3482,16 +3600,16 @@ class MoveDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["change", "stat"], "properties": { - "change": {"type": "integer", "format": "int32", "examples": [ 2 ]}, + "change": {"type": "integer", "format": "int32", "examples": [2]}, "stat": { "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "examples": [ "attack" ]}, + "name": {"type": "string", "examples": ["attack"]}, "url": { "type": "string", "format": "uri", - "examples": [ "https://pokeapi.co/api/v2/stat/1/" ], + "examples": ["https://pokeapi.co/api/v2/stat/1/"], }, }, }, @@ -3550,20 +3668,26 @@ class PalParkAreaDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["base_score", "pokemon-species", "rate"], "properties": { - "base_score": {"type": "integer", "format": "int32", "examples": [ 50 ]}, + "base_score": { + "type": "integer", + "format": "int32", + "examples": [50], + }, "pokemon-species": { "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "examples": [ "bulbasaur" ]}, + "name": {"type": "string", "examples": ["bulbasaur"]}, "url": { "type": "string", "format": "uri", - "examples": [ "https://pokeapi.co/api/v2/pokemon-species/1/" ], + "examples": [ + "https://pokeapi.co/api/v2/pokemon-species/1/" + ], }, }, }, - "rate": {"type": "integer", "format": "int32", "examples": [ 30 ]}, + "rate": {"type": "integer", "format": "int32", "examples": [30]}, }, }, } @@ -3663,15 +3787,15 @@ class PokemonFormDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "examples": [ "en" ]}, + "name": {"type": "string", "examples": ["en"]}, "url": { "type": "string", "format": "uri", - "examples": [ "https://pokeapi.co/api/v2/language/9/" ], + "examples": ["https://pokeapi.co/api/v2/language/9/"], }, }, }, - "name": {"type": "string", "examples": [ "Plant Cloak" ]}, + "name": {"type": "string", "examples": ["Plant Cloak"]}, }, }, } @@ -3702,15 +3826,15 @@ class PokemonFormDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "examples": [ "en" ]}, + "name": {"type": "string", "examples": ["en"]}, "url": { "type": "string", "format": "uri", - "examples": [ "https://pokeapi.co/api/v2/language/9/" ], + "examples": ["https://pokeapi.co/api/v2/language/9/"], }, }, }, - "name": {"type": "string", "examples": [ "Plant Cloak" ]}, + "name": {"type": "string", "examples": ["Plant Cloak"]}, }, }, } @@ -3738,25 +3862,31 @@ class PokemonFormDetailSerializer(serializers.ModelSerializer): "default": { "type": "string", "format": "uri", - "examples": [ "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/412.png" ], + "examples": [ + "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/412.png" + ], } }, "additionalProperties": { # Stoplight Elements doesn't render this well "type": "string", "format": "uri", "nullable": True, - "examples": [ "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/shiny/412.png" ], + "examples": [ + "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/shiny/412.png" + ], }, - "examples": [ { - "back_default": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/412.png", - "back_female": None, - "back_shiny": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/shiny/412.png", - "back_shiny_female": None, - "front_default": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/412.png", - "front_female": None, - "front_shiny": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/shiny/412.png", - "front_shiny_female": None, - } ], + "examples": [ + { + "back_default": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/412.png", + "back_female": None, + "back_shiny": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/shiny/412.png", + "back_shiny_female": None, + "front_default": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/412.png", + "front_female": None, + "front_shiny": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/shiny/412.png", + "front_shiny_female": None, + } + ], } ) def get_pokemon_form_sprites(self, obj): @@ -3770,16 +3900,16 @@ class PokemonFormDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["slot", "type"], "properties": { - "slot": {"type": "integer", "format": "int32", "examples": [ 1 ]}, + "slot": {"type": "integer", "format": "int32", "examples": [1]}, "type": { "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "examples": [ "bug" ]}, + "name": {"type": "string", "examples": ["bug"]}, "url": { "type": "string", "format": "uri", - "examples": [ "https://pokeapi.co/api/v2/type/7/" ], + "examples": ["https://pokeapi.co/api/v2/type/7/"], }, }, }, @@ -3883,11 +4013,11 @@ class MoveLearnMethodDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "examples": [ "red-blue" ]}, + "name": {"type": "string", "examples": ["red-blue"]}, "url": { "type": "string", "format": "uri", - "examples": [ "https://pokeapi.co/api/v2/version-group/1/" ], + "examples": ["https://pokeapi.co/api/v2/version-group/1/"], }, }, }, @@ -3947,9 +4077,9 @@ class PokemonShapeDetailSerializer(serializers.ModelSerializer): "url": { "type": "string", "format": "uri", - "examples": [ "https://pokeapi.co/api/v2/language/9/" ], + "examples": ["https://pokeapi.co/api/v2/language/9/"], }, - "name": {"type": "string", "examples": [ "Ball" ]}, + "name": {"type": "string", "examples": ["Ball"]}, }, }, } @@ -3989,16 +4119,16 @@ class PokemonShapeDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["awesome_name", "language"], "properties": { - "awesome_name": {"type": "string", "examples": [ "Pomaceous" ]}, + "awesome_name": {"type": "string", "examples": ["Pomaceous"]}, "language": { "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "examples": [ "en" ]}, + "name": {"type": "string", "examples": ["en"]}, "url": { "type": "string", "format": "uri", - "examples": [ "https://pokeapi.co/api/v2/language/9/" ], + "examples": ["https://pokeapi.co/api/v2/language/9/"], }, }, }, @@ -4113,18 +4243,22 @@ class PokemonDetailSerializer(serializers.ModelSerializer): "type": "string", "format": "uri", "nullable": True, - "examples": [ "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/shiny/1.png" ], + "examples": [ + "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/shiny/1.png" + ], }, - "examples": [ { - "back_default": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/1.png", - "back_female": None, - "back_shiny": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/shiny/1.png", - "back_shiny_female": None, - "front_default": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/1.png", - "front_female": None, - "front_shiny": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/shiny/1.png", - "front_shiny_female": None, - } ], + "examples": [ + { + "back_default": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/1.png", + "back_female": None, + "back_shiny": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/shiny/1.png", + "back_shiny_female": None, + "front_default": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/1.png", + "front_female": None, + "front_shiny": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/shiny/1.png", + "front_shiny_female": None, + } + ], } ) def get_pokemon_sprites(self, obj): @@ -4139,12 +4273,16 @@ class PokemonDetailSerializer(serializers.ModelSerializer): "latest": { "type": "string", "format": "uri", - "examples": [ "https://raw.githubusercontent.com/PokeAPI/cries/main/cries/pokemon/latest/50.ogg" ], + "examples": [ + "https://raw.githubusercontent.com/PokeAPI/cries/main/cries/pokemon/latest/50.ogg" + ], }, "legacy": { "type": "string", "format": "uri", - "examples": [ "https://raw.githubusercontent.com/PokeAPI/cries/main/cries/pokemon/legacy/50.ogg" ], + "examples": [ + "https://raw.githubusercontent.com/PokeAPI/cries/main/cries/pokemon/legacy/50.ogg" + ], }, }, } @@ -4431,11 +4569,11 @@ class PokemonDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "examples": [ "scratch" ]}, + "name": {"type": "string", "examples": ["scratch"]}, "url": { "type": "string", "format": "uri", - "examples": [ "https://pokeapi.co/api/v2/move/10/" ], + "examples": ["https://pokeapi.co/api/v2/move/10/"], }, }, }, @@ -4449,19 +4587,25 @@ class PokemonDetailSerializer(serializers.ModelSerializer): "version_group", ], "properties": { - "level_learned_at": {"type": "integer", "format": "int32", "examples": [ 1 ]}, + "level_learned_at": { + "type": "integer", + "format": "int32", + "examples": [1], + }, "move_learn_method": { "type": "object", "required": ["name", "url"], "properties": { "name": { "type": "string", - "examples": [ "level-up" ], + "examples": ["level-up"], }, "url": { "type": "string", "format": "uri", - "examples": [ "https://pokeapi.co/api/v2/move-learn-method/1/" ], + "examples": [ + "https://pokeapi.co/api/v2/move-learn-method/1/" + ], }, }, }, @@ -4471,12 +4615,14 @@ class PokemonDetailSerializer(serializers.ModelSerializer): "properties": { "name": { "type": "string", - "examples": [ "red-blue" ], + "examples": ["red-blue"], }, "url": { "type": "string", "format": "uri", - "examples": [ "https://pokeapi.co/api/v2/version-group/1/" ], + "examples": [ + "https://pokeapi.co/api/v2/version-group/1/" + ], }, }, }, @@ -4560,11 +4706,11 @@ class PokemonDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "examples": [ "soft-sand" ]}, + "name": {"type": "string", "examples": ["soft-sand"]}, "url": { "type": "string", "format": "uri", - "examples": [ "https://pokeapi.co/api/v2/item/214/" ], + "examples": ["https://pokeapi.co/api/v2/item/214/"], }, }, }, @@ -4574,16 +4720,22 @@ class PokemonDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["rarity", "version"], "properties": { - "rarity": {"type": "integer", "format": "int32", "examples": [ 5 ]}, + "rarity": { + "type": "integer", + "format": "int32", + "examples": [5], + }, "version": { "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "examples": [ "diamond" ]}, + "name": {"type": "string", "examples": ["diamond"]}, "url": { "type": "string", "format": "uri", - "examples": [ "https://pokeapi.co/api/v2/version/12/" ], + "examples": [ + "https://pokeapi.co/api/v2/version/12/" + ], }, }, }, @@ -4645,16 +4797,16 @@ class PokemonDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "examples": [ "sand-veil" ]}, + "name": {"type": "string", "examples": ["sand-veil"]}, "url": { "type": "string", "format": "uri", - "examples": [ "https://pokeapi.co/api/v2/ability/8/" ], + "examples": ["https://pokeapi.co/api/v2/ability/8/"], }, }, }, "is_hidden": {"type": "boolean"}, - "slot": {"type": "integer", "format": "int32", "examples": [ 1 ]}, + "slot": {"type": "integer", "format": "int32", "examples": [1]}, }, }, } @@ -4707,17 +4859,23 @@ class PokemonDetailSerializer(serializers.ModelSerializer): "properties": { "name": { "type": "string", - "examples": [ "levitate" ], + "examples": ["levitate"], }, "url": { "type": "string", "format": "uri", - "examples": [ "https://pokeapi.co/api/v2/ability/26/" ], + "examples": [ + "https://pokeapi.co/api/v2/ability/26/" + ], }, }, }, "is_hidden": {"type": "boolean"}, - "slot": {"type": "integer", "format": "int32", "examples": [ 1 ]}, + "slot": { + "type": "integer", + "format": "int32", + "examples": [1], + }, }, }, }, @@ -4725,11 +4883,11 @@ class PokemonDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "examples": [ "generation-vi" ]}, + "name": {"type": "string", "examples": ["generation-vi"]}, "url": { "type": "string", "format": "uri", - "examples": [ "https://pokeapi.co/api/v2/generation/6/" ], + "examples": ["https://pokeapi.co/api/v2/generation/6/"], }, }, }, @@ -4786,16 +4944,16 @@ class PokemonDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["slot", "type"], "properties": { - "slot": {"type": "integer", "format": "int32", "examples": [ 1 ]}, + "slot": {"type": "integer", "format": "int32", "examples": [1]}, "type": { "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "examples": [ "ghost" ]}, + "name": {"type": "string", "examples": ["ghost"]}, "url": { "type": "string", "format": "uri", - "examples": [ "https://pokeapi.co/api/v2/type/8/" ], + "examples": ["https://pokeapi.co/api/v2/type/8/"], }, }, }, @@ -4842,11 +5000,11 @@ class PokemonDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "examples": [ "generation-v" ]}, + "name": {"type": "string", "examples": ["generation-v"]}, "url": { "type": "string", "format": "uri", - "examples": [ "https://pokeapi.co/api/v2/generation/5/" ], + "examples": ["https://pokeapi.co/api/v2/generation/5/"], }, }, }, @@ -4856,16 +5014,25 @@ class PokemonDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["slot", "type"], "properties": { - "slot": {"type": "integer", "format": "int32", "examples": [ 1 ]}, + "slot": { + "type": "integer", + "format": "int32", + "examples": [1], + }, "type": { "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "examples": [ "normal" ]}, + "name": { + "type": "string", + "examples": ["normal"], + }, "url": { "type": "string", "format": "uri", - "examples": [ "https://pokeapi.co/api/v2/type/1/" ], + "examples": [ + "https://pokeapi.co/api/v2/type/1/" + ], }, }, }, @@ -4914,7 +5081,7 @@ class PokemonDetailSerializer(serializers.ModelSerializer): @extend_schema_field( field={ "type": "string", - "examples": [ "https://pokeapi.co/api/v2/pokemon/1/encounters" ], + "examples": ["https://pokeapi.co/api/v2/pokemon/1/encounters"], } ) def get_encounters(self, obj): @@ -4949,11 +5116,11 @@ class EvolutionTriggerDetailSerializer(serializers.HyperlinkedModelSerializer): "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "examples": [ "ivysaur" ]}, + "name": {"type": "string", "examples": ["ivysaur"]}, "url": { "type": "string", "format": "uri", - "examples": [ "https://pokeapi.co/api/v2/pokemon-species/2/" ], + "examples": ["https://pokeapi.co/api/v2/pokemon-species/2/"], }, }, }, @@ -5077,15 +5244,15 @@ class PokemonSpeciesDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "examples": [ "en" ]}, + "name": {"type": "string", "examples": ["en"]}, "url": { "type": "string", "format": "uri", - "examples": [ "https://pokeapi.co/api/v2/language/9/" ], + "examples": ["https://pokeapi.co/api/v2/language/9/"], }, }, }, - "name": {"type": "string", "examples": [ "bulbasaur" ]}, + "name": {"type": "string", "examples": ["bulbasaur"]}, }, }, } @@ -5117,16 +5284,16 @@ class PokemonSpeciesDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["genus", "language"], "properties": { - "genus": {"type": "string", "examples": [ "Seed Pokémon" ]}, + "genus": {"type": "string", "examples": ["Seed Pokémon"]}, "language": { "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "examples": [ "en" ]}, + "name": {"type": "string", "examples": ["en"]}, "url": { "type": "string", "format": "uri", - "examples": [ "https://pokeapi.co/api/v2/language/9/" ], + "examples": ["https://pokeapi.co/api/v2/language/9/"], }, }, }, @@ -5156,11 +5323,11 @@ class PokemonSpeciesDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "examples": [ "monster" ]}, + "name": {"type": "string", "examples": ["monster"]}, "url": { "type": "string", "format": "uri", - "examples": [ "https://pokeapi.co/api/v2/egg-group/1/" ], + "examples": ["https://pokeapi.co/api/v2/egg-group/1/"], }, }, }, @@ -5187,11 +5354,11 @@ class PokemonSpeciesDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "examples": [ "bulbasaur" ]}, + "name": {"type": "string", "examples": ["bulbasaur"]}, "url": { "type": "string", "format": "uri", - "examples": [ "https://pokeapi.co/api/v2/pokemon/1/" ], + "examples": ["https://pokeapi.co/api/v2/pokemon/1/"], }, }, }, @@ -5229,16 +5396,22 @@ class PokemonSpeciesDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "examples": [ "field" ]}, + "name": {"type": "string", "examples": ["field"]}, "url": { "type": "string", "format": "uri", - "examples": [ "https://pokeapi.co/api/v2/pal-park-area/2/" ], + "examples": [ + "https://pokeapi.co/api/v2/pal-park-area/2/" + ], }, }, }, - "base_score": {"type": "integer", "format": "int32", "examples": [ 50 ]}, - "rate": {"type": "integer", "format": "int32", "examples": [ 30 ]}, + "base_score": { + "type": "integer", + "format": "int32", + "examples": [50], + }, + "rate": {"type": "integer", "format": "int32", "examples": [30]}, }, }, } @@ -5351,12 +5524,12 @@ class EvolutionChainDetailSerializer(serializers.ModelSerializer): "properties": { "name": { "type": "string", - "examples": [ 1 ], + "examples": [1], }, "url": { "type": "string", "format": "uri", - "examples": [ 2 ], + "examples": [2], }, }, }, @@ -5367,12 +5540,12 @@ class EvolutionChainDetailSerializer(serializers.ModelSerializer): "properties": { "name": { "type": "string", - "examples": [ 1 ], + "examples": [1], }, "url": { "type": "string", "format": "uri", - "examples": [ 2 ], + "examples": [2], }, }, }, @@ -5383,12 +5556,12 @@ class EvolutionChainDetailSerializer(serializers.ModelSerializer): "properties": { "name": { "type": "string", - "examples": [ 1 ], + "examples": [1], }, "url": { "type": "string", "format": "uri", - "examples": [ 2 ], + "examples": [2], }, }, }, @@ -5415,19 +5588,23 @@ class EvolutionChainDetailSerializer(serializers.ModelSerializer): }, }, "min_affection": { - "type": "integer", "format": "int32", + "type": "integer", + "format": "int32", "nullable": True, }, "min_beauty": { - "type": "integer", "format": "int32", + "type": "integer", + "format": "int32", "nullable": True, }, "min_happiness": { - "type": "integer", "format": "int32", + "type": "integer", + "format": "int32", "nullable": True, }, "min_level": { - "type": "integer", "format": "int32", + "type": "integer", + "format": "int32", "nullable": True, }, "needs_overworld_rain": { @@ -5473,11 +5650,13 @@ class EvolutionChainDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "examples": [ "happiny" ]}, + "name": {"type": "string", "examples": ["happiny"]}, "url": { "type": "string", "format": "uri", - "examples": [ "https://pokeapi.co/api/v2/pokemon-species/440/" ], + "examples": [ + "https://pokeapi.co/api/v2/pokemon-species/440/" + ], }, }, }, @@ -5489,11 +5668,13 @@ class EvolutionChainDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "examples": [ "happiny" ]}, + "name": {"type": "string", "examples": ["happiny"]}, "url": { "type": "string", "format": "uri", - "examples": [ "https://pokeapi.co/api/v2/pokemon-species/440/" ], + "examples": [ + "https://pokeapi.co/api/v2/pokemon-species/440/" + ], }, }, }, @@ -5624,19 +5805,22 @@ class PokeathlonStatDetailSerializer(serializers.HyperlinkedModelSerializer): "required": ["max_change", "nature"], "properties": { "max_change": { - "type": "integer", "format": "int32", + "type": "integer", + "format": "int32", "maximum": -1, - "examples": [ -1 ], + "examples": [-1], }, "nature": { "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "examples": [ "hardy" ]}, + "name": {"type": "string", "examples": ["hardy"]}, "url": { "type": "string", "format": "uri", - "examples": [ "https://pokeapi.co/api/v2/nature/1/" ], + "examples": [ + "https://pokeapi.co/api/v2/nature/1/" + ], }, }, }, @@ -5650,19 +5834,22 @@ class PokeathlonStatDetailSerializer(serializers.HyperlinkedModelSerializer): "required": ["max_change", "nature"], "properties": { "max_change": { - "type": "integer", "format": "int32", + "type": "integer", + "format": "int32", "minimum": 1, - "examples": [ 2 ], + "examples": [2], }, "nature": { "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "examples": [ "hardy" ]}, + "name": {"type": "string", "examples": ["hardy"]}, "url": { "type": "string", "format": "uri", - "examples": [ "https://pokeapi.co/api/v2/nature/1/" ], + "examples": [ + "https://pokeapi.co/api/v2/nature/1/" + ], }, }, }, @@ -5737,16 +5924,22 @@ class PokedexDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["entry_number", "pokemon_species"], "properties": { - "entry_number": {"type": "integer", "format": "int32", "examples": [ 1 ]}, + "entry_number": { + "type": "integer", + "format": "int32", + "examples": [1], + }, "pokemon_species": { "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "examples": [ "bulbasaur" ]}, + "name": {"type": "string", "examples": ["bulbasaur"]}, "url": { "type": "string", "format": "uri", - "examples": [ "https://pokeapi.co/api/v2/pokemon-species/1/" ], + "examples": [ + "https://pokeapi.co/api/v2/pokemon-species/1/" + ], }, }, }, @@ -5775,11 +5968,11 @@ class PokedexDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "examples": [ "the-teal-mask" ]}, + "name": {"type": "string", "examples": ["the-teal-mask"]}, "url": { "type": "string", "format": "uri", - "examples": [ "https://pokeapi.co/api/v2/version-group/26/" ], + "examples": ["https://pokeapi.co/api/v2/version-group/26/"], }, }, }, @@ -5851,11 +6044,11 @@ class VersionGroupDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "examples": [ "kanto" ]}, + "name": {"type": "string", "examples": ["kanto"]}, "url": { "type": "string", "format": "uri", - "examples": [ "https://pokeapi.co/api/v2/region/1/" ], + "examples": ["https://pokeapi.co/api/v2/region/1/"], }, }, }, @@ -5882,11 +6075,11 @@ class VersionGroupDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "examples": [ "level-up" ]}, + "name": {"type": "string", "examples": ["level-up"]}, "url": { "type": "string", "format": "uri", - "examples": [ "https://pokeapi.co/api/v2/move-learn-method/1/" ], + "examples": ["https://pokeapi.co/api/v2/move-learn-method/1/"], }, }, }, @@ -5913,11 +6106,11 @@ class VersionGroupDetailSerializer(serializers.ModelSerializer): "type": "object", "required": ["name", "url"], "properties": { - "name": {"type": "string", "examples": [ "kanto" ]}, + "name": {"type": "string", "examples": ["kanto"]}, "url": { "type": "string", "format": "uri", - "examples": [ "https://pokeapi.co/api/v2/pokedex/2/" ], + "examples": ["https://pokeapi.co/api/v2/pokedex/2/"], }, }, }, From 858604e86378f79ca4e37f236b03358111d24a4f Mon Sep 17 00:00:00 2001 From: Tom Lawrence Date: Mon, 1 Apr 2024 00:46:19 +0100 Subject: [PATCH 49/76] Update pokemon.csv Included missing base_experience values for Gen 8 (#0899-0905) and all of Gen 9 (#0906-1025). --- data/v2/csv/pokemon.csv | 254 ++++++++++++++++++++-------------------- 1 file changed, 127 insertions(+), 127 deletions(-) diff --git a/data/v2/csv/pokemon.csv b/data/v2/csv/pokemon.csv index 46f3675b..2b40b300 100644 --- a/data/v2/csv/pokemon.csv +++ b/data/v2/csv/pokemon.csv @@ -897,133 +897,133 @@ id,identifier,species_id,height,weight,base_experience,order,is_default 896,glastrier,896,22,8000,290,1088,1 897,spectrier,897,20,445,290,1089,1 898,calyrex,898,11,77,250,1090,1 -899,wyrdeer,899,18,951,,,1 -900,kleavor,900,18,890,,,1 -901,ursaluna,901,24,2900,,,1 -902,basculegion-male,902,30,1100,,,1 -903,sneasler,903,13,430,,,1 -904,overqwil,904,25,605,,,1 -905,enamorus-incarnate,905,16,480,,,1 -906,sprigatito,906,4,41,,906,1 -907,floragato,907,9,122,,907,1 -908,meowscarada,908,15,312,,908,1 -909,fuecoco,909,4,98,,909,1 -910,crocalor,910,10,307,,910,1 -911,skeledirge,911,16,3265,,911,1 -912,quaxly,912,5,61,,912,1 -913,quaxwell,913,12,215,,913,1 -914,quaquaval,914,18,619,,914,1 -915,lechonk,915,5,102,,915,1 -916,oinkologne,916,10,1200,,916,1 -917,tarountula,917,3,40,,918,1 -918,spidops,918,10,165,,919,1 -919,nymble,919,2,10,,920,1 -920,lokix,920,10,175,,921,1 -921,pawmi,921,3,25,,954,1 -922,pawmo,922,4,65,,955,1 -923,pawmot,923,9,410,,956,1 -924,tandemaus,924,3,18,,945,1 -925,maushold,925,3,23,,946,1 -926,fidough,926,3,109,,970,1 -927,dachsbun,927,5,149,,971,1 -928,smoliv,928,3,65,,935,1 -929,dolliv,929,6,119,,936,1 -930,arboliva,930,14,482,,937,1 -931,squawkabilly,931,6,24,,960,1 -932,nacli,932,4,160,,963,1 -933,naclstack,933,6,1050,,964,1 -934,garganacl,934,23,2400,,965,1 -935,charcadet,935,6,105,,1003,1 -936,armarouge,936,15,850,,1004,1 -937,ceruledge,937,16,620,,1005,1 -938,tadbulb,938,3,4,,940,1 -939,bellibolt,939,12,1130,,941,1 -940,wattrel,940,4,36,,957,1 -941,kilowattrel,941,14,386,,958,1 -942,maschiff,942,5,160,,972,1 -943,mabosstiff,943,11,610,,973,1 -944,shroodle,944,2,7,,968,1 -945,grafaiai,945,7,272,,969,1 -946,bramblin,946,6,6,,974,1 -947,brambleghast,947,12,60,,975,1 -948,toedscool,948,9,330,,1006,1 -949,toedscruel,949,19,580,,1007,1 -950,klawf,950,13,790,,962,1 -951,capsakid,951,3,30,,938,1 -952,scovillain,952,9,150,,939,1 -953,rellor,953,2,10,,922,1 -954,rabsca,954,3,35,,923,1 -955,flittle,955,2,15,,926,1 -956,espathra,956,19,900,,927,1 -957,tinkatink,957,4,89,,1000,1 -958,tinkatuff,958,7,591,,1001,1 -959,tinkaton,959,7,1128,,1002,1 -960,wiglett,960,12,18,,929,1 -961,wugtrio,961,12,54,,930,1 -962,bombirdier,962,15,429,,959,1 -963,finizen,963,13,602,,933,1 -964,palafin,964,13,602,,934,1 -965,varoom,965,10,350,,942,1 -966,revavroom,966,18,1200,,943,1 -967,cyclizar,967,16,630,,953,1 -968,orthworm,968,25,3100,,944,1 -969,glimmet,969,7,80,,966,1 -970,glimmora,970,15,450,,967,1 -971,greavard,971,6,350,,924,1 -972,houndstone,972,20,150,,925,1 -973,flamigo,973,16,370,,961,1 -974,cetoddle,974,12,450,,947,1 -975,cetitan,975,45,7000,,948,1 -976,veluza,976,25,900,,932,1 -977,dondozo,977,120,2200,,931,1 -978,tatsugiri,978,3,80,,952,1 -979,annihilape,979,12,560,,1010,1 -980,clodsire,980,18,2230,,1009,1 -981,farigiraf,981,32,1600,,928,1 -982,dudunsparce,982,36,392,,917,1 -983,kingambit,983,20,1200,,1008,1 -984,great-tusk,984,22,3200,,978,1 -985,scream-tail,985,12,80,,982,1 -986,brute-bonnet,986,12,210,,979,1 -987,flutter-mane,987,14,40,,983,1 -988,slither-wing,988,32,920,,984,1 -989,sandy-shocks,989,23,600,,981,1 -990,iron-treads,990,9,2400,,986,1 -991,iron-bundle,991,6,110,,992,1 -992,iron-hands,992,18,3807,,989,1 -993,iron-jugulis,993,13,1110,,990,1 -994,iron-moth,994,12,360,,988,1 -995,iron-thorns,995,16,3030,,991,1 -996,frigibax,996,5,170,,949,1 -997,arctibax,997,8,300,,950,1 -998,baxcalibur,998,21,2100,,951,1 -999,gimmighoul,999,3,50,,976,1 -1000,gholdengo,1000,12,300,,977,1 -1001,wo-chien,1001,15,742,,996,1 -1002,chien-pao,1002,19,1522,,995,1 -1003,ting-lu,1003,27,6997,,994,1 -1004,chi-yu,1004,4,49,,997,1 -1005,roaring-moon,1005,20,3800,,985,1 -1006,iron-valiant,1006,14,350,,993,1 -1007,koraidon,1007,25,3030,,998,1 -1008,miraidon,1008,35,2400,,999,1 -1009,walking-wake,1009,35,2800,,1093,1 -1010,iron-leaves,1010,15,1250,,1094,1 -1011,dipplin,1011,4,97,,1095,1 -1012,poltchageist,1012,1,11,,1096,1 -1013,sinistcha,1013,2,22,,1097,1 -1014,okidogi,1014,18,922,,1098,1 -1015,munkidori,1015,10,122,,1099,1 -1016,fezandipiti,1016,14,301,,1100,1 -1017,ogerpon,1017,12,398,,1101,1 -1018,archaludon,1018,20,600,,1102,1 -1019,hydrapple,1019,18,930,,1103,1 -1020,gouging-fire,1020,35,5900,,1104,1 -1021,raging-bolt,1021,52,4800,,1105,1 -1022,iron-boulder,1022,15,1625,,1106,1 -1023,iron-crown,1023,16,1560,,1107,1 -1024,terapagos,1024,2,65,,1108,1 -1025,pecharunt,1025,3,3,,1109,1 +899,wyrdeer,899,18,951,263,,1 +900,kleavor,900,18,890,175,,1 +901,ursaluna,901,24,2900,275,,1 +902,basculegion-male,902,30,1100,265,,1 +903,sneasler,903,13,430,102,,1 +904,overqwil,904,25,605,179,,1 +905,enamorus-incarnate,905,16,480,116,,1 +906,sprigatito,906,4,41,62,906,1 +907,floragato,907,9,122,144,907,1 +908,meowscarada,908,15,312,265,908,1 +909,fuecoco,909,4,98,62,909,1 +910,crocalor,910,10,307,144,910,1 +911,skeledirge,911,16,3265,265,911,1 +912,quaxly,912,5,61,62,912,1 +913,quaxwell,913,12,215,144,913,1 +914,quaquaval,914,18,619,265,914,1 +915,lechonk,915,5,102,51,915,1 +916,oinkologne,916,10,1200,171,916,1 +917,tarountula,917,3,40,42,918,1 +918,spidops,918,10,165,141,919,1 +919,nymble,919,2,10,42,920,1 +920,lokix,920,10,175,158,921,1 +921,pawmi,921,3,25,48,954,1 +922,pawmo,922,4,65,123,955,1 +923,pawmot,923,9,410,245,956,1 +924,tandemaus,924,3,18,61,945,1 +925,maushold,925,3,23,165,946,1 +926,fidough,926,3,109,62,970,1 +927,dachsbun,927,5,149,167,971,1 +928,smoliv,928,3,65,52,935,1 +929,dolliv,929,6,119,124,936,1 +930,arboliva,930,14,482,255,937,1 +931,squawkabilly,931,6,24,146,960,1 +932,nacli,932,4,160,56,963,1 +933,naclstack,933,6,1050,124,964,1 +934,garganacl,934,23,2400,250,965,1 +935,charcadet,935,6,105,51,1003,1 +936,armarouge,936,15,850,263,1004,1 +937,ceruledge,937,16,620,263,1005,1 +938,tadbulb,938,3,4,54,940,1 +939,bellibolt,939,12,1130,173,941,1 +940,wattrel,940,4,36,56,957,1 +941,kilowattrel,941,14,386,172,958,1 +942,maschiff,942,5,160,68,972,1 +943,mabosstiff,943,11,610,177,973,1 +944,shroodle,944,2,7,58,968,1 +945,grafaiai,945,7,272,170,969,1 +946,bramblin,946,6,6,55,974,1 +947,brambleghast,947,12,60,168,975,1 +948,toedscool,948,9,330,67,1006,1 +949,toedscruel,949,19,580,180,1007,1 +950,klawf,950,13,790,158,962,1 +951,capsakid,951,3,30,61,938,1 +952,scovillain,952,9,150,170,939,1 +953,rellor,953,2,10,54,922,1 +954,rabsca,954,3,35,165,923,1 +955,flittle,955,2,15,51,926,1 +956,espathra,956,19,900,168,927,1 +957,tinkatink,957,4,89,59,1000,1 +958,tinkatuff,958,7,591,133,1001,1 +959,tinkaton,959,7,1128,253,1002,1 +960,wiglett,960,12,18,49,929,1 +961,wugtrio,961,12,54,149,930,1 +962,bombirdier,962,15,429,243,959,1 +963,finizen,963,13,602,63,933,1 +964,palafin,964,13,602,160,934,1 +965,varoom,965,10,350,60,942,1 +966,revavroom,966,18,1200,175,943,1 +967,cyclizar,967,16,630,175,953,1 +968,orthworm,968,25,3100,240,944,1 +969,glimmet,969,7,80,70,966,1 +970,glimmora,970,15,450,184,967,1 +971,greavard,971,6,350,58,924,1 +972,houndstone,972,20,150,171,925,1 +973,flamigo,973,16,370,175,961,1 +974,cetoddle,974,12,450,67,947,1 +975,cetitan,975,45,7000,182,948,1 +976,veluza,976,25,900,167,932,1 +977,dondozo,977,120,2200,265,931,1 +978,tatsugiri,978,3,80,166,952,1 +979,annihilape,979,12,560,268,1010,1 +980,clodsire,980,18,2230,151,1009,1 +981,farigiraf,981,32,1600,260,928,1 +982,dudunsparce,982,36,392,182,917,1 +983,kingambit,983,20,1200,275,1008,1 +984,great-tusk,984,22,3200,285,978,1 +985,scream-tail,985,12,80,285,982,1 +986,brute-bonnet,986,12,210,285,979,1 +987,flutter-mane,987,14,40,285,983,1 +988,slither-wing,988,32,920,285,984,1 +989,sandy-shocks,989,23,600,285,981,1 +990,iron-treads,990,9,2400,285,986,1 +991,iron-bundle,991,6,110,285,992,1 +992,iron-hands,992,18,3807,285,989,1 +993,iron-jugulis,993,13,1110,285,990,1 +994,iron-moth,994,12,360,285,988,1 +995,iron-thorns,995,16,3030,285,991,1 +996,frigibax,996,5,170,64,949,1 +997,arctibax,997,8,300,148,950,1 +998,baxcalibur,998,21,2100,300,951,1 +999,gimmighoul,999,3,50,60,976,1 +1000,gholdengo,1000,12,300,275,977,1 +1001,wo-chien,1001,15,742,285,996,1 +1002,chien-pao,1002,19,1522,285,995,1 +1003,ting-lu,1003,27,6997,285,994,1 +1004,chi-yu,1004,4,49,285,997,1 +1005,roaring-moon,1005,20,3800,295,985,1 +1006,iron-valiant,1006,14,350,295,993,1 +1007,koraidon,1007,25,3030,335,998,1 +1008,miraidon,1008,35,2400,335,999,1 +1009,walking-wake,1009,35,2800,295,1093,1 +1010,iron-leaves,1010,15,1250,295,1094,1 +1011,dipplin,1011,4,97,170,1095,1 +1012,poltchageist,1012,1,11,62,1096,1 +1013,sinistcha,1013,2,22,178,1097,1 +1014,okidogi,1014,18,922,278,1098,1 +1015,munkidori,1015,10,122,278,1099,1 +1016,fezandipiti,1016,14,301,278,1100,1 +1017,ogerpon,1017,12,398,275,1101,1 +1018,archaludon,1018,20,600,300,1102,1 +1019,hydrapple,1019,18,930,270,1103,1 +1020,gouging-fire,1020,35,5900,295,1104,1 +1021,raging-bolt,1021,52,4800,295,1105,1 +1022,iron-boulder,1022,15,1625,295,1106,1 +1023,iron-crown,1023,16,1560,295,1107,1 +1024,terapagos,1024,2,65,90,1108,1 +1025,pecharunt,1025,3,3,300,1109,1 10001,deoxys-attack,386,17,608,270,515,0 10002,deoxys-defense,386,17,608,270,516,0 10003,deoxys-speed,386,17,608,270,517,0 From ada1bf6f3fa4c474712af6b255266a5bb1700844 Mon Sep 17 00:00:00 2001 From: Naramsim Date: Mon, 1 Apr 2024 21:13:36 +0200 Subject: [PATCH 50/76] chore: stop redis --- Makefile | 4 ++-- Resources/compose/docker-compose-prod-graphql.yml | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 33d90310..a6b6faec 100755 --- a/Makefile +++ b/Makefile @@ -140,10 +140,10 @@ update-graphql-data-prod: git submodule update --init docker compose stop graphql-engine sync; echo 3 > /proc/sys/vm/drop_caches - docker compose -f docker-compose.yml -f Resources/compose/docker-compose-prod-graphql.yml up -d app + docker compose -f docker-compose.yml -f Resources/compose/docker-compose-prod-graphql.yml up -d app cache make docker-migrate make docker-build-db - docker compose stop app + docker compose stop app cache sync; echo 3 > /proc/sys/vm/drop_caches docker compose exec -T web sh -c 'rm -rf /tmp/cache/*' docker compose start graphql-engine diff --git a/Resources/compose/docker-compose-prod-graphql.yml b/Resources/compose/docker-compose-prod-graphql.yml index 9e868228..d149ecbf 100644 --- a/Resources/compose/docker-compose-prod-graphql.yml +++ b/Resources/compose/docker-compose-prod-graphql.yml @@ -1,5 +1,8 @@ version: '2.4' services: + cache: + restart: "no" + db: environment: POSTGRES_PASSWORD: "${POSTGRES_PASSWORD}" From 7ea210fcfb6b9a3908cf94a50cff70c524cfa230 Mon Sep 17 00:00:00 2001 From: indyandie <1058837+Indyandie@users.noreply.github.com> Date: Fri, 5 Apr 2024 00:24:59 -0500 Subject: [PATCH 51/76] bump: drf-spectacular `0.27.2` --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 7c5ef92e..383b8bbd 100644 --- a/requirements.txt +++ b/requirements.txt @@ -11,4 +11,4 @@ mimeparse==0.1.3 psycopg2-binary==2.9.9 python-dateutil==2.8.2 python-mimeparse==1.6.0 -drf-spectacular==0.27.1 +drf-spectacular==0.27.2 From 26bbfd92a82f5074afe5facd5494bace550ed08b Mon Sep 17 00:00:00 2001 From: chamipon Date: Fri, 5 Apr 2024 15:18:21 -0400 Subject: [PATCH 52/76] Pokemon Species 1009 - 10025 English flavour text --- data/v2/csv/pokemon_species_flavor_text.csv | 36 ++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/data/v2/csv/pokemon_species_flavor_text.csv b/data/v2/csv/pokemon_species_flavor_text.csv index fd832e6f..2bb905db 100644 --- a/data/v2/csv/pokemon_species_flavor_text.csv +++ b/data/v2/csv/pokemon_species_flavor_text.csv @@ -183571,4 +183571,38 @@ gives rise to the budding of fresh life across Hisui." 1007,40,9,"This seems to be the Winged King mentioned in an old expedition journal. It was said to have split the land with its bare fists." 1007,41,9,"This Pokémon resembles Cyclizar, but it is far burlier and more ferocious. Nothing is known about its ecology or other features." 1008,40,9,"Much remains unknown about this creature. It resembles Cyclizar, but it is far more ruthless and powerful." -1008,41,9,"This seems to be the Iron Serpent mentioned in an old book. The Iron Serpent is said to have turned the land to ash with its lightning." \ No newline at end of file +1008,41,9,"This seems to be the Iron Serpent mentioned in an old book. The Iron Serpent is said to have turned the land to ash with its lightning." +1009,40,9,"This ferocious creature is shrouded in mystery. It's named after an aquatic monster mentioned in an old expedition journal." +1009,41,9,"It resembles an illustration published in a paranormal magazine, said to be a depiction of a super-ancient Suicune." +1010,40,9,"Many of its physical characteristics match those of a Virizion from the future that was covered in a paranormal magazine." +1010,41,9,"According to the few eyewitness accounts that exist, it used its shining blades to julienne large trees and boulders." +1011,40,9,"Dipplin is two creatures in one Pokémon. Its evolution was triggered by a special apple grown only in one place." +1011,41,9,"The head sticking out belongs to the fore-wyrm, while the tail belongs to the core-wyrm. The two share one apple and help each other out." +1012,40,9,"Supposedly, the regrets of a tea ceremony master who died before perfecting his craft lingered in some matcha and became a Pokémon." +1012,41,9,"Poltchageist looks like a regional form of Sinistea, but it was recently discovered that the two Pokémon are entirely unrelated." +1013,40,9,"It pretends to be tea, trying to fool people into drinking it so it can drain their life-force. Its ruse is generally unsuccessful." +1013,41,9,"It prefers cool, dark places, such as the back of a shelf or the space beneath a home's floorboards. It wanders in search of prey after sunset." +1014,40,9,"After all its muscles were stimulated by the toxic chain around its neck, Okidogi transformed and gained a powerful physique." +1014,41,9,"Okidogi is a ruffian with a short temper. It can pulverize anything by swinging around the chain on its neck." +1015,40,9,"The chain is made from toxins that enhance capabilities. It stimulated Munkidori's brain and caused the Pokémon's psychic powers to bloom." +1015,41,9,"Munkidori keeps itself somewhere safe while it toys with its foes, using psychokinesis to induce intense dizziness." +1016,40,9,"Fezandipiti owes its beautiful looks and lovely voice to the toxic stimulants emanating from the chain wrapped around its body." +1016,41,9,"Fezandipiti beats its glossy wings to scatter pheromones that captivate people and Pokémon." +1017,40,9,"This Pokémon's type changes based on which mask it's wearing. It confounds its enemies with nimble movements and kicks." +1017,41,9,"This mischief-loving Pokémon is full of curiosity. It battles by drawing out the type-based energy contained within its masks." +1018,40,9,"It gathers static electricity from its surroundings. The beams it launches when down on all fours are tremendously powerful." +1018,41,9,"It digs holes on mountains, searching for food. It’s so durable that being caught in a cave-in won’t faze it." +1019,40,9,"Seven syrpents live inside an apple made of syrup. The syrpent in the center is the commander." +1019,41,9,"These capricious syrpents have banded together. On the rare occasion that their moods align, their true power is unleashed." +1020,40,9,"There are scant few reports of this creature being sighted. One short video shows it rampaging and spouting pillars of flame." +1020,41,9,"It resembles an eerie Pokémon once shown in a paranormal magazine. That Pokémon was said to be an Entei regenerated from a fossil." +1021,40,9,"It's said to incinerate everything around it with lightning launched from its fur. Very little is known about this creature." +1021,41,9,"It bears resemblance to a Pokémon that became a hot topic for a short while after a paranormal magazine touted it as Raikou's ancestor." +1022,40,9,"It resembles a Pokémon described in a dubious magazine as a Terrakion that had been modified by an evil organization." +1022,41,9,"It was named after a mysterious object recorded in an old book. Its body seems to be metallic." +1023,40,9,"It resembles a mysterious object introduced in a paranormal magazine as a cutting-edge weapon shaped like a Cobalion." +1023,41,9,"There was supposedly an incident in which it launched shining blades to cut everything around it to pieces. Little else is known about it." +1024,40,9,"Terapagos protects itself using its power to transform energy into hard crystals. This Pokémon is the source of the Terastal phenomenon." +1024,41,9,"It’s thought that this Pokémon lived in ancient Paldea until it got caught in seismic shifts and went extinct." +1025,40,9,"It feeds others toxic mochi that draw out desires and capabilities. Those who eat the mochi fall under Pecharunt’s control, chained to its will." +1025,41,9,"Its peach-shaped shell serves as storage for a potent poison. It makes poisonous mochi and serves them to people and Pokémon." From ae797cf3cac6e34fd18aa536de9c8446af6adcbf Mon Sep 17 00:00:00 2001 From: chamipon Date: Fri, 5 Apr 2024 15:25:33 -0400 Subject: [PATCH 53/76] Pokemon 1011 - 1017 English genus --- data/v2/csv/pokemon_species_names.csv | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/data/v2/csv/pokemon_species_names.csv b/data/v2/csv/pokemon_species_names.csv index e0217cee..6610e8eb 100644 --- a/data/v2/csv/pokemon_species_names.csv +++ b/data/v2/csv/pokemon_species_names.csv @@ -11116,7 +11116,7 @@ pokemon_species_id,local_language_id,name,genus 1011,6,Sirapfel, 1011,7,Dipplin, 1011,8,Dipplin, -1011,9,Dipplin, +1011,9,Dipplin,Candy Apple Pokémon 1011,11,カミッチュ, 1011,12,裹蜜虫, 1012,1,チャデス, @@ -11126,7 +11126,7 @@ pokemon_species_id,local_language_id,name,genus 1012,6,Mortcha, 1012,7,Poltchageist, 1012,8,Poltchageist, -1012,9,Poltchageist, +1012,9,Poltchageist,Matcha Pokémon 1012,11,チャデス, 1012,12,斯魔茶, 1013,1,ヤバソチャ, @@ -11136,7 +11136,7 @@ pokemon_species_id,local_language_id,name,genus 1013,6,Fatalitcha, 1013,7,Sinistcha, 1013,8,Sinistcha, -1013,9,Sinistcha, +1013,9,Sinistcha,Matcha Pokémon 1013,11,ヤバソチャ, 1013,12,来悲粗茶, 1014,1,イイネイヌ, @@ -11146,7 +11146,7 @@ pokemon_species_id,local_language_id,name,genus 1014,6,Boninu, 1014,7,Okidogi, 1014,8,Okidogi, -1014,9,Okidogi, +1014,9,Okidogi,Retainer Pokémon 1014,11,イイネイヌ, 1014,12,够赞狗, 1015,1,マシマシラ, @@ -11156,7 +11156,7 @@ pokemon_species_id,local_language_id,name,genus 1015,6,Benesaru, 1015,7,Munkidori, 1015,8,Munkidori, -1015,9,Munkidori, +1015,9,Munkidori,Retainer Pokémon 1015,11,マシマシラ, 1015,12,愿增猿, 1016,1,キチキギス, @@ -11166,7 +11166,7 @@ pokemon_species_id,local_language_id,name,genus 1016,6,Beatori, 1016,7,Fezandipiti, 1016,8,Fezandipiti, -1016,9,Fezandipiti, +1016,9,Fezandipiti,Retainer Pokémon 1016,11,キチキギス, 1016,12,吉雉鸡, 1017,1,オーガポン, @@ -11176,7 +11176,7 @@ pokemon_species_id,local_language_id,name,genus 1017,6,Ogerpon, 1017,7,Ogerpon, 1017,8,Ogerpon, -1017,9,Ogerpon, +1017,9,Ogerpon,Mask Pokémon 1017,11,オーガポン, 1017,12,厄诡椪, 1018,1,ブリジュラス,ごうきんポケモン From ff6ab3d65df50a5a4119fef2447605ed82535bbb Mon Sep 17 00:00:00 2001 From: chamipon Date: Fri, 5 Apr 2024 15:27:02 -0400 Subject: [PATCH 54/76] Pokemon 1020 -1023 - English genus from "Paladox" to "Paradox" --- data/v2/csv/pokemon_species_names.csv | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/data/v2/csv/pokemon_species_names.csv b/data/v2/csv/pokemon_species_names.csv index 6610e8eb..260017ce 100644 --- a/data/v2/csv/pokemon_species_names.csv +++ b/data/v2/csv/pokemon_species_names.csv @@ -11206,7 +11206,7 @@ pokemon_species_id,local_language_id,name,genus 1020,6,Keilflamme, 1020,7,Flamariete, 1020,8,Vampeaguzze, -1020,9,Gouging Fire,Paladox Pokémon +1020,9,Gouging Fire,Paradox Pokémon 1020,11,ウガツホムラ,パラドックスポケモン 1020,12,破空焰, 1021,1,タケルライコ,パラドックスポケモン @@ -11216,7 +11216,7 @@ pokemon_species_id,local_language_id,name,genus 1021,6,Furienblitz, 1021,7,Electrofuria, 1021,8,Furiatonante, -1021,9,Raging Bolt,Paladox Pokémon +1021,9,Raging Bolt,Paradox Pokémon 1021,11,タケルライコ,パラドックスポケモン 1021,12,猛雷鼓, 1022,1,テツノイワオ,パラドックスポケモン @@ -11226,7 +11226,7 @@ pokemon_species_id,local_language_id,name,genus 1022,6,Eisenfels, 1022,7,Ferromole, 1022,8,Massoferreo, -1022,9,Iron Boulder,Paladox Pokémon +1022,9,Iron Boulder,Paradox Pokémon 1022,11,テツノイワオ,パラドックスポケモン 1022,12,鐵磐岩, 1023,1,テツノカシラ,パラドックスポケモン @@ -11236,7 +11236,7 @@ pokemon_species_id,local_language_id,name,genus 1023,6,Eisenhaupt, 1023,7,Ferrotesta, 1023,8,Capoferreo, -1023,9,Iron Crown,Paladox Pokémon +1023,9,Iron Crown,Paradox Pokémon 1023,11,テツノカシラ,パラドックスポケモン 1023,12,鐵頭殼, 1024,1,テラパゴス,テラスタルポケモン From 0471f98941e5403a46f07b5c31e96609ca02f011 Mon Sep 17 00:00:00 2001 From: JVMartyns Date: Mon, 8 Apr 2024 10:27:14 -0300 Subject: [PATCH 55/76] feat: add the query parameter `q` to search for pokemon using a partial name --- pokemon_v2/api.py | 10 ++++++++++ pokemon_v2/tests.py | 19 +++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/pokemon_v2/api.py b/pokemon_v2/api.py index 790f62b9..e5405211 100644 --- a/pokemon_v2/api.py +++ b/pokemon_v2/api.py @@ -4,6 +4,7 @@ from rest_framework.response import Response from rest_framework.views import APIView from django.shortcuts import get_object_or_404 from django.http import Http404 +from django.db.models import Q from .models import * from .serializers import * @@ -38,6 +39,15 @@ class NameOrIdRetrieval: idPattern = re.compile(r"^-?[0-9]+$") namePattern = re.compile(r"^[0-9A-Za-z\-\+]+$") + def get_queryset(self): + queryset = super().get_queryset() + filter = self.request.GET.get('q', '') + + if filter: + queryset = queryset.filter(Q(name__icontains=filter)) + + return queryset + def get_object(self): queryset = self.get_queryset() queryset = self.filter_queryset(queryset) diff --git a/pokemon_v2/tests.py b/pokemon_v2/tests.py index e458f467..48b8aa5e 100644 --- a/pokemon_v2/tests.py +++ b/pokemon_v2/tests.py @@ -5099,6 +5099,25 @@ class APITests(APIData, APITestCase): "{}".format(cries_data["legacy"]), ) + # test search pokemon using search query param `q=partial_name` + + response = self.client.get( + "{}/pokemon/?q={}".format(API_V2, pokemon.name[:2]), + HTTP_HOST="testserver", + ) + + self.assertEqual(response.status_code, status.HTTP_200_OK) + self.assertEqual(response.data["count"], 1) + self.assertEqual(response.data["results"][0]["name"], pokemon.name) + + response = self.client.get( + "{}/pokemon/?q={}".format(API_V2, pokemon.name[-3:]), + ) + + self.assertEqual(response.status_code, status.HTTP_200_OK) + self.assertEqual(response.data["count"], 1) + self.assertEqual(response.data["results"][0]["name"], pokemon.name) + def test_pokemon_form_api(self): pokemon_species = self.setup_pokemon_species_data() pokemon = self.setup_pokemon_data(pokemon_species=pokemon_species) From eb70b7012cde8aa0ce5e664bf662e7e95779d6e3 Mon Sep 17 00:00:00 2001 From: JVMartyns Date: Mon, 8 Apr 2024 10:51:12 -0300 Subject: [PATCH 56/76] format file api.py --- pokemon_v2/api.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pokemon_v2/api.py b/pokemon_v2/api.py index e5405211..0e82eb53 100644 --- a/pokemon_v2/api.py +++ b/pokemon_v2/api.py @@ -397,7 +397,8 @@ class PokemonEncounterView(APIView): for area_id in area_ids: location_area = location_area_objects.get(pk=area_id) - area_encounters = encounter_objects.filter(location_area_id=area_id) + area_encounters = encounter_objects.filter( + location_area_id=area_id) version_ids = ( area_encounters.order_by("version_id") @@ -422,8 +423,10 @@ class PokemonEncounterView(APIView): encounter_details_list = [] for encounter in encounters_data: - slot = EncounterSlot.objects.get(pk=encounter["encounter_slot"]) - slot_data = EncounterSlotSerializer(slot, context=self.context).data + slot = EncounterSlot.objects.get( + pk=encounter["encounter_slot"]) + slot_data = EncounterSlotSerializer( + slot, context=self.context).data del encounter["pokemon"] del encounter["encounter_slot"] From 176fdf34179da80ec0f03d2f46f53defa868a917 Mon Sep 17 00:00:00 2001 From: JVMartyns Date: Mon, 8 Apr 2024 11:05:29 -0300 Subject: [PATCH 57/76] style: apply format using black --- config/wsgi.py | 1 + data/v2/build.py | 8 ++++--- pokemon_v2/api.py | 11 ++++----- pokemon_v2/tests.py | 58 ++++++++++++++++++++++++--------------------- 4 files changed, 41 insertions(+), 37 deletions(-) diff --git a/config/wsgi.py b/config/wsgi.py index 9642109b..d246049d 100755 --- a/config/wsgi.py +++ b/config/wsgi.py @@ -13,6 +13,7 @@ middleware here, or combine a Django application with an application of another framework. """ + import os from django.core.wsgi import get_wsgi_application diff --git a/data/v2/build.py b/data/v2/build.py index 4c3eae76..9e6459eb 100644 --- a/data/v2/build.py +++ b/data/v2/build.py @@ -1242,9 +1242,11 @@ def _build_locations(): id=int(info[0]), location_id=int(info[1]), game_index=int(info[2]), - name="{}-{}".format(location.name, info[3]) - if info[3] - else "{}-{}".format(location.name, "area"), + name=( + "{}-{}".format(location.name, info[3]) + if info[3] + else "{}-{}".format(location.name, "area") + ), ) build_generic((LocationArea,), "location_areas.csv", csv_record_to_objects) diff --git a/pokemon_v2/api.py b/pokemon_v2/api.py index 0e82eb53..6e897245 100644 --- a/pokemon_v2/api.py +++ b/pokemon_v2/api.py @@ -41,7 +41,7 @@ class NameOrIdRetrieval: def get_queryset(self): queryset = super().get_queryset() - filter = self.request.GET.get('q', '') + filter = self.request.GET.get("q", "") if filter: queryset = queryset.filter(Q(name__icontains=filter)) @@ -397,8 +397,7 @@ class PokemonEncounterView(APIView): for area_id in area_ids: location_area = location_area_objects.get(pk=area_id) - area_encounters = encounter_objects.filter( - location_area_id=area_id) + area_encounters = encounter_objects.filter(location_area_id=area_id) version_ids = ( area_encounters.order_by("version_id") @@ -423,10 +422,8 @@ class PokemonEncounterView(APIView): encounter_details_list = [] for encounter in encounters_data: - slot = EncounterSlot.objects.get( - pk=encounter["encounter_slot"]) - slot_data = EncounterSlotSerializer( - slot, context=self.context).data + slot = EncounterSlot.objects.get(pk=encounter["encounter_slot"]) + slot_data = EncounterSlotSerializer(slot, context=self.context).data del encounter["pokemon"] del encounter["encounter_slot"] diff --git a/pokemon_v2/tests.py b/pokemon_v2/tests.py index 48b8aa5e..efa42567 100644 --- a/pokemon_v2/tests.py +++ b/pokemon_v2/tests.py @@ -1679,42 +1679,46 @@ class APIData: showdown = { "front_default": showdown_path % pokemon.id if front_default else None, - "front_female": showdown_path % f"female/{pokemon.id}" - if front_female - else None, - "front_shiny": showdown_path % f"shiny/{pokemon.id}" - if front_shiny - else None, - "front_shiny_female": showdown_path % f"shiny/female/{pokemon.id}" - if front_shiny_female - else None, - "back_default": showdown_path % f"back/{pokemon.id}" - if back_default - else None, - "back_female": showdown_path % f"back/female/{pokemon.id}" - if back_female - else None, - "back_shiny": showdown_path % f"back/shiny/{pokemon.id}" - if back_shiny - else None, - "back_shiny_female": showdown_path % f"back/shiny/female/{pokemon.id}" - if back_shiny_female - else None, + "front_female": ( + showdown_path % f"female/{pokemon.id}" if front_female else None + ), + "front_shiny": ( + showdown_path % f"shiny/{pokemon.id}" if front_shiny else None + ), + "front_shiny_female": ( + showdown_path % f"shiny/female/{pokemon.id}" + if front_shiny_female + else None + ), + "back_default": ( + showdown_path % f"back/{pokemon.id}" if back_default else None + ), + "back_female": ( + showdown_path % f"back/female/{pokemon.id}" if back_female else None + ), + "back_shiny": ( + showdown_path % f"back/shiny/{pokemon.id}" if back_shiny else None + ), + "back_shiny_female": ( + showdown_path % f"back/shiny/female/{pokemon.id}" + if back_shiny_female + else None + ), } sprites = { "front_default": sprite_path % pokemon.id if front_default else None, "front_female": sprite_path % pokemon.id if front_female else None, "front_shiny": sprite_path % pokemon.id if front_shiny else None, - "front_shiny_female": sprite_path % pokemon.id - if front_shiny_female - else None, + "front_shiny_female": ( + sprite_path % pokemon.id if front_shiny_female else None + ), "back_default": sprite_path % pokemon.id if back_default else None, "back_female": sprite_path % pokemon.id if back_female else None, "back_shiny": sprite_path % pokemon.id if back_shiny else None, - "back_shiny_female": sprite_path % pokemon.id - if back_shiny_female - else None, + "back_shiny_female": ( + sprite_path % pokemon.id if back_shiny_female else None + ), } pokemon_sprites = PokemonSprites.objects.create( From 72d36d8870a043265d47d4eddea77af0f63e366f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastien=20B=C3=BCrky?= Date: Thu, 25 Apr 2024 19:24:17 +0200 Subject: [PATCH 58/76] Let's Snuggle Forever and Plasma-Fists had their effects accidentally switched --- data/v2/csv/moves.csv | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/data/v2/csv/moves.csv b/data/v2/csv/moves.csv index 3ac69894..fb2f0a96 100644 --- a/data/v2/csv/moves.csv +++ b/data/v2/csv/moves.csv @@ -719,12 +719,12 @@ id,identifier,generation_id,type_id,power,pp,accuracy,priority,target_id,damage_ 718,multi-attack,7,1,120,10,100,0,10,2,269,,,, 719,10-000-000-volt-thunderbolt,7,13,195,1,,0,10,3,1,,,, 720,mind-blown,7,10,150,5,100,0,9,3,420,,,, -721,plasma-fists,7,13,100,15,100,0,10,2,1,,,, +721,plasma-fists,7,13,100,15,100,0,10,2,417,,,, 722,photon-geyser,7,14,100,5,100,0,10,3,1,,,, 723,light-that-burns-the-sky,7,14,200,1,,0,10,3,416,,,, 724,searing-sunraze-smash,7,9,200,1,,0,10,2,411,,,, 725,menacing-moonraze-maelstrom,7,8,200,1,,0,10,3,411,,,, -726,lets-snuggle-forever,7,18,190,1,,0,10,2,417,,,, +726,lets-snuggle-forever,7,18,190,1,,0,10,2,1,,,, 727,splintered-stormshards,7,6,190,1,,0,10,2,418,,,, 728,clangorous-soulblaze,7,16,185,1,,0,11,3,419,100,,, 729,zippy-zap,7,13,80,10,100,2,10,2,1,100,,, From 940fcac4487460489456df75f5b82d9a78376454 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastien=20B=C3=BCrky?= Date: Sat, 4 May 2024 14:53:44 +0200 Subject: [PATCH 59/76] Add Stellar Type --- data/v2/csv/type_names.csv | 11 +++++++++++ data/v2/csv/types.csv | 1 + 2 files changed, 12 insertions(+) diff --git a/data/v2/csv/type_names.csv b/data/v2/csv/type_names.csv index 5a4b834a..cd7ce936 100644 --- a/data/v2/csv/type_names.csv +++ b/data/v2/csv/type_names.csv @@ -179,6 +179,17 @@ type_id,local_language_id,name 18,9,Fairy 18,11,フェアリー 18,12,妖精 +19,1,ステラ +19,2, Stella +19,3, 스텔라 +19,4,星晶 +19,5,Stellaire +19,6,Stellar +19,7,Astral +19,8,Astrale +19,9,Stellar +19,11,ステラ + 10001,1,??? 10001,3,??? 10001,4,??? diff --git a/data/v2/csv/types.csv b/data/v2/csv/types.csv index 0603c393..46f1d077 100644 --- a/data/v2/csv/types.csv +++ b/data/v2/csv/types.csv @@ -17,5 +17,6 @@ id,identifier,generation_id,damage_class_id 16,dragon,1,3 17,dark,2,3 18,fairy,6, +19,stellar,9 10001,unknown,2, 10002,shadow,3, From 7b83e61665dd101a6bcf684a8bf58d53e8c57fe7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastien=20B=C3=BCrky?= Date: Sat, 4 May 2024 15:01:00 +0200 Subject: [PATCH 60/76] add missing comma --- data/v2/csv/types.csv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/v2/csv/types.csv b/data/v2/csv/types.csv index 46f1d077..d0ec10c3 100644 --- a/data/v2/csv/types.csv +++ b/data/v2/csv/types.csv @@ -17,6 +17,6 @@ id,identifier,generation_id,damage_class_id 16,dragon,1,3 17,dark,2,3 18,fairy,6, -19,stellar,9 +19,stellar,9, 10001,unknown,2, 10002,shadow,3, From 7564cd1d3b6ece7e4a3f27a3b2c096b683951527 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastien=20B=C3=BCrky?= Date: Sat, 4 May 2024 15:05:20 +0200 Subject: [PATCH 61/76] Remove an empty line --- data/v2/csv/type_names.csv | 1 - 1 file changed, 1 deletion(-) diff --git a/data/v2/csv/type_names.csv b/data/v2/csv/type_names.csv index cd7ce936..a57cba16 100644 --- a/data/v2/csv/type_names.csv +++ b/data/v2/csv/type_names.csv @@ -189,7 +189,6 @@ type_id,local_language_id,name 19,8,Astrale 19,9,Stellar 19,11,ステラ - 10001,1,??? 10001,3,??? 10001,4,??? From 8276c42823f791e7816f8fbd3897f740e6840fea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alessandro=20Pezz=C3=A8?= Date: Sat, 4 May 2024 19:31:51 +0200 Subject: [PATCH 62/76] refactor: remove outdated file --- pokemon_v2/README.md | 3183 +----------------------------------------- 1 file changed, 1 insertion(+), 3182 deletions(-) diff --git a/pokemon_v2/README.md b/pokemon_v2/README.md index aacb4cba..3bc00d0e 100644 --- a/pokemon_v2/README.md +++ b/pokemon_v2/README.md @@ -1,3182 +1 @@ - -# Pokeapi V2 API Reference - - - - - - - - - - - - -
API Endpoints
- - - - - -
- -## Resource Lists -Calling any api endpoint without a resource id or name will return a paginated list of available resources for that api. By default, a list 'page' will contain up to 20 resources. If you would like to change this just add a 'limit' query param, e.g. `limit=60`. - -### GET api/v2/{endpoint} - -###### example response for non-named resources - -```json -{ - "count": 365, - "next": "http://pokeapi.co/api/v2/evolution-chain/?limit=20&offset=20", - "previous": null, - "results": [{ - "url": "http://pokeapi.co/api/v2/evolution-chain/1/" - }] -} -``` - -#### APIResourceList - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| count | The total number of resources available from this api | integer | -| next | The url for the next 'page' in the list | string | -| previous | The url for the previous page in the list | boolean | -| results | The list of non-named api resources | list [APIResource](#apiresource) | - - -###### example response for named resources - -```json -{ - "count": 248, - "next": "http://pokeapi.co/api/v2/ability/?limit=20&offset=20", - "previous": null, - "results": [{ - "name": "stench", - "url": "http://pokeapi.co/api/v2/ability/1/" - }] -} -``` - -#### NamedAPIResourceList - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| count | The total number of resources available from this api | integer | -| next | The url for the next 'page' in the list | string | -| previous | The url for the previous page in the list | boolean | -| results | The list of named api resources | list [NamedAPIResource](#namedapiresource) | - - - -

Berries

- -## Berries -Berries are small fruits that can provide HP and status condition restoration, stat enhancement, and even damage negation when eaten by pokemon. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Berry) for greater detail. - -### GET api/v2/berry/{id or name} - -###### example response - -```json -{ - "id": 1, - "name": "cheri", - "growth_time": 3, - "max_harvest": 5, - "natural_gift_power": 60, - "size": 20, - "smoothness": 25, - "soil_dryness": 15, - "firmness": { - "name": "soft", - "url": "http://pokeapi.co/api/v2/berry-firmness/2/" - }, - "flavors": [{ - "potency": 10, - "flavor": { - "name": "spicy", - "url": "http://pokeapi.co/api/v2/berry-flavor/1/" - } - }], - "item": { - "name": "cheri-berry", - "url": "http://pokeapi.co/api/v2/item/126/" - }, - "natural_gift_type": { - "name": "fire", - "url": "http://pokeapi.co/api/v2/type/10/" - } -} - -``` - -###### response models - -#### Berry - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| id | The identifier for this berry resource | integer | -| name | The name for this berry resource | string | -| growth_time | Time it takes the tree to grow one stage, in hours. Berry trees go through four of these growth stages before they can be picked. | integer | -| max_harvest | The maximum number of these berries that can grow on one tree in Generation IV | integer | -| natural_gift_power | The power of the move "Natural Gift" when used with this Berry | integer | -| size | The size of this Berry, in millimeters | integer | -| smoothness | The smoothness of this Berry, used in making Pokéblocks or Poffins | integer | -| soil_dryness | The speed at which this Berry dries out the soil as it grows. A higher rate means the soil dries more quickly. | integer | -| firmness | The firmness of this berry, used in making Pokéblocks or Poffins | [NamedAPIResource](#namedapiresource) ([BerryFirmness](#berry-firmnesses)) | -| flavors | A list of references to each flavor a berry can have and the potency of each of those flavors in regard to this berry | list [BerryFlavorMap](#berryflavormap) | -| item | Berries are actually items. This is a reference to the item specific data for this berry. | [NamedAPIResource](#namedapiresource) ([Item](#items)) | -| natural_gift_type | The Type the move "Natural Gift" has when used with this Berry | [NamedAPIResource](#namedapiresource) ([Type](#types)) | - -#### BerryFlavorMap - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| potency | How powerful the referenced flavor is for this berry | integer | -| flavor | The referenced berry flavor | [NamedAPIResource](#namedapiresource) ([BerryFlavor](#berry-flavors)) | - - -## Berry Firmnesses - -### GET api/v2/berry-firmness/{id or name} - -###### example response - -```json -{ - "id": 1, - "name": "very-soft", - "berries": [{ - "name": "pecha", - "url": "http://pokeapi.co/api/v2/berry/3/" - }], - "names": [{ - "name": "Very Soft", - "language": { - "name": "en", - "url": "http://pokeapi.co/api/v2/language/9/" - } - }] -} - -``` - -###### response models - -#### BerryFirmness - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| id | The identifier for this berry firmness resource | integer | -| name | The name for this berry firmness resource | string | -| berries | A list of the berries with this firmness | list [NamedAPIResource](#namedapiresource) ([Berry](#berries)) | -| names | The name of this berry firmness listed in different languages | list [Name](#resourcename) | - - - -## Berry Flavors -Flavors determine whether a pokemon will benefit or suffer from eating a berry based on their [nature](#natures). Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Flavor) for greater detail. - -### GET api/v2/berry-flavor/{id or name} - -###### example response - -```json -{ - "id": 1, - "name": "spicy", - "berries": [{ - "potency": 10, - "berry": { - "name": "rowap", - "url": "http://pokeapi.co/api/v2/berry/64/" - } - }], - "contest_type": { - "name": "cool", - "url": "http://pokeapi.co/api/v2/contest-type/1/" - }, - "names": [{ - "name": "Spicy", - "language": { - "name": "en", - "url": "http://pokeapi.co/api/v2/language/9/" - } - }] -} - -``` - -###### response models - -#### BerryFlavor - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| id | The identifier for this berry flavor resource | integer | -| name | The name for this berry flavor resource | string | -| berries | A list of the berries with this flavor | list [FlavorBerryMap](#flavorberrymap) | -| contest_type | The contest type that correlates with this berry flavor | [NamedAPIResource](#namedapiresource) ([ContestType](#contest-types)) | -| names | The name of this berry flavor listed in different languages | list [Name](#resourcename) | - -#### FlavorBerryMap - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| potency | How powerful the referenced flavor is for this berry | integer | -| berry | The berry with the referenced flavor | [NamedAPIResource](#namedapiresource) ([Berry](#berry)) | - - - -

Contests

- -## Contest Types -Contest types are categories judges used to weigh a pokémon's condition in pokemon contests. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Contest_condition) for greater detail. - -### GET api/v2/contest-type/{id or name} - -###### example response - -```json -{ - "id": 1, - "name": "cool", - "berry_flavor": { - "name": "spicy", - "url": "http://pokeapi.co/api/v2/berry-flavor/1/" - }, - "names": [{ - "name": "Cool", - "color": "Red", - "language": { - "name": "en", - "url": "http://pokeapi.co/api/v2/language/9/" - } - }] -} - -``` - -###### response models - -#### ContestType - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| id | The identifier for this contest type resource | integer | -| name | The name for this contest type resource | string | -| berry_flavor | The berry flavor that correlates with this contest type | [NamedAPIResource](#namedapiresource) ([BerryFlavor](#berry-flavors)) | -| names | The name of this contest type listed in different languages | list [Name](#resourcename) | - - - -## Contest Effects -Contest effects refer to the effects of moves when used in contests. - -### GET api/v2/contest-effect/{id} - -###### example response - -```json -{ - "id": 1, - "appeal": 4, - "jam": 0, - "effect_entries": [{ - "effect": "Gives a high number of appeal points wth no other effects.", - "language": { - "name": "en", - "url": "http://pokeapi.co/api/v2/language/9/" - } - }], - "flavor_text_entries": [{ - "flavor_text": "A highly appealing move.", - "language": { - "name": "en", - "url": "http://pokeapi.co/api/v2/language/9/" - } - }] -} - -``` - -###### response models - -#### ContestEffect - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| id | The identifier for this contest type resource | integer | -| appeal | The base number of hearts the user of this move gets | string | -| jam | The base number of hearts the user's opponent loses | integer | -| effect_entries | The result of this contest effect listed in different languages | list [Effect](#effect) | -| flavor_text_entries | The flavor text of this contest effect listed in different languages | list [FlavorText](#flavortext) | - - -## Super Contest Effects -Super contest effects refer to the effects of moves when used in super contests. - -### GET api/v2/super-contest-effect/{id} - -###### example response - -```json -{ - "id": 1, - "appeal": 2, - "flavor_text_entries": [{ - "flavor_text": "Enables the user to perform first in the next turn.", - "language": { - "name": "en", - "url": "http://pokeapi.co/api/v2/language/9/" - } - }], - "moves": [{ - "name": "agility", - "url": "http://pokeapi.co/api/v2/move/97/" - }] -} -``` - -###### response models - -#### SuperContestEffect - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| id | The identifier for this super contest effect resource | integer | -| appeal | The level of appeal this super contest effect has | string | -| flavor_text_entries | The flavor text of this super contest effect listed in different languages | list [FlavorText](#flavortext) | -| moves | A list of moves that have the effect when used in super contests | list [NamedAPIResource](#namedapiresource) ([Move](#moves)) | - - - -

Encounters

- -## Encounter Methods -Methods by which the player can encounter pokémon in the wild, e.g., walking in tall grass. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Wild_Pokémon) for greater detail. - -### GET api/v2/encounter-method/{id or name} - -###### example response - -```json -{ - "id": 1, - "name": "walk", - "order": 1, - "names": [{ - "name": "Walking in tall grass or a cave", - "language": { - "name": "en", - "url": "http://pokeapi.co/api/v2/language/9/" - } - }] -} - -``` - -###### response models - -#### EncounterMethod - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| id | The identifier for this encounter method resource | integer | -| name | The name for this encounter method resource | string | -| order | A good value for sorting | integer | -| names | The name of this encounter method listed in different languages | list [Name](#resourcename) | - - - -## Encounter Conditions -Conditions which affect what pokémon might appear in the wild, e.g., day or night. - -### GET api/v2/encounter-condition/{id or name} - -###### example response - -```json -{ - "id": 1, - "name": "swarm", - "values": [{ - "name": "swarm-yes", - "url": "http://pokeapi.co/api/v2/encounter-condition-value/1/" - }, { - "name": "swarm-no", - "url": "http://pokeapi.co/api/v2/encounter-condition-value/2/" - }], - "names": [{ - "name": "Schwarm", - "language": { - "name": "de", - "url": "http://pokeapi.co/api/v2/language/6/" - } - }] -} - -``` - -###### response models - -#### EncounterCondition - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| id | The identifier for this encounter condition resource | integer | -| name | The name for this encounter condition resource | string | -| names | The name of this encounter method listed in different languages | list [Name](#resourcename) | -| values | A list of possible values for this encounter condition | list [NamedAPIResource](#namedapiresource) ([EncounterConditionValue](#encounter-condition-values)) | - - - -## Encounter Condition Values -Encounter condition values are the various states that an encounter condition can have, i.e., Time of day can be either day or night. - -### GET api/v2/encounter-condition-value/{id or name} - -###### example response - -```json -{ - "id": 1, - "name": "swarm-yes", - "condition": { - "name": "swarm", - "url": "http://pokeapi.co/api/v2/encounter-condition/1/" - }, - "names": [{ - "name": "Während eines Schwarms", - "language": { - "name": "de", - "url": "http://pokeapi.co/api/v2/language/6/" - } - }] -} - -``` - -###### response models - -#### EncounterConditionValue - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| id | The identifier for this encounter condition value resource | integer | -| name | The name for this encounter condition value resource | string | -| condition | The condition this encounter condition value pertains to | list [NamedAPIResource](#namedapiresource) ([EncounterCondition](#encounter-conditions)) | -| names | The name of this encounter condition value listed in different languages | list [Name](#resourcename) | - - - -

Evolution

- -## Evolution Chains -Evolution chains are essentially family trees. They start with the lowest stage within a family and detail evolution conditions for each as well as pokémon they can evolve into up through the hierarchy. - -### GET api/v2/evolution-chain/{id} - -###### example response - -```json -{ - "id": 7, - "baby_trigger_item": null, - "chain": { - "is_baby": false, - "species": { - "name": "rattata", - "url": "http://pokeapi.co/api/v2/pokemon-species/19/" - }, - "evolution_details": null, - "evolves_to": [{ - "is_baby": false, - "species": { - "name": "raticate", - "url": "http://pokeapi.co/api/v2/pokemon-species/20/" - }, - "evolution_details": { - "item": null, - "trigger": { - "name": "level-up", - "url": "http://pokeapi.co/api/v2/evolution-trigger/1/" - }, - "gender": null, - "held_item": null, - "known_move": null, - "known_move_type": null, - "location": null, - "min_level": 20, - "min_happiness": null, - "min_beauty": null, - "min_affection": null, - "needs_overworld_rain": false, - "party_species": null, - "party_type": null, - "relative_physical_stats": null, - "time_of_day": "", - "trade_species": null, - "turn_upside_down": false - }, - "evolves_to": [] - }] - } -} -``` - -###### response models - -#### EvolutionChain - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| id | The identifier for this evolution chain resource | integer | -| baby_trigger_item | The item that a pokémon would be holding when mating that would trigger the egg hatching a baby pokémon rather than a basic pokémon | [NamedAPIResource](#namedapiresource) ([Item](#items)) | -| chain | The base chain link object. Each link contains evolution details for a pokémon in the chain. Each link references the next pokémon in the natural evolution order. | [ChainLink](#chainlink) | - -#### ChainLink - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| is_baby | Whether or not this link is for a baby pokémon. This would only ever be true on the base link. | boolean | -| species | The pokemon species at this point in the evolution chain | [NamedAPIResource](#namedapiresource) ([PokemonSpecies](#pokemon-species)) | -| evolution_details | All details regarding the specific details of the referenced pokémon species evolution | [EvolutionDetail](#evolutiondetail) | -| evolves_to | A List of chain objects. | list [ChainLink](#chainlink) | - -#### EvolutionDetail - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| item | The item required to cause evolution this into pokémon species | [NamedAPIResource](#namedapiresource) ([Item](#items)) | -| trigger | The type of event that triggers evolution into this pokémon species | [NamedAPIResource](#namedapiresource) ([EvolutionTrigger](#evolution-triggers)) | -| gender | The gender the evolving pokémon species must be in order to evolve into this pokémon species | [NamedAPIResource](#namedapiresource) ([Gender](#genders)) | -| held_item | The item the evolving pokémon species must be holding during the evolution trigger event to evolve into this pokémon species | [NamedAPIResource](#namedapiresource) ([Item](#items)) | -| known_move | The move that must be known by the evolving pokémon species during the evolution trigger event in order to evolve into this pokémon species | [NamedAPIResource](#namedapiresource) ([Move](#moves)) | -| known_move_type | The evolving pokémon species must know a move with this type during the evolution trigger event in order to evolve into this pokémon species | [NamedAPIResource](#namedapiresource) ([Type](#types)) | -| location | The location the evolution must be triggered at. | [NamedAPIResource](#namedapiresource) ([Location](#locations)) | -| min_level | The minimum required level of the evolving pokémon species to evolve into this pokémon species | integer | -| min_happiness | The minimum required level of happiness the evolving pokémon species to evolve into this pokémon species | integer | -| min_beauty | The minimum required level of beauty the evolving pokémon species to evolve into this pokémon species | integer | -| min_affection | The minimum required level of affection the evolving pokémon species to evolve into this pokémon species | integer | -| needs_overworld_rain | Whether or not it must be raining in the overworld to cause evolution this pokémon species | boolean | -| party_species | The pokémon species that must be in the players party in order for the evolving pokémon species to evolve into this pokémon species | [NamedAPIResource](#namedapiresource) ([PokemonSpecies](#pokemon-species)) | -| party_type | The player must have a pokémon of this type in their party during the evolution trigger event in order for the evolving pokémon species to evolve into this pokémon species | [NamedAPIResource](#namedapiresource) ([Type](#types)) | -| relative_physical_stats | The required relation between the Pokémon's Attack and Defense stats. 1 means Attack > Defense. 0 means Attack = Defense. -1 means Attack < Defense. | integer | -| time_of_day | The required time of day. Day or night. | string | -| trade_species | Pokémon species for which this one must be traded. | [NamedAPIResource](#namedapiresource) ([Pokémon Species](#pokemon-species)) | -| turn_upside_down | Whether or not the 3DS needs to be turned upside-down as this Pokémon levels up. | boolean | - - -## Evolution Triggers -Evolution triggers are the events and conditions that cause a pokémon to evolve. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Methods_of_evolution) for greater detail. - -### GET api/v2/evolution-trigger/{id or name} - -###### example response - -```json -{ - "id": 1, - "name": "level-up", - "names": [{ - "name": "Level up", - "language": { - "name": "en", - "url": "http://pokeapi.co/api/v2/language/9/" - } - }], - "pokemon_species": [{ - "name": "ivysaur", - "url": "http://pokeapi.co/api/v2/pokemon-species/2/" - }] -} - -``` - -###### response models - -#### EvolutionTrigger - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| id | The identifier for this evolution trigger resource | integer | -| name | The name for this evolution trigger resource | string | -| names | The name of this evolution trigger listed in different languages | list [Name](#resourcename) | -| pokemon_species | A list of pokémon species that result from this evolution trigger | list [NamedAPIResource](#namedapiresource) ([PokemonSpecies](#pokemon-species)) | - - - -

Games

- -## Generations -A generation is a grouping of the Pokémon games that separates them based on the Pokémon they include. In each generation, a new set of Pokémon, Moves, Abilities and Types that did not exist in the previous generation are released. - -### GET api/v2/generation/{id or name} - -###### example response - -```json -{ - "id": 1, - "name": "generation-i", - "abilities": [], - "main_region": { - "name": "kanto", - "url": "http://pokeapi.co/api/v2/region/1/" - }, - "moves": [{ - "name": "pound", - "url": "http://pokeapi.co/api/v2/move/1/" - }], - "names": [{ - "name": "Generation I", - "language": { - "name": "de", - "url": "http://pokeapi.co/api/v2/language/6/" - } - }], - "pokemon_species": [{ - "name": "bulbasaur", - "url": "http://pokeapi.co/api/v2/pokemon-species/1/" - }], - "types": [{ - "name": "normal", - "url": "http://pokeapi.co/api/v2/type/1/" - }], - "version_groups": [{ - "name": "red-blue", - "url": "http://pokeapi.co/api/v2/version-group/1/" - }] -} - -``` - -###### response models - -#### Generation - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| id | The identifier for this generation resource | integer | -| name | The name for this generation resource | string | -| abilities | A list of abilities that were introduced in this generation | list [NamedAPIResource](#namedapiresource) ([Ability](#abilities)) | -| names | The name of this generation listed in different languages | list [Name](#resourcename) | -| main_region | The main region travelled in this generation | [NamedAPIResource](#namedapiresource) ([Region](#regions)) | -| moves | A list of moves that were introduced in this generation | list [NamedAPIResource](#namedapiresource) ([Move](#moves)) | -| pokemon_species | A list of pokémon species that were introduced in this generation | list [NamedAPIResource](#namedapiresource) ([PokemonSpecies](#pokemon-species)) | -| types | A list of types that were introduced in this generation | list [NamedAPIResource](#namedapiresource) ([Type](#types)) | -| version_groups | A list of version groups that were introduced in this generation | list [NamedAPIResource](#namedapiresource) ([VersionGroup](#version-groups)) | - - - -## Pokedexes -A Pokédex is a handheld electronic encyclopedia device; one which is capable of recording and retaining information of the various Pokémon in a given region with the exception of the national dex and some smaller dexes related to portions of a region. See [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Pokedex) for greater detail. (Note: no official plural of 'pokédex' is known, 'standard' -(e)s is used here) - -### GET api/v2/pokedex/{id or name} - -###### example response - -```json -{ - "id": 2, - "name": "kanto", - "is_main_series": true, - "descriptions": [{ - "description": "Rot/Blau/Gelb Kanto Dex", - "language": { - "name": "de", - "url": "http://pokeapi.co/api/v2/language/6/" - } - }], - "names": [{ - "name": "Kanto", - "language": { - "name": "de", - "url": "http://pokeapi.co/api/v2/language/6/" - } - }], - "pokemon_entries": [{ - "entry_number": 1, - "pokemon_species": { - "name": "bulbasaur", - "url": "http://pokeapi.co/api/v2/pokemon-species/1/" - } - }], - "region": { - "name": "kanto", - "url": "http://pokeapi.co/api/v2/region/1/" - }, - "version_groups": [{ - "name": "red-blue", - "url": "http://pokeapi.co/api/v2/version-group/1/" - }] -} -``` - -###### response models - -#### Pokedex - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| id | The identifier for this pokédex resource | integer | -| name | The name for this pokédex resource | string | -| is_main_series | Whether or not this pokédex originated in the main series of the video games | boolean | -| descriptions | The description of this pokédex listed in different languages | list [Description](#description) | -| names | The name of this pokédex listed in different languages | list [Name](#resourcename) | -| pokemon_entries | A list of pokémon catalogued in this pokédex and their indexes | list [PokemonEntry](#pokemonentry) | -| region | The region this pokédex catalogues pokémon for | [NamedAPIResource](#namedapiresource) ([Region](#regions)) | -| version_groups | A list of version groups this pokédex is relevent to | list [NamedAPIResource](#namedapiresource) ([VersionGroup](#version-groups)) | - -#### PokemonEntry - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| entry_number | The index of this pokémon species entry within the pokédex | integer | -| pokemon_species | The pokémon species being encountered | [NamedAPIResource](#namedapiresource) ([PokemonSpecies](#pokemon-species)) | - - - -## Versions -Versions of the games, e.g., Red, Blue or Yellow. - -### GET api/v2/version/{id or name} - -###### example response - -```json - -{ - "id": 1, - "name": "red", - "names": [{ - "name": "Rot", - "language": { - "name": "de", - "url": "http://pokeapi.co/api/v2/language/6/" - } - }], - "version_group": { - "name": "red-blue", - "url": "http://pokeapi.co/api/v2/version-group/1/" - } -} -``` - -###### response models - -#### Version - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| id | The identifier for this version resource | integer | -| name | The name for this version resource | string | -| names | The name of this version listed in different languages | list [Name](#resourcename) | -| version_group | The version group this version belongs to | [NamedAPIResource](#namedapiresource) ([VersionGroup](#version-groups)) | - - -## Version Groups -Version groups categorize highly similar versions of the games. - -### GET api/v2/version-group/{id or name} - -###### example response - -```json -{ - "id": 1, - "name": "red-blue", - "order": 1, - "generation": { - "name": "generation-i", - "url": "http://pokeapi.co/api/v2/generation/1/" - }, - "move_learn_methods": [{ - "name": "level-up", - "url": "http://pokeapi.co/api/v2/move-learn-method/1/" - }], - "pokedexes": [{ - "name": "kanto", - "url": "http://pokeapi.co/api/v2/pokedex/2/" - }], - "regions": [{ - "name": "kanto", - "url": "http://pokeapi.co/api/v2/region/1/" - }], - "versions": [{ - "name": "red", - "url": "http://pokeapi.co/api/v2/version/1/" - }] -} -``` - -###### response models - -#### VersionGroup - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| id | The identifier for this version group resource | integer | -| name | The name for this version group resource | string | -| order | Order for sorting. Almost by date of release, except similar versions are grouped together. | integer | -| generation | The generation this version was introduced in | list [NamedAPIResource](#namedapiresource) ([Generation](#generations)) | -| move_learn_methods | A list of methods in which pokemon can learn moves in this version group | list [NamedAPIResource](#namedapiresource) ([MoveLearnMethod](#move-learn-methods)) | -| names | The name of this version group listed in different languages | list [Name](#resourcename) | -| pokedexes | A list of pokedexes introduces in this version group | list [NamedAPIResource](#namedapiresource) ([Pokedex](#pokedexes)) | -| regions | A list of regions that can be visited in this version group | list [NamedAPIResource](#namedapiresource) ([Region](#regions)) | -| versions | The versions this version group owns | list [NamedAPIResource](#namedapiresource) ([Version](#versions)) | - - -

Items

- -## Items -An item is an object in the games which the player can pick up, keep in their bag, and use in some manner. They have various uses, including healing, powering up, helping catch Pokémon, or to access a new area. - -### GET api/v2/item/{id or name} - -###### example response - -```json -{ - "id": 1, - "name": "master-ball", - "cost": 0, - "fling_power": 10, - "fling_effect": { - "name":"flinch", - "url":"http://pokeapi.co/api/v2/item-fling-effect/7/" - }, - "attributes": [{ - "name": "holdable", - "url": "http://pokeapi.co/api/v2/item-attribute/5/" - }], - "category": { - "name": "standard-balls", - "url": "http://pokeapi.co/api/v2/item-category/34/" - }, - "effect_entries": [{ - "effect": "Used in battle\n: [Catches]{mechanic:catch} a wild Pokémon without fail.\n\n If used in a trainer battle, nothing happens and the ball is lost.", - "short_effect": "Catches a wild Pokémon every time.", - "language": { - "name": "en", - "url": "http://pokeapi.co/api/v2/language/9/" - } - }], - "flavor_text_entries": [{ - "text": "野生の ポケモンを 必ず\n捕まえることが できる\n最高 性能の ボール。", - "version_group": { - "name": "x-y", - "url": "http://pokeapi.co/api/v2/version-group/15/" - }, - "language": { - "name": "ja-kanji", - "url": "http://pokeapi.co/api/v2/language/11/" - } - }], - "game_indices": [{ - "game_index": 1, - "generation": { - "name": "generation-vi", - "url": "http://pokeapi.co/api/v2/generation/6/" - } - }], - "names": [{ - "name": "Master Ball", - "language": { - "name": "en", - "url": "http://pokeapi.co/api/v2/language/9/" - } - }], - "held_by_pokemon": [{ - "pokemon": { - "name": "chansey", - "url": "http://pokeapi.co/api/v2/pokemon/113/" - }, - "version_details": [{ - "rarity": 50, - "version": { - "name": "soulsilver", - "url": "http://pokeapi.co/api/v2/version/16/" - } - }] - }], - "baby_trigger_for": { - "url":"http://pokeapi.co/api/v2/evolution-chain/1/" - } -} -``` - -###### response models - -#### Item - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| id | The identifier for this item resource | integer | -| name | The name for this item resource | string | -| cost | The price of this item in stores | integer | -| fling_power | The power of the move Fling when used with this item. | integer | -| fling_effect | The effect of the move Fling when used with this item | [ItemFlingEffect](#item-fling-effects) | -| attributes | A list of attributes this item has | list [NamedAPIResource](#namedapiresource) ([ItemAttribute](#item-attributes)) | -| category | The category of items this item falls into | [ItemCategory](#item-categories) | -| effect_entries | The effect of this ability listed in different languages | list [VerboseEffect](#verboseeffect) | -| flavor_text_entries | The flavor text of this ability listed in different languages | list [VersionGroupFlavorText](#versiongroupflavortext) | -| game_indices | A list of game indices relevent to this item by generation | list [GenerationGameIndex](#generationgameindex) | -| names | The name of this item listed in different languages | list [Name](#resourcename) | -| held_by_pokemon | A list of pokémon that might be found in the wild holding this item | list [HeldByPokemon](#heldbypokemon) | -| baby_trigger_for | An evolution chain this item requires to produce a bay during mating | list [APIResource](#apiresource) ([EvolutionChain](#evolution-chains)) | - -#### HeldByPokemon - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| pokemon | The pokemon who might be holding the item | [NamedAPIResource](#namedapiresource) ([Pokemon](#pokemon)) | -| version_details | Details on chance of the pokemon having the item based on version | list [VersionDetails](#helditemversiondetails) | - -#### HeldItemVersionDetails - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| rarity | The chance of the pokemon holding the item | integer | -| version | The version the rarity applies | [NamedAPIResource](#namedapiresource) ([Version](#version)) | -## Item Attributes -Item attributes define particular aspects of items, e.g. "usable in battle" or "consumable". - -### GET api/v2/item-attribute/{id or name} - -###### example response - -```json -{ - "id": 1, - "name": "countable", - "descriptions": [{ - "description": "Has a count in the bag", - "language": { - "name": "en", - "url": "http://pokeapi.co/api/v2/language/9/" - } - }], - "items": [{ - "name": "master-ball", - "url": "http://pokeapi.co/api/v2/item/1/" - }], - "names": [{ - "name": "Countable", - "language": { - "name": "en", - "url": "http://pokeapi.co/api/v2/language/9/" - } - }] -} -``` - -###### response models - -#### ItemAttribute - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| id | The identifier for this item attribute resource | integer | -| name | The name for this item attribute resource | string | -| items | A list of items that have this attribute | list [NamedAPIResource](#namedapiresource) ([Item](#items)) | -| names | The name of this item attribute listed in different languages | list [Name](#resourcename) | -| descriptions | The description of this item attribute listed in different languages | list [Description](#description) | - - -## Item Categories -Item categories determine where items will be placed in the players bag. - -### GET api/v2/item-category/{id or name} - -###### example response - -```json -{ - "id": 1, - "name": "stat-boosts", - "items": [{ - "name": "guard-spec", - "url": "http://pokeapi.co/api/v2/item/55/" - }], - "names": [{ - "name": "Stat boosts", - "language": { - "name": "en", - "url": "http://pokeapi.co/api/v2/language/9/" - } - }], - "pocket": { - "name": "battle", - "url": "http://pokeapi.co/api/v2/item-pocket/7/" - } -} -``` - -###### response models - -#### ItemCategory - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| id | The identifier for this item category resource | integer | -| name | The name for this item category resource | string | -| items | A list of items that are a part of this category | list [NamedAPIResource](#namedapiresource) ([Item](#items)) | -| names | The name of this item category listed in different languages | list [Name](#resourcename) | -| pocket | The pocket items in this category would be put in | [NamedAPIResource](#namedapiresource) ([ItemPocket](#item-pockets)) | - - -## Item Fling Effects -The various effects of the move "Fling" when used with different items. - -### GET api/v2/item-fling-effect/{id or name} - -###### example response - -```json -{ - "id": 1, - "name": "badly-poison", - "effect_entries": [{ - "effect": "Badly poisons the target.", - "language": { - "name": "en", - "url": "http://pokeapi.co/api/v2/language/9/" - } - }], - "items": [{ - "name": "toxic-orb", - "url": "http://pokeapi.co/api/v2/item/249/" - }] -} -``` - -###### response models - -#### ItemFlingEffect - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| id | The identifier for this fling effect resource | integer | -| name | The name for this fling effect resource | string | -| effect_entries | The result of this fling effect listed in different languages | list [Effect](#effect) | -| items | A list of items that have this fling effect | list [NamedAPIResource](#namedapiresource) ([Item](#items)) | - - -## Item Pockets -Pockets within the players bag used for storing items by category. - -### GET api/v2/item-pocket/{id or name} - -###### example response - -```json -{ - "id": 1, - "name": "misc", - "categories": [{ - "name": "collectibles", - "url": "http://pokeapi.co/api/v2/item-category/9/" - }], - "names": [{ - "name": "Items", - "language": { - "name": "en", - "url": "http://pokeapi.co/api/v2/language/9/" - } - }] -} -``` - -###### response models - -#### ItemPocket - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| id | The identifier for this item pocket resource | integer | -| name | The name for this item pocket resource | string | -| categories | A list of item categories that are relevent to this item pocket | list [NamedAPIResource](#namedapiresource) ([ItemCategory](#item-categories)) | -| names | The name of this item pocket listed in different languages | list [Name](#resourcename) | - - -

Moves

- -## Moves -Moves are the skills of pokémon in battle. In battle, a Pokémon uses one move each turn. Some moves (including those learned by Hidden Machine) can be used outside of battle as well, usually for the purpose of removing obstacles or exploring new areas. - -### GET api/v2/move/{id or name} - -###### example response - -```json -{ - "id": 1, - "name": "pound", - "accuracy": 100, - "effect_chance": null, - "pp": 35, - "priority": 0, - "power": 40, - "contest_combos": { - "normal": { - "use_before": [{ - "name": "double-slap", - "url": "http://pokeapi.co/api/v2/move/3/" - }, { - "name": "headbutt", - "url": "http://pokeapi.co/api/v2/move/29/" - }, { - "name": "feint-attack", - "url": "http://pokeapi.co/api/v2/move/185/" - }], - "use_after": null - }, - "super": { - "use_before": null, - "use_after": null - } - }, - "contest_type": { - "name": "tough", - "url": "http://pokeapi.co/api/v2/contest-type/5/" - }, - "contest_effect": { - "url": "http://pokeapi.co/api/v2/contest-effect/1/" - }, - "damage_class": { - "name": "physical", - "url": "http://pokeapi.co/api/v2/move-damage-class/2/" - }, - "effect_entries": [{ - "effect": "Inflicts [regular damage]{mechanic:regular-damage}.", - "short_effect": "Inflicts regular damage with no additional effect.", - "language": { - "name": "en", - "url": "http://pokeapi.co/api/v2/language/9/" - } - }], - "effect_changes": [], - "generation": { - "name": "generation-i", - "url": "http://pokeapi.co/api/v2/generation/1/" - }, - "meta": { - "ailment": { - "name": "none", - "url": "http://pokeapi.co/api/v2/move-ailment/0/" - }, - "category": { - "name": "damage", - "url": "http://pokeapi.co/api/v2/move-category/0/" - }, - "min_hits": null, - "max_hits": null, - "min_turns": null, - "max_turns": null, - "drain": 0, - "healing": 0, - "crit_rate": 0, - "ailment_chance": 0, - "flinch_chance": 0, - "stat_chance": 0 - }, - "names": [{ - "name": "Pound", - "language": { - "name": "en", - "url": "http://pokeapi.co/api/v2/language/9/" - } - }], - "past_values": [], - "stat_changes": [], - "super_contest_effect": { - "url": "http://pokeapi.co/api/v2/super-contest-effect/5/" - }, - "target": { - "name": "selected-pokemon", - "url": "http://pokeapi.co/api/v2/move-target/10/" - }, - "type": { - "name": "normal", - "url": "http://pokeapi.co/api/v2/type/1/" - } -} -``` - -###### response models - -#### Move - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| id | The identifier for this move resource | integer | -| name | The name for this move resource | string | -| accuracy | The percent value of how likely this move is to be successful | integer | -| effect_chance | The percent value of how likely it is this moves effect will happen | integer | -| pp | Power points. The number of times this move can be used | integer | -| priority | A value between -8 and 8. Sets the order in which moves are executed during battle. See [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Priority) for greater detail. | integer | -| power | The base power of this move with a value of 0 if it does not have a base power | integer | -| contest_combos | A detail of normal and super contest combos that require this move | list [ContestComboSets](#contestcombosets) | -| contest_type | The type of appeal this move gives a pokémon when used in a contest | [NamedAPIResource](#namedapiresource) ([ContestType](#contest-types)) | -| contest_effect | The effect the move has when used in a contest | [NamedAPIResource](#namedapiresource) ([ContestEffect](#contest-effects)) | -| damage_class | The type of damage the move inflicts on the target, e.g. physical | [NamedAPIResource](#namedapiresource) ([MoveDamageClass](#move-damage-classes)) | -| effect_entries | The effect of this move listed in different languages | list [VerboseEffect](#verboseeffect) | -| effect_changes | The list of previous effects this move has had across version groups of the games | list [AbilityEffectChange](#abilityeffectchange) | -| generation | The generation in which this move was introduced | [NamedAPIResource](#namedapiresource) ([Generation](#generations)) | -| meta | Meta data about this move | [MoveMetaData](#movemetadata) | -| names | The name of this move listed in different languages | list [Name](#resourcename) | -| past_values | A list of move resource value changes across ersion groups of the game | list [PastMoveStatValues](#pastmovestatvalues) | -| stat_changes | A list of stats this moves effects and how much it effects them | list [MoveStatChange](#movestatchange) | -| super_contest_effect | The effect the move has when used in a super contest | [NamedAPIResource](#namedapiresource) ([ContestEffect](#contest-effects)) | -| target | The type of target that will recieve the effects of the attack | [NamedAPIResource](#namedapiresource) ([MoveTarget](#move-targets)) | -| type | The elemental type of this move | [NamedAPIResource](#namedapiresource) ([Type](#types)) | - -#### ContestComboSets - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| normal | A detail of moves this move can be used before or after, granting additional appeal points in contests | list [ContestComboDetail](#contestcombodetail) | -| super | A detail of moves this move can be used before or after, granting additional appeal points in super contests | list [ContestComboDetail](#contestcombodetail) | - -#### ContestComboDetail - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| use_before | A list of moves to use before this move | list [NamedAPIResource](#namedapiresource) ([Move](#moves)) | -| use_after | A list of moves to use after this move | list [NamedAPIResource](#namedapiresource) ([Move](#moves)) | - -#### MoveMetaData - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| ailment | The status ailment this move inflicts on its target | [NamedAPIResource](#namedapiresource) ([MoveAilment](#move-ailments)) | -| category | The category of move this move falls under, e.g. damage or ailment | [NamedAPIResource](#namedapiresource) ([Move](#moves)) | -| min_hits | The minimum number of times this move hits. Null if it always only hits once. | integer | -| max_hits | The maximum number of times this move hits. Null if it always only hits once. | integer | -| min_turns | The minimum number of turns this move continues to take effect. Null if it always only lasts one turn. | integer | -| max_turns | The maximum number of turns this move continues to take effect. Null if it always only lasts one turn. | integer | -| drain | HP drain (if positive) or Recoil damage (if negative), in percent of damage done | integer | -| healing | The amount of hp gained by the attacking pokémon, in percent of it's maximum HP | integer | -| crit_rate | Critical hit rate bonus | integer | -| ailment_chance | The likelyhood this attack will cause an ailment | integer | -| flinch_chance | The likelyhood this attack will cause the target pokémon to flinch | integer | -| stat_chance | The likelyhood this attack will cause a stat change in the target pokémon | integer | - -#### MoveStatChange - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| change | The amount of change | integer | -| stat | The stat being affected | [NamedAPIResource](#namedapiresource) ([Stat](#stats)) | - -#### PastMoveStatValues - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| accuracy | The percent value of how likely this move is to be successful | integer | -| effect_chance | The percent value of how likely it is this moves effect will take effect | integer | -| power | The base power of this move with a value of 0 if it does not have a base power | integer | -| pp | Power points. The number of times this move can be used | integer | -| effect_entries | The effect of this move listed in different languages | list [VerboseEffect](#verboseeffect) | -| type | The elemental type of this move | [NamedAPIResource](#namedapiresource) ([Type](#types)) | -| version group | The version group in which these move stat values were in effect | [NamedAPIResource](#namedapiresource) ([VersionGroup](#version-groups)) | - - -## Move Ailments -Move Ailments are status conditions caused by moves used during battle. See [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/http://bulbapedia.bulbagarden.net/wiki/Status_condition) for greater detail. - -### GET api/v2/move-ailment/{id or name} - -###### example response - -```json -{ - "id": 1, - "name": "paralysis", - "moves": [{ - "name": "thunder-punch", - "url": "http://pokeapi.co/api/v2/move/9/" - }], - "names": [{ - "name": "Paralysis", - "language": { - "name": "en", - "url": "http://pokeapi.co/api/v2/language/9/" - } - }] -} -``` - -###### response models - -#### Move Ailment - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| id | The identifier for this move ailment resource | integer | -| name | The name for this move ailment resource | string | -| moves | A list of moves that cause this ailment | list [NamedAPIResource](#namedapiresource) ([Move](#moves)) | -| names | The name of this move ailment listed in different languages | list [Name](#resourcename) | - - -## Move Battle Styles -Styles of moves when used in the Battle Palace. See [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Battle_Frontier_(Generation_III)) for greater detail. - -### GET api/v2/move-battle-style/{id or name} - -###### example response - -```json -{ - "id": 1, - "name": "attack", - "names": [{ - "name": "Attack", - "language": { - "name": "en", - "url": "http://pokeapi.co/api/v2/language/9/" - } - }] -} -``` - -###### response models - -#### Move Battle Style - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| id | The identifier for this move battle style resource | integer | -| name | The name for this move battle style resource | string | -| names | The name of this move battle style listed in different languages | list [Name](#resourcename) | - - -## Move Categories -Very general categories that loosely group move effects. - -### GET api/v2/move-category/{id or name} - -###### example response - -```json -{ - "id": 1, - "name": "ailment", - "descriptions": [{ - "description": "No damage; inflicts status ailment", - "language": { - "name": "en", - "url": "http://pokeapi.co/api/v2/language/9/" - } - }], - "moves": [{ - "name": "sing", - "url": "http://pokeapi.co/api/v2/move/47/" - }] -} -``` - -###### response models - -#### Move Category - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| id | The identifier for this move category resource | integer | -| name | The name for this move category resource | string | -| moves | A list of moves that fall into this category | list [NamedAPIResource](#namedapiresource) ([Move](#moves)) | -| descriptions | The description of this move ailment listed in different languages | list [Description](#description) | - - -## Move Damage Classes -Damage classes moves can have, e.g. physical, special, or status (non-damaging). - -### GET api/v2/move-damage-class/{id or name} - -###### example response - -```json -{ - "id": 1, - "name": "status", - "descriptions": [{ - "description": "ダメージない", - "language": { - "name": "ja", - "url": "http://pokeapi.co/api/v2/language/1/" - } - }], - "moves": [{ - "name": "swords-dance", - "url": "http://pokeapi.co/api/v2/move/14/" - }] -} -``` - -###### response models - -#### Move Damage Class - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| id | The identifier for this move damage class resource | integer | -| name | The name for this move damage class resource | string | -| descriptions | The description of this move damage class listed in different languages | list [Description](#description) | -| moves | A list of moves that fall into this damage class | list [NamedAPIResource](#namedapiresource) ([Move](#moves)) | -| names | The name of this move damage class listed in different languages | list [Name](#resourcename) | - - -## Move Learn Methods -Methods by which pokémon can learn moves. - -### GET api/v2/move-learn-method/{id or name} - -###### example response - -```json -{ - "id": 1, - "name": "level-up", - "names": [{ - "name": "Level up", - "language": { - "name": "de", - "url": "http://pokeapi.co/api/v2/language/6/" - } - }], - "descriptions": [{ - "description": "Wird gelernt, wenn ein Pokémon ein bestimmtes Level erreicht.", - "language": { - "name": "de", - "url": "http://pokeapi.co/api/v2/language/6/" - } - }], - "version_groups": [{ - "name": "red-blue", - "url": "http://pokeapi.co/api/v2/version-group/1/" - }] -} -``` - -###### response models - -#### Move Learn Method - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| id | The identifier for this move learn method resource | integer | -| name | The name for this move learn method resource | string | -| descriptions | The description of this move learn method listed in different languages | list [Description](#description) | -| names | The name of this move learn method listed in different languages | list [Name](#resourcename) | -| version_groups | A list of version groups where moves can be learned through this method | list [NamedAPIResource](#namedapiresource) ([VersionGroup](#version-groups)) | - - -## Move Targets -Targets moves can be directed at during battle. Targets can be pokémon, environments or even other moves. - -### GET api/v2/move-target/{id or name} - -###### example response - -```json -{ - "id": 1, - "name": "specific-move", - "descriptions": [{ - "description": "Eine spezifische Fähigkeit. Wie diese Fähigkeit genutzt wird hängt von den genutzten Fähigkeiten ab.", - "language": { - "name": "de", - "url": "http://pokeapi.co/api/v2/language/6/" - } - }], - "moves": [{ - "name": "counter", - "url": "http://pokeapi.co/api/v2/move/68/" - }], - "names": [{ - "name": "Spezifische Fähigkeit", - "language": { - "name": "de", - "url": "http://pokeapi.co/api/v2/language/6/" - } - }] -} -``` - -###### response models - -#### Move Target - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| id | The identifier for this move target resource | integer | -| name | The name for this move target resource | string | -| descriptions | The description of this move target listed in different languages | list [Description](#description) | -| moves | A list of moves that that are directed at this target | list [NamedAPIResource](#namedapiresource) ([Move](#moves)) | -| names | The name of this move target listed in different languages | list [Name](#resourcename) | - - - -

Locations

- -## Locations -Locations that can be visited within the games. Locations make up sizable portions of regions, like cities or routes. - -### GET api/v2/location/{id} - -###### example response - -```json -{ - "id": 1, - "name": "canalave-city", - "region": { - "name": "sinnoh", - "url": "http://pokeapi.co/api/v2/region/4/" - }, - "names": [{ - "name": "Canalave City", - "language": { - "name": "en", - "url": "http://pokeapi.co/api/v2/language/9/" - } - }], - "game_indices": [{ - "game_index": 7, - "generation": { - "name": "generation-iv", - "url": "http://pokeapi.co/api/v2/generation/4/" - } - }], - "areas": [{ - "name": "canalave-city-area", - "url": "http://pokeapi.co/api/v2/location-area/1/" - }] -} -``` - -###### response models - -#### Location - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| id | The identifier for this location resource | integer | -| name | The name for this location resource | string | -| region | The region this location can be found in | [NamedAPIResource](#namedapiresource) ([Region](#regions)) | -| names | The name of this language listed in different languages | list [Name](#resourcename) | -| game_indices | A list of game indices relevent to this location by generation | list [GenerationGameIndex](#generationgameindex) | -| areas | Areas that can be found within this location | [APIResource](#apiresource) ([LocationArea](#location-areas)) | - - -## Location Areas -Location areas are sections of areas, such as floors in a building or cave. Each area has its own set of possible pokemon encounters. - -### GET api/v2/location-area/{id} - -###### example response - -```json -{ - "id": 1, - "name": "canalave-city-area", - "game_index": 1, - "encounter_method_rates": [{ - "encounter_method": { - "name": "old-rod", - "url": "http://pokeapi.co/api/v2/encounter-method/2/" - }, - "version_details": [{ - "rate": 25, - "version": { - "name": "platinum", - "url": "http://pokeapi.co/api/v2/version/14/" - } - }] - }], - "location": { - "name": "canalave-city", - "url": "http://pokeapi.co/api/v2/location/1/" - }, - "names": [{ - "name": "", - "language": { - "name": "en", - "url": "http://pokeapi.co/api/v2/language/9/" - } - }], - "pokemon_encounters": [{ - "pokemon": { - "name": "tentacool", - "url": "http://pokeapi.co/api/v2/pokemon/72/" - }, - "version_details": [{ - "version": { - "name": "diamond", - "url": "http://pokeapi.co/api/v2/version/12/" - }, - "max_chance": 60, - "encounter_details": [{ - "min_level": 20, - "max_level": 30, - "condition_values": [], - "chance": 60, - "method": { - "name": "surf", - "url": "http://pokeapi.co/api/v2/encounter-method/5/" - } - }] - }] - }] -} -``` - -###### response models - -#### LocationArea - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| id | The identifier for this location resource | integer | -| name | The name for this location resource | string | -| game_index | The internal id of an api resource within game data | integer | -| encounter_method_rates | A list of methods in which pokémon may be encountered in this area and how likely the method will occur depending on the version of the game | list [EncounterMethodRate](#encountermethodrate) | -| location | The region this location can be found in | [NamedAPIResource](#namedapiresource) ([Region](#regions)) | -| names | The name of this location area listed in different languages | list [Name](#resourcename) | -| pokemon_encounters | A list of pokémon that can be encountered in this area along with version specific details about the encounter | list [PokemonEncounter](#pokemonencounter) | - -#### EncounterMethodRate - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| encounter_method | The method in which pokémon may be encountered in an area. | [EncounterMethod](#encountermehtod) | -| version_details | The chance of the encounter to occur on a version of the game. | list [EncounterVersionDetails](#encounterversiondetails) | - -#### EncounterVersionDetails - -| Name | Description | Data Type | -| ------- | ----------- | --------- | -| rate | The chance of an encounter to occur. | integer | -| version | The version of the game in which the encounter can occur with the given chance. | [NamedAPIResource](#namedapiresource) ([Version](#version)) | - -#### PokemonEncounter - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| pokemon | The pokémon being encountered | [NamedAPIResource](#namedapiresource) ([Pokemon](#pokemon)) | -| version_details | A list of versions and encounters with pokémon that might happen in the referenced location area | list [VersionEncounterDetail](#versionencounterdetail) | - - -## Pal Park Areas -Areas used for grouping pokémon encounters in Pal Park. They're like habitats that are specific to Pal Park. - -### GET api/v2/pal-park-area/{id or name} - -###### example response - -```json -{ - "id": 1, - "name": "forest", - "names": [{ - "name": "Forest", - "language": { - "name": "en", - "url": "http://pokeapi.co/api/v2/language/9/" - } - }], - "pokemon_encounters": [{ - "base_score": 30, - "rate": 50, - "pokemon_species": { - "name": "caterpie", - "url": "http://pokeapi.co/api/v2/pokemon-species/10/" - } - }] -} -``` - -###### response models - -#### PalParkArea - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| id | The identifier for this pal park area resource | integer | -| name | The name for this pal park area resource | string | -| names | The name of this pal park area listed in different languages | list [Name](#resourcename) | -| pokemon_encounters | A list of pokémon encountered in thi pal park area along with details | list [PalParkEncounterSpecies](#palparkencounterspecies) | - -#### PalParkEncounterSpecies - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| base_score | The base score given to the player when this pokémon is caught during a pal park run | integer | -| rate | The base rate for encountering this pokémon in this pal park area | integer | -| pokemon_species | The pokémon species being encountered | [NamedAPIResource](#namedapiresource) ([PokemonSpecies](#pokemonspecies)) | - - -## Regions -A region is an organized area of the pokémon world. Most often, the main difference between regions is the species of pokémon that can be encountered within them. - -### GET api/v2/region/{id or name} - -###### example response - -```json -{ - "id": 1, - "name": "kanto", - "locations": [{ - "name": "celadon-city", - "url": "http://pokeapi.co/api/v2/location/67/" - }], - "main_generation": { - "name": "generation-i", - "url": "http://pokeapi.co/api/v2/generation/1/" - }, - "names": [{ - "name": "Kanto", - "language": { - "name": "de", - "url": "http://pokeapi.co/api/v2/language/6/" - } - }], - "pokedexes": [{ - "name": "kanto", - "url": "http://pokeapi.co/api/v2/pokedex/2/" - }], - "version_groups": [{ - "name": "red-blue", - "url": "http://pokeapi.co/api/v2/version-group/1/" - }] -} -``` - -###### response models - -#### Region - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| id | The identifier for this region resource | integer | -| name | The name for this region resource | string | -| locations | A list of locations that can be found in this region | [NamedAPIResource](#namedapiresource) ([Location](#locations)) | -| main_generation | The generation this region was introduced in | [NamedAPIResource](#namedapiresource) ([Generation](#generations)) | -| names | The name of this region listed in different languages | list [Name](#resourcename) | -| pokedexes | A list of pokédexes that catalogue pokemon in this region | list [NamedAPIResource](#namedapiresource) ([Pokedex](#pokedexes)) | -| version_groups | A list of version groups where this region can be visited | list [NamedAPIResource](#namedapiresource) ([VersionGroup](#version-groups)) | - - -

Pokemon

- -## Abilities - -Abilities provide passive effects for pokémon in battle or in the overworld. Pokémon have mutiple possible abilities but can have only one ability at a time. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Ability) for greater detail. - -### GET api/v2/ability/{id or name} - -###### example response - -```json -{ - "id": 1, - "name": "stench", - "is_main_series": true, - "generation": { - "name": "generation-iii", - "url": "http://pokeapi.co/api/v2/generation/3/" - }, - "names": [{ - "name": "Stench", - "language": { - "name": "en", - "url": "http://pokeapi.co/api/v2/language/9/" - } - }], - "effect_entries": [{ - "effect": "This Pokémon's damaging moves have a 10% chance to make the target [flinch]{mechanic:flinch} with each hit if they do not already cause flinching as a secondary effect.\n\nThis ability does not stack with a held item.\n\nOverworld: The wild encounter rate is halved while this Pokémon is first in the party.", - "short_effect": "Has a 10% chance of making target Pokémon [flinch]{mechanic:flinch} with each hit.", - "language": { - "name": "en", - "url": "http://pokeapi.co/api/v2/language/9/" - } - }], - "effect_changes": [{ - "version_group": { - "name": "black-white", - "url": "http://pokeapi.co/api/v2/version-group/11/" - }, - "effect_entries": [{ - "effect": "Has no effect in battle.", - "language": { - "name": "en", - "url": "http://pokeapi.co/api/v2/language/9/" - } - }] - }], - "flavor_text_entries": [{ - "flavor_text": "臭くて 相手が\nひるむ ことがある。", - "language": { - "name": "ja-kanji", - "url": "http://pokeapi.co/api/v2/language/11/" - }, - "version_group": { - "name": "x-y", - "url": "http://pokeapi.co/api/v2/version-group/15/" - } - }], - "pokemon": [{ - "is_hidden": true, - "slot": 3, - "pokemon": { - "name": "gloom", - "url": "http://pokeapi.co/api/v2/pokemon/44/" - } - }] -} -``` - -###### response models - -#### Ability - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| id | The identifier for this ability resource | integer | -| name | The name for this ability resource | string | -| is_main_series | Whether or not this ability originated in the main series of the video games | boolean | -| generation | The generation this ability originated in | [NamedAPIResource](#namedapiresource) ([Generation](#generations)) | -| names | The name of this ability listed in different languages | list [Name](#resourcename) | -| effect_entries | The effect of this ability listed in different languages | list [VerboseEffect](#verboseeffect) | -| effect_changes | The list of previous effects this ability has had across version groups | list [AbilityEffectChange](#abilityeffectchange) | -| flavor_text_entries | The flavor text of this ability listed in different languages | list [VersionGroupFlavorText](#versiongroupflavortext) | -| pokemon | A list of pokémon that could potentially have this ability | list [AbilityPokemon](#abilitypokemon) | - -#### AbilityEffectChange - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| effect_entries | The previous effect of this ability listed in different languages | [Effect](#effect) | -| version_group | The version group in which the previous effect of this ability originated | [NamedAPIResource](#namedapiresource) ([VersionGroup](#versiongroups)) | - -#### AbilityFlavorText - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| flavor_text | The localized name for an api resource in a specific language | string | -| language | The language this name is in | [NamedAPIResource](#namedapiresource) ([Language](#languages)) | -| version_group | The version group that uses this flavor text | [NamedAPIResource](#namedapiresource) ([VersionGroup](#version-groups)) | - -#### AbilityPokemon - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| is_hidden | Whether or not this a hidden ability for the referenced pokémon | boolean | -| slot | Pokémon have 3 ability 'slots' which hold references to possible abilities they could have. This is the slot of this ability for the referenced pokémon. | integer | -| pokemon | The pokémon this ability could belong to | [NamedAPIResource](#namedapiresource) ([Pokemon](#pokemon)) | - - -## Characteristics -Characteristics indicate which stat contains a Pokémon's highest IV. A Pokémon's Characteristic is determined by the remainder of its highest IV divided by 5 (gene_modulo). Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Characteristic) for greater detail. - -### GET api/v2/characteristic/{id} - -###### example response - -```json -{ - "id": 1, - "gene_modulo": 0, - "possible_values": [0, 5, 10, 15, 20, 25, 30], - "highest_stat": { - "name": "hp", - "url": "http://pokeapi.co/api/v2/stat/1/" - }, - "descriptions": [{ - "description": "Loves to eat", - "language": { - "name": "en", - "url": "http://pokeapi.co/api/v2/language/9/" - } - }] -} - -``` - -###### response models - -#### Characteristic - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| id | The identifier for this characteristic resource | integer | -| gene_modulo | The remainder of the highest stat/IV divided by 5 | integer | -| possible_values | The possible values of the highest stat that would result in a pokémon recieving this characteristic when divided by 5 | list integer | -| descriptions | The descriptions of this characteristic listed in different languages | list [Description](#description) | - - -## Egg Groups -Egg Groups are categories which determine which Pokémon are able to interbreed. Pokémon may belong to either one or two Egg Groups. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Egg_Group) for greater detail. - -### GET api/v2/egg-group/{id or name} - -###### example response - -```json -{ - "id": 1, - "name": "monster", - "names": [{ - "name": "かいじゅう", - "language": { - "name": "ja", - "url": "http://pokeapi.co/api/v2/language/1/" - } - }], - "pokemon_species": [{ - "name": "bulbasaur", - "url": "http://pokeapi.co/api/v2/pokemon-species/1/" - }] -} - -``` - -###### response models - -#### EggGroup - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| id | The identifier for this egg group resource | integer | -| name | The name for this egg group resource | string | -| names | The name of this egg group listed in different languages | list [Name](#resourcename) | -| pokemon_species | A list of all pokémon species that are members of this egg group | list [NamedAPIResource](#namedapiresource) ([PokemonSpecies](#pokemon-species)) | - - -## Genders -Genders were introduced in Generation II for the purposes of breeding pokémon but can also result in visual differences or even different evolutionary lines. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Gender) for greater detail. - -### GET api/v2/gender/{id or name} - -###### example response - -```json -{ - "id": 1, - "name": "female", - "pokemon_species_details": [{ - "rate": 1, - "pokemon_species": { - "name": "bulbasaur", - "url": "http://pokeapi.co/api/v2/pokemon-species/1/" - } - }], - "required_for_evolution": [{ - "name": "wormadam", - "url": "http://pokeapi.co/api/v2/pokemon-species/413/" - }] -} - -``` - -###### response models - -#### Gender - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| id | The identifier for this gender resource | integer | -| name | The name for this gender resource | string | -| pokemon_species_details | A list of pokémon species that can be this gender and how likely it is that they will be | list [PokemonSpeciesGender](#pokemonspeciesgender) | -| required_for_evolution | A list of pokémon species that required this gender in order for a pokémon to evolve into them | list [NamedAPIResource](#namedapiresource) ([PokemonSpecies](#pokemon-species)) | - - -#### PokemonSpeciesGender - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| rate | The chance of this Pokémon being female, in eighths; or -1 for genderless | integer | -| pokemon_species | A pokemon species that can be the referenced gender | [NamedAPIResource](#namedapiresource) ([PokemonSpecies](#pokemon-species)) | - - -## Growth Rates -Growth rates are the speed with which pokémon gain levels through experience. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Experience) for greater detail. - -### GET api/v2/growth-rate/{id or name} - -###### example response - -```json -{ - "id": 1, - "name": "slow", - "formula": "\\frac{5x^3}{4}", - "descriptions": [{ - "description": "langsam", - "language": { - "name": "de", - "url": "http://pokeapi.co/api/v2/language/6/" - } - }], - "levels": [{ - "level": 100, - "experience": 1250000 - }], - "pokemon_species": [{ - "name": "growlithe", - "url": "http://pokeapi.co/api/v2/pokemon-species/58/" - }] -} -``` - -###### response models - -#### Growth Rate - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| id | The identifier for this gender resource | integer | -| name | The name for this gender resource | string | -| formula | The formula used to calculate the rate at which the pokémon species gains level | string | -| descriptions | The descriptions of this characteristic listed in different languages | list [Description](#description) | -| levels | A list of levels and the amount of experienced needed to atain them based on this growth rate | list [GrowthRateExperienceLevel](#growthrateexperiencelevel) | -| pokemon_species | A list of pokémon species that gain levels at this growth rate | list [NamedAPIResource](#namedapiresource) ([PokemonSpecies](#pokemon-species)) | - -#### GrowthRateExperienceLevel - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| level | The level gained | integer | -| experience | The amount of experience required to reach the referenced level | integer | - - -## Natures -Natures influence how a pokémon's stats grow. See [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Nature) for greater detail. - -### GET api/v2/nature/{id or name} - -###### example response - -```json -{ - "id": 2, - "name": "bold", - "decreased_stat": { - "name": "attack", - "url": "http://pokeapi.co/api/v2/stat/2/" - }, - "increased_stat": { - "name": "defense", - "url": "http://pokeapi.co/api/v2/stat/3/" - }, - "likes_flavor": { - "name": "sour", - "url": "http://pokeapi.co/api/v2/berry-flavor/5/" - }, - "hates_flavor": { - "name": "spicy", - "url": "http://pokeapi.co/api/v2/berry-flavor/1/" - }, - "pokeathlon_stat_changes": [{ - "max_change": -2, - "pokeathlon_stat": { - "name": "speed", - "url": "http://pokeapi.co/api/v2/pokeathlon-stat/1/" - } - }], - "move_battle_style_preferences": [{ - "low_hp_preference": 32, - "high_hp_preference": 30, - "move_battle_style": { - "name": "attack", - "url": "http://pokeapi.co/api/v2/move-battle-style/1/" - } - }], - "names": [{ - "name": "ずぶとい", - "language": { - "name": "ja", - "url": "http://pokeapi.co/api/v2/language/1/" - } - }] -} -``` - -###### response models - -#### Nature - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| id | The identifier for this nature resource | integer | -| name | The name for this nature resource | string | -| decreased_stat | The stat decreased by 10% in pokémon with this nature | [NamedAPIResource](#namedapiresource) ([Stat](#stats)) | -| increased_stat | The stat increased by 10% in pokémon with this nature | [NamedAPIResource](#namedapiresource) ([Stat](#stats)) | -| hates_flavor | The flavor hated by pokémon with this nature | [NamedAPIResource](#namedapiresource) ([BerryFlavor](#berry-flavors)) | -| likes_flavor | The flavor liked by pokémon with this nature | [NamedAPIResource](#namedapiresource) ([BerryFlavor](#berry-flavors)) | -| pokeathlon_stat_changes | A list of pokéathlon stats this nature effects and how much it effects them | list [NatureStatChange](#naturestatchange) | -| move_battle_style_preferences | A list of battle styles and how likely a pokémon with this nature is to use them in the Battle Palace or Battle Tent. | list [MoveBattleStylePreference](#movebattlestylepreference) | -| names | The name of this nature listed in different languages | list [Name](#resourcename) | - -#### NatureStatChange - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| change | The amount of change | integer | -| stat | The stat being affected | [NamedAPIResource](#namedapiresource) ([PokeathlonStat](#pokeathlon-stats)) | - -#### MoveBattleStylePreference - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| low_hp_preference | Chance of using the move, in percent, if HP is under one half | integer | -| high_hp_preference | Chance of using the move, in percent, if HP is over one half | integer | -| move_battle_style | The move battle style | [NamedAPIResource](#namedapiresource) ([MoveBattleStyle](#move-battle-styles)) | - - -## Pokéathlon Stats -Pokéathlon Stats are different attributes of a pokémon's performance in pokeathlons. In Pokéathlons, competitions happen on different courses; one for each of the different pokeathlon stats. See [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Pokéathlon) for greater detail. - -### GET api/v2/pokeathlon-stat/{id or name} - -###### example response - -```json -{ - "id": 1, - "name": "speed", - "affecting_natures": { - "increase": [{ - "max_change": 2, - "nature": { - "name": "timid", - "url": "http://pokeapi.co/api/v2/nature/5/" - } - }], - "decrease": [{ - "max_change": -1, - "nature": { - "name": "hardy", - "url": "http://pokeapi.co/api/v2/nature/1/" - } - }] - }, - "names": [{ - "name": "Speed", - "language": { - "name": "en", - "url": "http://pokeapi.co/api/v2/language/9/" - } - }] -} -``` - -###### response models - -#### PokeathlonStat - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| id | The identifier for this pokéathlon stat resource | integer | -| name | The name for this pokéathlon stat resource | string | -| names | The name of this pokéathlon stat listed in different languages | list [Name](#resourcename) | -| affecting_natures | A detail of natures which affect this pokéathlon stat positively or negatively | [NaturePokeathlonStatAffectSets](#naturepokeathlonstataffectsets) | - -#### NaturePokeathlonStatAffectSets - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| increase | A list of natures and how they change the referenced pokéathlon stat | list [NaturePokeathlonStatAffect](#naturepokeathlonstataffect) | -| decrease | A list of natures and how they change the referenced pokéathlon stat | list [NaturePokeathlonStatAffect](#naturepokeathlonstataffect) | - -#### NaturePokeathlonStatAffect - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| max_change | The maximum amount of change to the referenced pokéathlon stat | integer | -| nature | The nature causing the change | [NamedAPIResource](#namedapiresource) ([Nature](#natures)) | - - - -## Pokémon -Pokémon are the creatures that inhabit the world of the pokemon games. They can be caught using pokéballs and trained by battling with other pokémon. See [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Pokémon_(species)) for greater detail. - -### GET api/v2/pokemon/{id or name} - -###### example response - -```json -{ - "id": 35, - "name": "clefairy", - "base_experience": 113, - "height": 6, - "is_default": true, - "order": 56, - "weight": 75, - "abilities": [{ - "is_hidden": true, - "slot": 3, - "ability": { - "name": "friend-guard", - "url": "https://pokeapi.co/api/v2/ability/132/" - } - }], - "forms": [{ - "name": "clefairy", - "url": "https://pokeapi.co/api/v2/pokemon-form/35/" - }], - "game_indices": [{ - "game_index": 35, - "version": { - "name": "white-2", - "url": "https://pokeapi.co/api/v2/version/22/" - } - }], - "held_items": [{ - "item": { - "name": "moon-stone", - "url": "https://pokeapi.co/api/v2/item/81/" - }, - "version_details": [{ - "rarity": 5, - "version": { - "name": "ruby", - "url": "https://pokeapi.co/api/v2/version/7/" - } - }] - }], - "location_area_encounters": "/api/v2/pokemon/35/encounters", - "moves": [{ - "move": { - "name": "pound", - "url": "https://pokeapi.co/api/v2/move/1/" - }, - "version_group_details": [{ - "level_learned_at": 1, - "version_group": { - "name": "red-blue", - "url": "https://pokeapi.co/api/v2/version-group/1/" - }, - "move_learn_method": { - "name": "level-up", - "url": "https://pokeapi.co/api/v2/move-learn-method/1/" - } - }] - }], - "species": { - "name": "clefairy", - "url": "https://pokeapi.co/api/v2/pokemon-species/35/" - }, - "stats": [{ - "base_stat": 35, - "effort": 0, - "stat": { - "name": "speed", - "url": "https://pokeapi.co/api/v2/stat/6/" - } - }], - "types": [{ - "slot": 1, - "type": { - "name": "fairy", - "url": "https://pokeapi.co/api/v2/type/18/" - } - }], - "past_types": [{ - "generation": { - "name": "generation-v", - "url": "https://pokeapi.co/api/v2/generation/5/" - }, - "types": [ - { - "slot": 1, - "type": { - "name": "normal", - "url": "https://pokeapi.co/api/v2/type/1/" - } - } - ] - }] -} -``` - -###### response models - -#### Pokemon - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| id | The identifier for this pokémon resource | integer | -| name | The name for this pokémon resource | string | -| base_experience | The base experience gained for defeating this pokémon | integer | -| height | The height of this pokémon | integer | -| is_default | Set for exactly one pokémon used as the default for each species | boolean | -| order | Order for sorting. Almost national order, except families are grouped together. | integer | -| weight | The mass of this pokémon | integer | -| abilities | A list of abilities this pokémon could potentially have | list [PokemonAbility](#pokemonability) | -| forms | A list of forms this pokémon can take on | list [NamedAPIResource](#namedapiresource) ([PokemonForm](#pokemon-forms)) | -| game_indices | A list of game indices relevent to pokémon item by generation | list [VersionGameIndex](#versiongameindex) | -| held_items | A list of items this pokémon may be holding when encountered | list [NamedAPIResource](#namedapiresource) ([Item](#items)) | -| location_area_encounters | A list of location areas as well as encounter details pertaining to specific versions | list [LocationAreaEncounter](#locationareaencounter) | -| moves | A list of moves along with learn methods and level details pertaining to specific version groups | list [NamedAPIResource](#namedapiresource) ([Move](#moves)) | -| species | The species this pokémon belongs to | [NamedAPIResource](#namedapiresource) ([PokemonSpecies](#pokemon-species)) | -| stats | A list of base stat values for this pokémon | list [NamedAPIResource](#namedapiresource) ([Stat](#stats)) | -| types | A list of details showing types this pokémon has | list [PokemonType](#pokemontype) | -| past_types | A list of details showing types this pokémon had in previous generations | list [PokemonTypePast](#pokemontypepast) | - -#### PokemonAbility - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| is_hidden | Whether or not this is a hidden ability | boolean | -| slot | The slot this ability occupies in this pokémon species | integer | -| ability | The ability the pokémon may have | [NamedAPIResource](#namedapiresource) ([Ability](#abilities)) | - -#### PokemonType - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| slot | The order the pokémon types are listed in | integer | -| type | The type the referenced pokémon has | string | - -#### PokemonFormType - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| slot | The order the Pokémon form types are listed in | integer | -| type | The type the referenced Pokémon form has | string | - -#### PokemonTypePast - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| generation | The last generation in which the referenced pokémon had the listed types | [NamedAPIResource](#namedapiresource) ([Generation](#generations)) | -| types | The types the referenced pokémon had up to and including the listed generation | list [PokemonType](#pokemontype) | - -#### LocationAreaEncounter - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| location_area | The location area the referenced pokémon can be encountered in | [APIResource](#apiresource) ([LocationArea](#location-areas)) | -| version_details | A list of versions and encounters with the referenced pokémon that might happen | list [VersionEncounterDetail](#versionencounterdetail) | - - -## Pokémon Colors -Colors used for sorting pokémon in a pokédex. The color listed in the Pokédex is usually the color most apparent or covering each Pokémon's body. No orange category exists; Pokémon that are primarily orange are listed as red or brown. - -### GET api/v2/pokemon-color/{id or name} - -###### example response - -```json -{ - "id": 1, - "name": "black", - "names": [{ - "name": "黒い", - "language": { - "name": "ja", - "url": "http://pokeapi.co/api/v2/language/1/" - } - }], - "pokemon_species": [{ - "name": "snorlax", - "url": "http://pokeapi.co/api/v2/pokemon-species/143/" - }] -} -``` - -###### response models - -#### PokemonColor - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| id | The identifier for this pokémon color resource | integer | -| name | The name for this pokémon color resource | string | -| names | The name of this pokémon color listed in different languages | list [Name](#resourcename) | -| pokemon_species | A list of the pokémon species that have this color | list [NamedAPIResource](#namedapiresource) ([PokemonSpecies](#pokemon-species)) | - - -## Pokémon Forms -Some pokémon have the ability to take on different forms. At times, these differences are purely cosmetic and have no bearing on the difference in the Pokémon's stats from another; however, several Pokémon differ in stats (other than HP), type, and Ability depending on their form. - -### GET api/v2/pokemon-form/{id or name} - -###### example response - -```json -{ - "id": 10041, - "name": "arceus-bug", - "order": 631, - "form_order": 7, - "is_default": false, - "is_battle_only": false, - "is_mega": false, - "form_name": "bug", - "pokemon": { - "name": "arceus", - "url": "https://pokeapi.co/api/v2/pokemon/493/" - }, - "version_group": { - "name": "diamond-pearl", - "url": "https://pokeapi.co/api/v2/version-group/8/" - }, - "types": [ - { - "slot": 1, - "type": { - "name": "bug", - "url": "https://pokeapi.co/api/v2/type/7/" - } - } - ] -} -``` - -###### response models - -#### PokemonForm - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| id | The identifier for this pokémon form resource | integer | -| name | The name for this pokémon form resource | string | -| order | The order in which forms should be sorted within all forms. Multiple forms may have equal order, in which case they should fall back on sorting by name. | integer | -| form_order | The order in which forms should be sorted within a species' forms | integer | -| is_default | True for exactly one form used as the default for each pokémon | boolean | -| is_battle_only | Whether or not this form can only happen during battle | boolean | -| is_mega | Whether or not this form requires mega evolution | boolean | -| form_name | The name of this form | string | -| pokemon | The pokémon that can take on this form | [NamedAPIResource](#namedapiresource) ([Pokemon](#pokemon)) | -| version_group | The version group this pokémon form was introduced in | [NamedAPIResource](#namedapiresource) ([VersionGroup](#version-groups)) | -| types | A list of details showing types this Pokémon form has, if they differ from the types of the Pokémon that can take on this form | list [PokemonFormType](#pokemonformtype) | - - -## Pokémon Habitats -Habitats are generally different terrain pokémon can be found in but can also be areas designated for rare or legendary pokémon. - -### GET api/v2/pokemon-habitat/{id or name} - -###### example response - -```json -{ - "id": 1, - "name": "cave", - "names": [ - { - "name": "grottes", - "language": { - "name": "fr", - "url": "http://pokeapi.co/api/v2/language/5/" - } - } - ], - "pokemon_species": [ - { - "name": "zubat", - "url": "http://pokeapi.co/api/v2/pokemon-species/41/" - } - ] -} -``` - -###### response models - -#### PokemonHabitat - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| id | The identifier for this pokémon habitat resource | integer | -| name | The name for this pokémon habitat resource | string | -| names | The name of this pokémon habitat listed in different languages | list [Name](#resourcename) | -| pokemon_species | A list of the pokémon species that can be found in this habitat | list [NamedAPIResource](#namedapiresource) ([PokemonSpecies](#pokemon-species)) | - - -## Pokémon Shapes -Shapes used for sorting pokémon in a pokédex. - -### GET api/v2/pokemon-shape/{id or name} - -###### example response - -```json -{ - "id": 1, - "name": "ball", - "awesome_names": [ - { - "awesome_name": "Pomaceous", - "language": { - "name": "en", - "url": "http://pokeapi.co/api/v2/language/9/" - } - } - ], - "names": [ - { - "name": "Ball", - "language": { - "name": "en", - "url": "http://pokeapi.co/api/v2/language/9/" - } - } - ], - "pokemon_species": [ - { - "name": "shellder", - "url": "http://pokeapi.co/api/v2/pokemon-species/90/" - } - ] -} -``` - -###### response models - -#### PokemonShape - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| id | The identifier for this pokémon shape resource | integer | -| name | The name for this pokémon shape resource | string | -| awesome_names | The "scientific" name of this pokémon shape listed in different languages | list [AwesomeName](#awesomename) | -| names | The name of this pokémon shape listed in different languages | list [Name](#resourcename) | -| pokemon_species | A list of the pokémon species that have this shape | list [NamedAPIResource](#namedapiresource) ([PokemonSpecies](#pokemon-species)) | - -#### AwesomeName - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| awesome_name | The localized "scientific" name for an api resource in a specific language | string | -| language | The language this "scientific" name is in | [NamedAPIResource](#namedapiresource) ([Language](#languages)) | - - -## Pokémon Species -A Pokémon Species forms the basis for at least one pokémon. Attributes of a Pokémon species are shared across all varieties of pokémon within the species. A good example is Wormadam; Wormadam is the species which can be found in three different varieties, Wormadam-Trash, Wormadam-Sandy and Wormadam-Plant. - -### GET api/v2/pokemon-species/{id or name} - -###### example response - -```json -{ - "id": 413, - "name": "wormadam", - "order": 441, - "gender_rate": 8, - "capture_rate": 45, - "base_happiness": 70, - "is_baby": false, - "hatch_counter": 15, - "has_gender_differences": false, - "forms_switchable": false, - "growth_rate": { - "name": "medium", - "url": "http://pokeapi.co/api/v2/growth-rate/2/" - }, - "pokedex_numbers": [{ - "entry_number": 45, - "pokedex": { - "name": "kalos-central", - "url": "http://pokeapi.co/api/v2/pokedex/12/" - } - }], - "egg_groups": [{ - "name": "bug", - "url": "http://pokeapi.co/api/v2/egg-group/3/" - }], - "color": { - "name": "gray", - "url": "http://pokeapi.co/api/v2/pokemon-color/4/" - }, - "shape": { - "name": "squiggle", - "url": "http://pokeapi.co/api/v2/pokemon-shape/2/" - }, - "evolves_from_species": { - "name": "burmy", - "url": "http://pokeapi.co/api/v2/pokemon-species/412/" - }, - "evolution_chain": { - "url": "http://pokeapi.co/api/v2/evolution-chain/213/" - }, - "habitat": null, - "generation": { - "name": "generation-iv", - "url": "http://pokeapi.co/api/v2/generation/4/" - }, - "names": [{ - "name": "Wormadam", - "language": { - "name": "en", - "url": "http://pokeapi.co/api/v2/language/9/" - } - }], - "form_descriptions": [{ - "description": "Forms have different stats and movepools. During evolution, Burmy's current cloak becomes Wormadam's form, and can no longer be changed.", - "language": { - "name": "en", - "url": "http://pokeapi.co/api/v2/language/9/" - } - }], - "genera": [{ - "genus": "Bagworm", - "language": { - "name": "en", - "url": "http://pokeapi.co/api/v2/language/9/" - } - }], - "varieties": [{ - "is_default": true, - "pokemon": { - "name": "wormadam-plant", - "url": "http://pokeapi.co/api/v2/pokemon/413/" - } - }] -} -``` - -###### response models - -#### PokemonSpecies - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| id | The identifier for this pokémon species resource | integer | -| name | The name for this pokémon species resource | string | -| order | The order in which species should be sorted. Based on National Dex order, except families are grouped together and sorted by stage. | integer | -| gender_rate | The chance of this Pokémon being female, in eighths; or -1 for genderless | integer | -| capture_rate | The base capture rate; up to 255. The higher the number, the easier the catch. | integer | -| base_happiness | The happiness when caught by a normal pokéball; up to 255. The higher the number, the happier the pokémon. | integer | -| is_baby | Whether or not this is a baby pokémon | boolean | -| hatch_counter | Initial hatch counter: one must walk 255 × (hatch_counter + 1) steps before this Pokémon's egg hatches, unless utilizing bonuses like Flame Body's | integer | -| has_gender_differences | Whether or not this pokémon can have different genders | boolean | -| forms_switchable | Whether or not this pokémon has multiple forms and can switch between them | boolean | -| growth_rate | The rate at which this pokémon species gains levels | [NamedAPIResource](#namedapiresource) ([GrowthRate](#growth-rates)) | -| pokedex_numbers | A list of pokedexes and the indexes reserved within them for this pokémon species | list [PokemonSpeciesDexEntry](#pokemonspeciesdexentry) | -| egg_groups | A list of egg groups this pokémon species is a member of | list [NamedAPIResource](#namedapiresource) ([EggGroup](#egg-groups)) | -| color | The color of this pokémon for gimmicky pokedex search | list [NamedAPIResource](#namedapiresource) ([PokemonColor](#pokemon-colors)) | -| shape | The shape of this pokémon for gimmicky pokedex search | list [NamedAPIResource](#namedapiresource) ([PokemonShape](#pokemon-shapes)) | -| evolves_from_species | The pokémon species that evolves into this pokemon_species | [NamedAPIResource](#namedapiresource) ([PokemonSpecies](#pokemon-species)) | -| evolution_chain | The evolution chain this pokémon species is a member of | [APIResource](#apiresource) ([EvolutionChain](#evolution-chains)) | -| habitat | The habitat this pokémon species can be encountered in | [NamedAPIResource](#namedapiresource) ([PokemonHabitat](#pokemon-habitats)) | -| generation | The generation this pokémon species was introduced in | [NamedAPIResource](#namedapiresource) ([Generation](#generations)) | -| names | The name of this pokémon species listed in different languages | list [Name](#resourcename) | -| pal_park_encounters | A list of encounters that can be had with this pokémon species in pal park | list [PalParkEncounterArea](#palparkencounterarea) | -| form_descriptions | Descriptions of different forms pokémon take on within the pokémon species | list [Description](#description) | -| genera | The genus of this pokémon species listed in multiple languages | [Genus](#genus) | -| varieties | A list of the pokémon that exist within this pokémon species | list [NamedAPIResource](#namedapiresource) ([Pokemon](#pokemon)) | - -#### Genus - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| genus | The localized genus for the referenced pokémon species | string | -| language | The language this genus is in | [NamedAPIResource](#namedapiresource) ([Language](#languages)) | - -#### PokemonSpeciesDexEntry - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| entry_number | The index number within the pokédex | integer | -| name | The pokédex the referenced pokémon species can be found in | [NamedAPIResource](#namedapiresource) ([Pokedex](#pokedexes)) | - -#### PalParkEncounterArea - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| base_score | The base score given to the player when the referenced pokemon is caught during a pal park run | integer | -| rate | The base rate for encountering the referenced pokemon in this pal park area | integer | -| area | The pal park area where this encounter happens | [NamedAPIResource](#namedapiresource) ([PalParkArea](#pal-park-areas)) | - - -## Stats -Stats determine certain aspects of battles. Each pokémon has a value for each stat which grows as they gain levels and can be altered momenarily by effects in battles. - -### GET api/v2/stat/{id or name} - -###### example response - -```json -{ - "id": 2, - "name": "attack", - "game_index": 2, - "is_battle_only": false, - "affecting_moves": { - "increase": [{ - "change": 2, - "move": { - "name": "swords-dance", - "url": "http://pokeapi.co/api/v2/move/14/" - } - }], - "decrease": [{ - "change": -1, - "move": { - "name": "growl", - "url": "http://pokeapi.co/api/v2/move/45/" - } - }] - }, - "affecting_natures": { - "increase": [{ - "name": "lonely", - "url": "http://pokeapi.co/api/v2/nature/6/" - }], - "decrease": [{ - "name": "bold", - "url": "http://pokeapi.co/api/v2/nature/2/" - }] - }, - "characteristics": [{ - "url": "http://pokeapi.co/api/v2/characteristic/2/" - }], - "move_damage_class": { - "name": "physical", - "url": "http://pokeapi.co/api/v2/move-damage-class/2/" - }, - "names": [{ - "name": "こうげき", - "language": { - "name": "ja", - "url": "http://pokeapi.co/api/v2/language/1/" - } - }] -} -``` - -###### response models - -#### Stat - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| id | The identifier for this stat resource | integer | -| name | The name for this stat resource | string | -| game_index | ID the games use for this stat | integer | -| is_battle_only | Whether this stat only exists within a battle | boolean | -| affecting_moves | A detail of moves which affect this stat positively or negatively | [MoveStatAffectSets](#movestataffectsets) | -| affecting_natures | A detail of natures which affect this stat positively or negatively | [NatureStatAffectSets](#naturestataffectsets) | -| characteristics | A list of characteristics that are set on a pokemon when its highest base stat is this stat | list [APIResource](#apiresource) ([Characteristic](#characteristics)) | -| move_damage_class | The class of damage this stat is directly related to | [NamedAPIResource](#namedapiresource) ([MoveDamageClass](#move-damage-classes)) | -| names | The name of this region listed in different languages | list [Name](#resourcename) | - -#### MoveStatAffectSets - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| increase | A list of moves and how they change the referenced stat | list [MoveStatAffect](#movestataffect) | -| decrease | A list of moves and how they change the referenced stat | list [MoveStatAffect](#movestataffect) | - -#### MoveStatAffect - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| max_change | The maximum amount of change to the referenced stat | integer | -| move | The move causing the change | [NamedAPIResource](#namedapiresource) ([Move](#moves)) | - -#### NatureStatAffectSets - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| increase | A list of natures and how they change the referenced stat | list [NatureStatAffect](#naturestataffect) | -| decrease | A list of natures and how they change the referenced stat | list [NatureStatAffect](#naturestataffect) | - -#### NatureStatAffect - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| max_change | The maximum amount of change to the referenced stat | integer | -| nature | The nature causing the change | [NamedAPIResource](#namedapiresource) ([Nature](#natures)) | - - - - -## Types -Types are properties for Pokémon and their moves. Each type has three properties: which types of Pokémon it is super effective against, which types of Pokémon it is not very effective against, and which types of Pokémon it is completely ineffective against. - -### GET api/v2/type/{id or name} - -###### example response - -```json -{ - "id": 8, - "name": "ghost", - "damage_relations": { - "no_damage_to": [ - { - "name": "normal", - "url": "https://pokeapi.co/api/v2/type/1/" - } - ], - "half_damage_to": [ - { - "name": "dark", - "url": "https://pokeapi.co/api/v2/type/17/" - } - ], - "double_damage_to": [ - { - "name": "ghost", - "url": "https://pokeapi.co/api/v2/type/8/" - } - ], - "no_damage_from": [ - { - "name": "normal", - "url": "https://pokeapi.co/api/v2/type/1/" - } - ], - "half_damage_from": [ - { - "name": "poison", - "url": "https://pokeapi.co/api/v2/type/4/" - } - ], - "double_damage_from": [ - { - "name": "ghost", - "url": "https://pokeapi.co/api/v2/type/8/" - } - ] - }, - "past_damage_relations": [ - { - "generation": { - "name": "generation-v", - "url": "https://pokeapi.co/api/v2/generation/5/" - }, - "damage_relations": { - "no_damage_to": [ - { - "name": "normal", - "url": "https://pokeapi.co/api/v2/type/1/" - } - ], - "half_damage_to": [ - { - "name": "steel", - "url": "https://pokeapi.co/api/v2/type/9/" - } - ], - "double_damage_to": [ - { - "name": "ghost", - "url": "https://pokeapi.co/api/v2/type/8/" - } - ], - "no_damage_from": [ - { - "name": "normal", - "url": "https://pokeapi.co/api/v2/type/1/" - } - ], - "half_damage_from": [ - { - "name": "poison", - "url": "https://pokeapi.co/api/v2/type/4/" - } - ], - "double_damage_from": [ - { - "name": "ghost", - "url": "https://pokeapi.co/api/v2/type/8/" - } - ] - } - } - ], - "game_indices": [ - { - "game_index": 8, - "generation": { - "name": "generation-i", - "url": "https://pokeapi.co/api/v2/generation/1/" - } - } - ], - "generation": { - "name": "generation-i", - "url": "https://pokeapi.co/api/v2/generation/1/" - }, - "move_damage_class": { - "name": "physical", - "url": "https://pokeapi.co/api/v2/move-damage-class/2/" - }, - "names": [ - { - "name": "ゴースト", - "language": { - "name": "ja-Hrkt", - "url": "https://pokeapi.co/api/v2/language/1/" - } - } - ], - "pokemon": [ - { - "slot": 1, - "pokemon": { - "name": "gastly", - "url": "https://pokeapi.co/api/v2/pokemon/92/" - } - } - ], - "moves": [ - { - "name": "night-shade", - "url": "https://pokeapi.co/api/v2/move/101/" - } - ] -} -``` - -###### response models - -#### Type - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| id | The identifier for this type resource | integer | -| name | The name for this type resource | string | -| damage_relations | A detail of how effective this type is toward others and vice versa | [TypeRelations](#typerelations) | -| past_damage_relations | A list of details of how effective this type was toward others and vice versa in previous generations | list [TypeRelationsPast](#typerelationspast) | -| game_indices | A list of game indices relevent to this item by generation | list [GenerationGameIndex](#generationgameindex) | -| generation | The generation this type was introduced in | [NamedAPIResource](#namedapiresource) ([Generation](#generations)) | -| move_damage_class | The class of damage inflicted by this type | [NamedAPIResource](#namedapiresource) ([MoveDamageClass](#move-damage-classes)) | -| names | The name of this type listed in different languages | list [Name](#resourcename) | -| pokemon | A list of details of pokemon that have this type | [TypePokemon](#typepokemon) | -| moves | A list of moves that have this type | list [NamedAPIResource](#namedapiresource) ([Move](#moves)) | - -#### TypePokemon - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| slot | The order the pokemons types are listed in | integer | -| pokemon | The pokemon that has the referenced type | [NamedAPIResource](#namedapiresource) ([Pokemon](#pokemon)) | - -#### TypeRelations - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| no_damage_to | A list of types this type has no effect on | list [NamedAPIResource](#namedapiresource) ([Type](#types)) | -| half_damage_to | A list of types this type is not very effect against | list [NamedAPIResource](#namedapiresource) ([Type](#types)) | -| double_damage_to | A list of types this type is very effect against | list [NamedAPIResource](#namedapiresource) ([Type](#types)) | -| no_damage_from | A list of types that have no effect on this type | list [NamedAPIResource](#namedapiresource) ([Type](#types)) | -| half_damage_from | A list of types that are not very effective against this type | list [NamedAPIResource](#namedapiresource) ([Type](#types)) | -| double_damage_from | A list of types that are very effective against this type | list [NamedAPIResource](#namedapiresource) ([Type](#types)) | - -#### TypeRelationsPast - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| generation | The last generation in which the referenced type had the listed damage relations | [NamedAPIResource](#namedapiresource) ([Generation](#generations)) | -| damage_relations | The damage relations the referenced type had up to and including the listed generation | list [TypeRelations](#typerelations) | - - -

Utility

- -## Languages -Languages for translations of api resource information. - -### GET api/v2/language/{id or name} - -###### example response - -```json -{ - "id": 1, - "name": "ja", - "official": true, - "iso639": "ja", - "iso3166": "jp", - "names": [{ - "name": "Japanese", - "language": { - "name": "en", - "url": "http://pokeapi.co/api/v2/language/9/" - } - }] -} -``` - -###### response models - -#### Language - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| id | The identifier for this language resource | integer | -| name | The name for this language resource | string | -| official | Whether or not the games are published in this language | boolean | -| iso639 | The two-letter code of the country where this language is spoken. Note that it is not unique. | string | -| iso3166 | The two-letter code of the language. Note that it is not unique. | string | -| names | The name of this language listed in different languages | list [Name](#resourcename) | - - - -## Common Models - -#### APIResource - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| url | The url of the referenced resource | string | - - -#### Description - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| description | The localized description for an api resource in a specific language | string | -| language | The language this description is in | [NamedAPIResource](#namedapiresource) ([Language](#languages)) | - - -#### Effect - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| effect | The localized effect text for an api resource in a specific language | string | -| language | The language this effect is in | [NamedAPIResource](#namedapiresource) ([Language](#language)) | - - -#### Encounter - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| min_level | The lowest level the pokemon could be encountered at | integer | -| max_level | The highest level the pokemon could be encountered at | integer | -| condition_values | A list of condition values that must be in effect for this encounter to occur | list [NamedAPIResource](#namedapiresource) ([EncounterConditionValue](#encounter-condition-values)) | -| chance | percent chance that this encounter will occur | integer | -| method | The method by which this encounter happens | [NamedAPIResource](#namedapiresource) ([EncounterMethod](#encounter-methods)) | - - -#### FlavorText - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| flavor_text | The localized name for an api resource in a specific language | string | -| language | The language this flavor text is in | [NamedAPIResource](#namedapiresource) ([Language](#languages)) | - - -#### GenerationGameIndex - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| game_index | The internal id of an api resource within game data | integer | -| generation | The generation relevent to this game index | [NamedAPIResource](#namedapiresource) ([Generation](#generations)) | - -#### Name - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| name | The localized name for an api resource in a specific language | string | -| language | The language this name is in | [NamedAPIResource](#namedapiresource) ([Language](#languages)) | - - -#### NamedAPIResource - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| name | The name of the referenced resource | string | -| url | The url of the referenced resource | string | - - -#### VerboseEffect - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| effect | The localized effect text for an api resource in a specific language | string | -| short_effect | The localized effect text in brief | string | -| language | The language this effect is in | [NamedAPIResource](#namedapiresource) ([Language](#languages)) | - - -#### VersionEncounterDetail - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| version | The game version this encounter happens in | [NamedAPIResource](#namedapiresource) ([Version](#versions)) | -| max_chance | The total percentage of all encounter potential | integer | -| encounter_details | A list of encounters and their specifics | list [Encounter](#encounters) | - - -#### VersionGameIndex - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| game_index | The internal id of an api resource within game data | integer | -| version | The version relevant to this game index | [NamedAPIResource](#namedapiresource) ([Version](#versions)) | - - -#### VersionGroupFlavorText - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| text | The localized name for an api resource in a specific language | string | -| language | The language this name is in | [NamedAPIResource](#namedapiresource) ([Language](#languages)) | -| version_group | The version group which uses this flavor text | [NamedAPIResource](#namedapiresource) ([VersionGroup](#version-groups)) | - - +https://pokeapi.co/docs/v2 From 69a10a04c80c76ab2bb37818535f5c81f2d02f5d Mon Sep 17 00:00:00 2001 From: Naramsim Date: Sat, 4 May 2024 21:53:02 +0200 Subject: [PATCH 63/76] fix: add rust and cargo --- Resources/docker/app/Dockerfile | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Resources/docker/app/Dockerfile b/Resources/docker/app/Dockerfile index c2d72940..27ee6489 100644 --- a/Resources/docker/app/Dockerfile +++ b/Resources/docker/app/Dockerfile @@ -7,11 +7,10 @@ RUN mkdir /code WORKDIR /code ADD requirements.txt /code/ -RUN \ - apk add --no-cache postgresql-libs libstdc++ && \ - apk add --no-cache --virtual .build-deps gcc g++ musl-dev postgresql-dev && \ - python3 -m pip install -r requirements.txt --no-cache-dir && \ - apk --purge del .build-deps +RUN apk add --no-cache postgresql-libs libstdc++ +RUN apk add --no-cache --virtual .build-deps gcc g++ musl-dev postgresql-dev rust cargo +RUN python3 -m pip install -r requirements.txt --no-cache-dir && \ +RUN apk --purge del .build-deps ADD . /code/ RUN addgroup -g 1000 -S pokeapi && \ From 66a381fa51e52b3fb8c81fafe2c164065e1868b0 Mon Sep 17 00:00:00 2001 From: Naramsim Date: Sat, 4 May 2024 21:56:25 +0200 Subject: [PATCH 64/76] fix: remove && --- Resources/docker/app/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Resources/docker/app/Dockerfile b/Resources/docker/app/Dockerfile index 27ee6489..99350291 100644 --- a/Resources/docker/app/Dockerfile +++ b/Resources/docker/app/Dockerfile @@ -9,7 +9,7 @@ WORKDIR /code ADD requirements.txt /code/ RUN apk add --no-cache postgresql-libs libstdc++ RUN apk add --no-cache --virtual .build-deps gcc g++ musl-dev postgresql-dev rust cargo -RUN python3 -m pip install -r requirements.txt --no-cache-dir && \ +RUN python3 -m pip install -r requirements.txt --no-cache-dir RUN apk --purge del .build-deps ADD . /code/ From b2ef3eba0f562802d85404051a2c0a6e3df7075a Mon Sep 17 00:00:00 2001 From: Naramsim Date: Sat, 4 May 2024 22:09:03 +0200 Subject: [PATCH 65/76] fix: merge in one command and delete .build-deps --- Resources/docker/app/Dockerfile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Resources/docker/app/Dockerfile b/Resources/docker/app/Dockerfile index 99350291..a8d2ac4d 100644 --- a/Resources/docker/app/Dockerfile +++ b/Resources/docker/app/Dockerfile @@ -8,9 +8,10 @@ WORKDIR /code ADD requirements.txt /code/ RUN apk add --no-cache postgresql-libs libstdc++ -RUN apk add --no-cache --virtual .build-deps gcc g++ musl-dev postgresql-dev rust cargo -RUN python3 -m pip install -r requirements.txt --no-cache-dir -RUN apk --purge del .build-deps +RUN apk add --no-cache --virtual .build-deps gcc g++ musl-dev \ + postgresql-dev rust cargo && \ + python3 -m pip install -r requirements.txt --no-cache-dir && \ + apk --purge del .build-deps ADD . /code/ RUN addgroup -g 1000 -S pokeapi && \ From 8088236c6fc5465128634db741bf06b77a251f6f Mon Sep 17 00:00:00 2001 From: Naramsim Date: Sat, 4 May 2024 22:52:51 +0200 Subject: [PATCH 66/76] cicd: build other platforms but armv6 --- .github/workflows/docker-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index cfdf1888..e510d814 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -35,7 +35,7 @@ jobs: context: . file: ./Resources/docker/app/Dockerfile push: false - platforms: local + platforms: local,linux/amd64,linux/arm64,linux/ppc64le,linux/arm/v7 tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} - name: Image digest From 0ca7f5d8fc70a284608a3191cee3d7d58b21998a Mon Sep 17 00:00:00 2001 From: Naramsim Date: Sat, 4 May 2024 22:54:12 +0200 Subject: [PATCH 67/76] revert: drop cargo and rust --- Resources/docker/app/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Resources/docker/app/Dockerfile b/Resources/docker/app/Dockerfile index a8d2ac4d..3b0fd600 100644 --- a/Resources/docker/app/Dockerfile +++ b/Resources/docker/app/Dockerfile @@ -9,7 +9,7 @@ WORKDIR /code ADD requirements.txt /code/ RUN apk add --no-cache postgresql-libs libstdc++ RUN apk add --no-cache --virtual .build-deps gcc g++ musl-dev \ - postgresql-dev rust cargo && \ + postgresql-dev && \ python3 -m pip install -r requirements.txt --no-cache-dir && \ apk --purge del .build-deps ADD . /code/ From b51950d60c5a704593d57b16b0a573c6992d32d6 Mon Sep 17 00:00:00 2001 From: Naramsim Date: Sat, 4 May 2024 23:02:06 +0200 Subject: [PATCH 68/76] revert: add back cargo and rust, drop LE --- .github/workflows/docker-build.yml | 2 +- Resources/docker/app/Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index e510d814..4c7b0655 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -35,7 +35,7 @@ jobs: context: . file: ./Resources/docker/app/Dockerfile push: false - platforms: local,linux/amd64,linux/arm64,linux/ppc64le,linux/arm/v7 + platforms: local,linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6 tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} - name: Image digest diff --git a/Resources/docker/app/Dockerfile b/Resources/docker/app/Dockerfile index 3b0fd600..a8d2ac4d 100644 --- a/Resources/docker/app/Dockerfile +++ b/Resources/docker/app/Dockerfile @@ -9,7 +9,7 @@ WORKDIR /code ADD requirements.txt /code/ RUN apk add --no-cache postgresql-libs libstdc++ RUN apk add --no-cache --virtual .build-deps gcc g++ musl-dev \ - postgresql-dev && \ + postgresql-dev rust cargo && \ python3 -m pip install -r requirements.txt --no-cache-dir && \ apk --purge del .build-deps ADD . /code/ From c799a7f227982339b072b9a9f0f10a15e6811320 Mon Sep 17 00:00:00 2001 From: Naramsim Date: Mon, 6 May 2024 13:04:36 +0200 Subject: [PATCH 69/76] fix: remove LE/feat: bump deps --- .github/workflows/docker-image.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 66d81883..2ab7c156 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -13,24 +13,24 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: submodules: recursive - name: Docker meta id: meta - uses: docker/metadata-action@v3 + uses: docker/metadata-action@v5 with: # list of Docker images to use as base name for tags images: | pokeapi/pokeapi - name: Set up QEMU - uses: docker/setup-qemu-action@v1 + uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx id: buildx - uses: docker/setup-buildx-action@v1 + uses: docker/setup-buildx-action@v3 - name: Login to DockerHub if: github.event_name != 'pull_request' - uses: docker/login-action@v1 + uses: docker/login-action@v1 with: username: ${{ secrets.DOCKERHUB_USERNAME_NARAMSIM }} password: ${{ secrets.DOCKERHUB_TOKEN_NARAMSIM }} @@ -43,12 +43,12 @@ jobs: echo "Platforms: ${{ steps.buildx.outputs.platforms }}" - name: Build and push id: docker_build - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v5 with: context: . file: ./Resources/docker/app/Dockerfile push: true - platforms: linux/amd64,linux/arm64,linux/ppc64le,linux/arm/v7,linux/arm/v6 + platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6 tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} - name: Image digest From b4cedb37d7f2b143d885e3243b07b13dadbf8b3c Mon Sep 17 00:00:00 2001 From: Naramsim Date: Mon, 6 May 2024 13:09:08 +0200 Subject: [PATCH 70/76] try: build win --- .github/workflows/docker-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index 4c7b0655..00193ecb 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -35,7 +35,7 @@ jobs: context: . file: ./Resources/docker/app/Dockerfile push: false - platforms: local,linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6 + platforms: local,linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6,windows/amd64 tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} - name: Image digest From 22f1580a685bc8354b6442d05e7722b20f246854 Mon Sep 17 00:00:00 2001 From: Naramsim Date: Mon, 6 May 2024 13:14:43 +0200 Subject: [PATCH 71/76] revert: remove win --- Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Makefile b/Makefile index a6b6faec..7460d0ba 100755 --- a/Makefile +++ b/Makefile @@ -41,6 +41,9 @@ make-migrations: # Create migrations files if schema has changed shell: # Load a shell python manage.py shell ${local_config} +openapi-generate: + python manage.py spectacular --color --file openapi.yml ${local_config} + docker-up: # (Docker) Create services/volumes/networks docker-compose up -d From 940b124db7ac2be96e5037de5bc416abd54f3e93 Mon Sep 17 00:00:00 2001 From: Naramsim Date: Mon, 6 May 2024 13:21:29 +0200 Subject: [PATCH 72/76] revert: remove win --- .github/workflows/docker-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index 00193ecb..4c7b0655 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -35,7 +35,7 @@ jobs: context: . file: ./Resources/docker/app/Dockerfile push: false - platforms: local,linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6,windows/amd64 + platforms: local,linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6 tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} - name: Image digest From b37cae495207dd42839025a7367a9a29a04c7e97 Mon Sep 17 00:00:00 2001 From: Naramsim Date: Mon, 6 May 2024 13:23:30 +0200 Subject: [PATCH 73/76] cicd: generate openapi schema --- .circleci/config.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index ca9a3533..4c652294 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -20,6 +20,9 @@ jobs: - run: name: Run tests command: make test + - run: + name: Generate OpenAPI schema + command: make openapi-generate build: docker: - image: cimg/python:3.10.9 From 8e2593c4469ed1d2c6766f386410e6cd8c9cdec2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastien=20B=C3=BCrky?= Date: Tue, 7 May 2024 18:54:23 +0200 Subject: [PATCH 74/76] Add Linking cord --- data/v2/csv/evolution_trigger_prose.csv | 4 ++-- data/v2/csv/item_names.csv | 2 ++ data/v2/csv/item_prose.csv | 1 + data/v2/csv/items.csv | 1 + 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/data/v2/csv/evolution_trigger_prose.csv b/data/v2/csv/evolution_trigger_prose.csv index 85c0123c..adf56fad 100644 --- a/data/v2/csv/evolution_trigger_prose.csv +++ b/data/v2/csv/evolution_trigger_prose.csv @@ -3,8 +3,8 @@ evolution_trigger_id,local_language_id,name 1,6,Levelaufstieg 1,9,Level up 2,5,Échange -2,6,Tausch -2,9,Trade +2,6,Tausch oder Verbindungsschnur +2,9,Trade or Linking Cord 3,5,Utilisation d'un objet 3,6,Gegenstand nutzen 3,9,Use item diff --git a/data/v2/csv/item_names.csv b/data/v2/csv/item_names.csv index b9327daf..ba895daa 100644 --- a/data/v2/csv/item_names.csv +++ b/data/v2/csv/item_names.csv @@ -17822,3 +17822,5 @@ item_id,local_language_id,name 2159,1,チャデスのこな 2159,9,Poltchageist Powder 2159,11,チャデスのこな +2160,9,Linking Cord +2160,11, つながりのヒモ \ No newline at end of file diff --git a/data/v2/csv/item_prose.csv b/data/v2/csv/item_prose.csv index f636302a..10c20062 100644 --- a/data/v2/csv/item_prose.csv +++ b/data/v2/csv/item_prose.csv @@ -1519,3 +1519,4 @@ This item can only be obtained or used via the Wonder Launcher." 1003,9,XXX new effect for roto-pp-restore,XXX new effect for roto-pp-restore 1004,9,XXX new effect for roto-boost,XXX new effect for roto-boost 1005,9,XXX new effect for roto-catch,XXX new effect for roto-catch +2160, Allows a Pokemon whose evolution is usually triggered by trading to evolve, The Linking Cord triggers the evolution of certain Pokémon (all of which can alternatively evolve when traded) upon use. This consumes the Linking Cord. diff --git a/data/v2/csv/items.csv b/data/v2/csv/items.csv index f90a3799..cac23fbd 100644 --- a/data/v2/csv/items.csv +++ b/data/v2/csv/items.csv @@ -2107,5 +2107,6 @@ id,identifier,category_id,cost,fling_power,fling_effect_id 2157,cramorant-down,54,30,, 2158,morpeko-snack,54,15,, 2159,poltchageist-powder,54,30,, +2160,linking-cord,10,8000,, 10001,black-augurite,10,0,, 10002,peat-block,10,0,, From e7aec9cba6579880b7f45ce6ec6e0725316b55c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastien=20B=C3=BCrky?= Date: Tue, 7 May 2024 18:58:50 +0200 Subject: [PATCH 75/76] item flags for the linking cord --- data/v2/csv/item_flag_map.csv | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/data/v2/csv/item_flag_map.csv b/data/v2/csv/item_flag_map.csv index 842ccfcb..b7a11b45 100644 --- a/data/v2/csv/item_flag_map.csv +++ b/data/v2/csv/item_flag_map.csv @@ -610,3 +610,7 @@ item_id,item_flag_id 303,7 304,5 304,7 +2160,1 +2160,2 +2160,3 +2160,5 \ No newline at end of file From 6cb8b0636c3815efdef63477865201768bcd6b90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastien=20B=C3=BCrky?= Date: Tue, 7 May 2024 19:02:53 +0200 Subject: [PATCH 76/76] language id in item prose for linking cord --- data/v2/csv/item_prose.csv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/v2/csv/item_prose.csv b/data/v2/csv/item_prose.csv index 10c20062..6dfe32c6 100644 --- a/data/v2/csv/item_prose.csv +++ b/data/v2/csv/item_prose.csv @@ -1519,4 +1519,4 @@ This item can only be obtained or used via the Wonder Launcher." 1003,9,XXX new effect for roto-pp-restore,XXX new effect for roto-pp-restore 1004,9,XXX new effect for roto-boost,XXX new effect for roto-boost 1005,9,XXX new effect for roto-catch,XXX new effect for roto-catch -2160, Allows a Pokemon whose evolution is usually triggered by trading to evolve, The Linking Cord triggers the evolution of certain Pokémon (all of which can alternatively evolve when traded) upon use. This consumes the Linking Cord. +2160,9,Allows a Pokemon whose evolution is usually triggered by trading to evolve, The Linking Cord triggers the evolution of certain Pokémon (all of which can alternatively evolve when traded) upon use. This consumes the Linking Cord.