diff --git a/config/settings.py b/config/settings.py index bb820e24e..652fdafc2 100755 --- a/config/settings.py +++ b/config/settings.py @@ -151,6 +151,7 @@ "EXTERNAL_DOCS": {"url": "https://pokeapi.co/docs/v2"}, "VERSION": "2.10.0", "SERVE_INCLUDE_SCHEMA": False, + "AUTHENTICATION_WHITELIST": [], "OAS_VERSION": "3.1.0", "COMPONENT_SPLIT_REQUEST": True, "TAGS": [ diff --git a/openapi.yml b/openapi.yml index 3332ab256..7f4f0b5c6 100644 --- a/openapi.yml +++ b/openapi.yml @@ -20,6 +20,7 @@ paths: 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. + summary: List abilities parameters: - name: limit required: false @@ -42,8 +43,6 @@ paths: tags: - pokemon security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -59,6 +58,7 @@ paths: 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. + summary: Get ability parameters: - in: path name: id @@ -69,8 +69,6 @@ paths: tags: - pokemon security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -109,8 +107,6 @@ paths: tags: - berries security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -137,8 +133,6 @@ paths: tags: - berries security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -175,8 +169,6 @@ paths: tags: - berries security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -201,8 +193,6 @@ paths: tags: - berries security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -240,8 +230,6 @@ paths: tags: - berries security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -267,8 +255,6 @@ paths: tags: - berries security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -307,8 +293,6 @@ paths: tags: - pokemon security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -335,8 +319,6 @@ paths: tags: - pokemon security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -374,8 +356,6 @@ paths: tags: - contests security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -401,8 +381,6 @@ paths: tags: - contests security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -438,8 +416,6 @@ paths: tags: - contests security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -463,8 +439,6 @@ paths: tags: - contests security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -503,8 +477,6 @@ paths: tags: - pokemon security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -531,8 +503,6 @@ paths: tags: - pokemon security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -569,8 +539,6 @@ paths: tags: - encounters security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -595,8 +563,6 @@ paths: tags: - encounters security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -633,8 +599,6 @@ paths: tags: - encounters security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -659,8 +623,6 @@ paths: tags: - encounters security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -697,8 +659,6 @@ paths: tags: - encounters security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -723,8 +683,6 @@ paths: tags: - encounters security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -762,8 +720,6 @@ paths: tags: - evolution security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -789,8 +745,6 @@ paths: tags: - evolution security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -828,8 +782,6 @@ paths: tags: - evolution security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -855,8 +807,6 @@ paths: tags: - evolution security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -895,8 +845,6 @@ paths: tags: - games security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -923,8 +871,6 @@ paths: tags: - games security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -963,8 +909,6 @@ paths: tags: - pokemon security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -991,8 +935,6 @@ paths: tags: - pokemon security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -1030,8 +972,6 @@ paths: tags: - pokemon security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -1057,8 +997,6 @@ paths: tags: - pokemon security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -1096,8 +1034,6 @@ paths: tags: - items security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -1123,8 +1059,6 @@ paths: tags: - items security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -1161,8 +1095,6 @@ paths: tags: - items security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -1187,8 +1119,6 @@ paths: tags: - items security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -1225,8 +1155,6 @@ paths: tags: - items security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -1251,8 +1179,6 @@ paths: tags: - items security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -1289,8 +1215,6 @@ paths: tags: - items security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -1315,8 +1239,6 @@ paths: tags: - items security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -1352,8 +1274,6 @@ paths: tags: - items security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -1377,8 +1297,6 @@ paths: tags: - items security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -1414,8 +1332,6 @@ paths: tags: - utility security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -1439,8 +1355,6 @@ paths: tags: - utility security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -1477,8 +1391,6 @@ paths: tags: - location security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -1503,8 +1415,6 @@ paths: tags: - location security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -1535,8 +1445,6 @@ paths: tags: - location security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -1561,8 +1469,6 @@ paths: tags: - location security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -1600,8 +1506,6 @@ paths: tags: - machines security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -1627,8 +1531,6 @@ paths: tags: - machines security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -1642,11 +1544,10 @@ paths: operationId: meta_list description: Returns metadata about the current deployed version of the API, including the git commit hash, deploy date, and tag (if any). + summary: Get API metadata tags: - utility security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -1697,8 +1598,6 @@ paths: tags: - moves security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -1725,8 +1624,6 @@ paths: tags: - moves security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -1764,8 +1661,6 @@ paths: tags: - moves security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -1791,8 +1686,6 @@ paths: tags: - moves security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -1829,8 +1722,6 @@ paths: tags: - moves security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -1855,8 +1746,6 @@ paths: tags: - moves security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -1892,8 +1781,6 @@ paths: tags: - moves security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -1917,8 +1804,6 @@ paths: tags: - moves security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -1954,8 +1839,6 @@ paths: tags: - pokemon security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -1979,8 +1862,6 @@ paths: tags: - pokemon security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -2016,8 +1897,6 @@ paths: tags: - moves security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -2041,8 +1920,6 @@ paths: tags: - moves security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -2079,8 +1956,6 @@ paths: tags: - moves security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -2105,8 +1980,6 @@ paths: tags: - moves security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -2143,8 +2016,6 @@ paths: tags: - pokemon security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -2169,8 +2040,6 @@ paths: tags: - pokemon security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -2207,8 +2076,6 @@ paths: tags: - location security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -2233,8 +2100,6 @@ paths: tags: - location security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -2274,8 +2139,6 @@ paths: tags: - games security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -2303,8 +2166,6 @@ paths: tags: - games security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -2345,8 +2206,6 @@ paths: tags: - pokemon security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -2375,8 +2234,6 @@ paths: tags: - pokemon security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -2415,8 +2272,6 @@ paths: tags: - pokemon security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -2443,8 +2298,6 @@ paths: tags: - pokemon security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -2483,8 +2336,6 @@ paths: tags: - pokemon security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -2511,8 +2362,6 @@ paths: tags: - pokemon security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -2549,8 +2398,6 @@ paths: tags: - pokemon security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -2575,8 +2422,6 @@ paths: tags: - pokemon security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -2612,8 +2457,6 @@ paths: tags: - pokemon security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -2637,8 +2480,6 @@ paths: tags: - pokemon security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -2677,8 +2518,6 @@ paths: tags: - pokemon security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -2705,8 +2544,6 @@ paths: tags: - pokemon security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -2745,8 +2582,6 @@ paths: tags: - pokemon security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -2773,8 +2608,6 @@ paths: tags: - pokemon security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -2812,8 +2645,6 @@ paths: tags: - location security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -2839,8 +2670,6 @@ paths: tags: - location security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -2878,8 +2707,6 @@ paths: tags: - pokemon security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -2905,8 +2732,6 @@ paths: tags: - pokemon security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -2943,8 +2768,6 @@ paths: tags: - contests security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -2969,8 +2792,6 @@ paths: tags: - contests security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -3009,8 +2830,6 @@ paths: tags: - pokemon security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -3037,8 +2856,6 @@ paths: tags: - pokemon security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -3074,8 +2891,6 @@ paths: tags: - games security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -3099,8 +2914,6 @@ paths: tags: - games security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -3136,8 +2949,6 @@ paths: tags: - games security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -3161,8 +2972,6 @@ paths: tags: - games security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -3186,8 +2995,6 @@ paths: tags: - encounters security: - - cookieAuth: [] - - basicAuth: [] - {} responses: '200': @@ -8497,6 +8304,29 @@ components: examples: - https://pokeapi.co/api/v2/type/7/ readOnly: true + trigger_conditions: + type: array + items: + type: object + required: + - trigger + - name + - url + properties: + trigger: + type: string + examples: + - held-item + name: + type: string + examples: + - venusaurite + url: + type: string + format: uri + examples: + - https://pokeapi.co/api/v2/item/698/ + readOnly: true required: - form_name - form_names @@ -8505,6 +8335,7 @@ components: - names - pokemon - sprites + - trigger_conditions - types - version_group PokemonFormSummary: @@ -9788,14 +9619,6 @@ components: required: - name - url - securitySchemes: - basicAuth: - type: http - scheme: basic - cookieAuth: - type: apiKey - in: cookie - name: sessionid servers: - url: https://pokeapi.co tags: diff --git a/pokemon_v2/api.py b/pokemon_v2/api.py index cf0b7052c..927987d3a 100644 --- a/pokemon_v2/api.py +++ b/pokemon_v2/api.py @@ -108,6 +108,12 @@ def retrieve(self, request, pk=None): @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"], + summary="Get ability", +) +@extend_schema_view( + list=extend_schema( + summary="List abilities", + ) ) class AbilityResource(PokeapiCommonViewset): queryset = Ability.objects.all() @@ -1063,6 +1069,7 @@ def get(self, request, pokemon_id): @extend_schema( description="Returns metadata about the current deployed version of the API, including the git commit hash, deploy date, and tag (if any).", + summary="Get API metadata", tags=["utility"], responses={ 200: {