diff --git a/config/settings.py b/config/settings.py index 3a033f40a..42e7e1575 100644 --- a/config/settings.py +++ b/config/settings.py @@ -2,8 +2,9 @@ # Production settings import os import textwrap +from collections.abc import Callable from pathlib import Path -from typing import TypedDict +from typing import Any, TypedDict class DatabaseSettings(TypedDict, total=False): @@ -40,7 +41,7 @@ class TemplateSettings(TypedDict, total=False): class SpectacularSettings(TypedDict, total=False): TITLE: str DESCRIPTION: str - SORT_OPERATIONS: bool + SORT_OPERATIONS: bool | Callable[..., Any] SERVERS: list[dict[str, str]] EXTERNAL_DOCS: dict[str, str] VERSION: str @@ -49,6 +50,7 @@ class SpectacularSettings(TypedDict, total=False): OAS_VERSION: str COMPONENT_SPLIT_REQUEST: bool TAGS: list[dict[str, str | dict[str, str]]] + POSTPROCESSING_HOOKS: list[str] BASE_DIR = Path(__file__).resolve().parent.parent @@ -172,6 +174,35 @@ class SpectacularSettings(TypedDict, total=False): DEFAULT_AUTO_FIELD = "django.db.models.AutoField" + +def postprocesss_openapi_schema(result: dict[str, Any], generator: object, **kwargs: object) -> dict[str, Any]: + # root-level security marking all endpoints as public + result["security"] = [] + + page_size = REST_FRAMEWORK.get("PAGE_SIZE") + schemas = result.get("components", {}).get("schemas", {}) + paths: dict[str, dict[str, Any]] = result.get("paths", {}) + for path, path_item in paths.items(): + for operation in path_item.values(): + if isinstance(operation, dict) and operation.get("security") in ([{}], []): # pyright: ignore[reportUnknownMemberType] + operation.pop("security", None) # pyright: ignore[reportUnknownMemberType] + + if page_size is None: + continue + response = path_item.get("get", {}).get("responses", {}).get("200", {}) + schema = response.get("content", {}).get("application/json", {}).get("schema", {}) + reference = schema.get("$ref", "") + if reference.startswith("#/components/schemas/"): + schema = schemas.get(reference.rsplit("/", 1)[-1], {}) + properties = schema.get("properties", {}) + if not {"count", "results", "next", "previous"}.issubset(properties): + continue + # Examples represent links from the second page. + for field, offset in (("next", 2 * page_size), ("previous", 0)): + properties[field]["example"] = f"https://pokeapi.co{path}?offset={offset}&limit={page_size}" + return result + + SPECTACULAR_SETTINGS: SpectacularSettings = { "TITLE": "PokéAPI", "DESCRIPTION": textwrap.dedent( @@ -201,6 +232,9 @@ class SpectacularSettings(TypedDict, total=False): "AUTHENTICATION_WHITELIST": [], "OAS_VERSION": "3.1.0", "COMPONENT_SPLIT_REQUEST": True, + "POSTPROCESSING_HOOKS": [ + "config.settings.postprocesss_openapi_schema", + ], "TAGS": [ { "name": "pokemon", diff --git a/data/v2/utils/media.py b/data/v2/utils/media.py index e909efb0c..a4f3806ae 100644 --- a/data/v2/utils/media.py +++ b/data/v2/utils/media.py @@ -5,7 +5,6 @@ import urllib.error import urllib.request from collections.abc import Callable -from email.utils import parsedate_to_datetime from pathlib import Path from typing import Any @@ -36,29 +35,40 @@ def _load_manifest_from_path(path: Path) -> set[str] | None: def _fetch_manifest(url: str, cache_file: Path) -> set[str] | None: + etag_file = cache_file.with_suffix(cache_file.suffix + ".etag") try: + cached = None + headers: dict[str, str] = {} if cache_file.is_file(): - try: - head_req = urllib.request.Request(url, method="HEAD") - with urllib.request.urlopen(head_req, timeout=10) as head_resp: - last_mod_header = head_resp.headers.get("Last-Modified") - if last_mod_header: - remote_mtime = parsedate_to_datetime(last_mod_header).timestamp() - if cache_file.stat().st_mtime >= remote_mtime: - return _load_manifest_from_path(cache_file) - except (OSError, urllib.error.URLError, ValueError): - pass - - with urllib.request.urlopen(url, timeout=30) as resp: + cached = _load_manifest_from_path(cache_file) + if cached is not None: + with contextlib.suppress(OSError, json.JSONDecodeError): + metadata = json.loads(etag_file.read_text(encoding="utf-8")) + if ( + isinstance(metadata, dict) + and metadata.get("url") == url # pyright: ignore[reportUnknownMemberType] + and isinstance(metadata.get("etag"), str) # pyright: ignore[reportUnknownMemberType] + ): + headers["If-None-Match"] = metadata["etag"] + + request = urllib.request.Request(url, headers=headers) + try: + response = urllib.request.urlopen(request, timeout=30) + except urllib.error.HTTPError as e: + if e.code == 304 and cached is not None: + return cached + raise + + with response as resp: raw_bytes: bytes = resp.read() data = json.loads(gzip.decompress(raw_bytes).decode("utf-8")) with contextlib.suppress(OSError): + etag_file.unlink(missing_ok=True) cache_file.write_bytes(raw_bytes) - last_mod = resp.headers.get("Last-Modified") - if last_mod: - mtime = parsedate_to_datetime(last_mod).timestamp() - os.utime(cache_file, (mtime, mtime)) + etag = resp.headers.get("ETag") + if etag: + etag_file.write_text(json.dumps({"url": url, "etag": etag}), encoding="utf-8") return set(data) except (OSError, urllib.error.URLError, json.JSONDecodeError, gzip.BadGzipFile) as e: diff --git a/openapi.yml b/openapi.yml index ee508a894..88da3f160 100644 --- a/openapi.yml +++ b/openapi.yml @@ -27,8 +27,6 @@ paths: summary: Get API metadata tags: - utility - security: - - {} responses: '200': content: @@ -65,8 +63,6 @@ paths: query applied on the `name` property. " tags: - pokemon - security: - - {} responses: '200': content: @@ -89,10 +85,11 @@ paths: type: string description: This parameter can be a string or an integer. required: true + examples: + '1': + value: '1' tags: - pokemon - security: - - {} responses: '200': content: @@ -129,8 +126,6 @@ paths: query applied on the `name` property. " tags: - berries - security: - - {} responses: '200': content: @@ -153,10 +148,11 @@ paths: type: string description: This parameter can be a string or an integer. required: true + examples: + '1': + value: '1' tags: - berries - security: - - {} responses: '200': content: @@ -191,8 +187,6 @@ paths: query applied on the `name` property. " tags: - berries - security: - - {} responses: '200': content: @@ -213,10 +207,11 @@ paths: type: string description: This parameter can be a string or an integer. required: true + examples: + '1': + value: '1' tags: - berries - security: - - {} responses: '200': content: @@ -252,8 +247,6 @@ paths: query applied on the `name` property. " tags: - berries - security: - - {} responses: '200': content: @@ -275,10 +268,11 @@ paths: type: string description: This parameter can be a string or an integer. required: true + examples: + '1': + value: '1' tags: - berries - security: - - {} responses: '200': content: @@ -307,16 +301,8 @@ paths: description: The initial index from which to return the results. schema: type: integer - - in: query - name: q - schema: - type: string - description: "> Only available locally and not at [pokeapi.co](https://pokeapi.co/docs/v2)\nCase-insensitive - query applied on the `name` property. " tags: - pokemon - security: - - {} responses: '200': content: @@ -339,10 +325,11 @@ paths: type: string description: This parameter can be a string or an integer. required: true + examples: + '1': + value: '1' tags: - pokemon - security: - - {} responses: '200': content: @@ -378,8 +365,6 @@ paths: query applied on the `name` property. " tags: - contests - security: - - {} responses: '200': content: @@ -401,10 +386,11 @@ paths: type: string description: This parameter can be a string or an integer. required: true + examples: + '1': + value: '1' tags: - contests - security: - - {} responses: '200': content: @@ -430,16 +416,8 @@ paths: description: The initial index from which to return the results. schema: type: integer - - in: query - name: q - schema: - type: string - description: "> Only available locally and not at [pokeapi.co](https://pokeapi.co/docs/v2)\nCase-insensitive - query applied on the `name` property. " tags: - contests - security: - - {} responses: '200': content: @@ -459,10 +437,11 @@ paths: type: string description: This parameter can be a string or an integer. required: true + examples: + '1': + value: '1' tags: - contests - security: - - {} responses: '200': content: @@ -499,8 +478,6 @@ paths: query applied on the `name` property. " tags: - pokemon - security: - - {} responses: '200': content: @@ -523,10 +500,11 @@ paths: type: string description: This parameter can be a string or an integer. required: true + examples: + '1': + value: '1' tags: - pokemon - security: - - {} responses: '200': content: @@ -561,8 +539,6 @@ paths: query applied on the `name` property. " tags: - encounters - security: - - {} responses: '200': content: @@ -583,10 +559,11 @@ paths: type: string description: This parameter can be a string or an integer. required: true + examples: + '1': + value: '1' tags: - encounters - security: - - {} responses: '200': content: @@ -621,8 +598,6 @@ paths: query applied on the `name` property. " tags: - encounters - security: - - {} responses: '200': content: @@ -643,10 +618,11 @@ paths: type: string description: This parameter can be a string or an integer. required: true + examples: + '1': + value: '1' tags: - encounters - security: - - {} responses: '200': content: @@ -681,8 +657,6 @@ paths: query applied on the `name` property. " tags: - encounters - security: - - {} responses: '200': content: @@ -703,10 +677,11 @@ paths: type: string description: This parameter can be a string or an integer. required: true + examples: + '1': + value: '1' tags: - encounters - security: - - {} responses: '200': content: @@ -734,16 +709,8 @@ paths: description: The initial index from which to return the results. schema: type: integer - - in: query - name: q - schema: - type: string - description: "> Only available locally and not at [pokeapi.co](https://pokeapi.co/docs/v2)\nCase-insensitive - query applied on the `name` property. " tags: - evolution - security: - - {} responses: '200': content: @@ -765,10 +732,11 @@ paths: type: string description: This parameter can be a string or an integer. required: true + examples: + '1': + value: '1' tags: - evolution - security: - - {} responses: '200': content: @@ -804,8 +772,6 @@ paths: query applied on the `name` property. " tags: - evolution - security: - - {} responses: '200': content: @@ -827,10 +793,11 @@ paths: type: string description: This parameter can be a string or an integer. required: true + examples: + '1': + value: '1' tags: - evolution - security: - - {} responses: '200': content: @@ -867,8 +834,6 @@ paths: query applied on the `name` property. " tags: - evolution - security: - - {} responses: '200': content: @@ -891,10 +856,11 @@ paths: type: string description: This parameter can be a string or an integer. required: true + examples: + '1': + value: '1' tags: - evolution - security: - - {} responses: '200': content: @@ -931,8 +897,6 @@ paths: query applied on the `name` property. " tags: - games - security: - - {} responses: '200': content: @@ -955,10 +919,11 @@ paths: type: string description: This parameter can be a string or an integer. required: true + examples: + '1': + value: '1' tags: - games - security: - - {} responses: '200': content: @@ -995,8 +960,6 @@ paths: query applied on the `name` property. " tags: - pokemon - security: - - {} responses: '200': content: @@ -1019,10 +982,11 @@ paths: type: string description: This parameter can be a string or an integer. required: true + examples: + '1': + value: '1' tags: - pokemon - security: - - {} responses: '200': content: @@ -1058,8 +1022,6 @@ paths: query applied on the `name` property. " tags: - pokemon - security: - - {} responses: '200': content: @@ -1081,10 +1043,11 @@ paths: type: string description: This parameter can be a string or an integer. required: true + examples: + '1': + value: '1' tags: - pokemon - security: - - {} responses: '200': content: @@ -1120,8 +1083,6 @@ paths: query applied on the `name` property. " tags: - items - security: - - {} responses: '200': content: @@ -1143,10 +1104,11 @@ paths: type: string description: This parameter can be a string or an integer. required: true + examples: + '1': + value: '1' tags: - items - security: - - {} responses: '200': content: @@ -1181,8 +1143,6 @@ paths: query applied on the `name` property. " tags: - items - security: - - {} responses: '200': content: @@ -1203,10 +1163,11 @@ paths: type: string description: This parameter can be a string or an integer. required: true + examples: + '1': + value: '1' tags: - items - security: - - {} responses: '200': content: @@ -1241,8 +1202,6 @@ paths: query applied on the `name` property. " tags: - items - security: - - {} responses: '200': content: @@ -1263,10 +1222,11 @@ paths: type: string description: This parameter can be a string or an integer. required: true + examples: + '1': + value: '1' tags: - items - security: - - {} responses: '200': content: @@ -1301,8 +1261,6 @@ paths: query applied on the `name` property. " tags: - items - security: - - {} responses: '200': content: @@ -1323,10 +1281,11 @@ paths: type: string description: This parameter can be a string or an integer. required: true + examples: + '1': + value: '1' tags: - items - security: - - {} responses: '200': content: @@ -1360,8 +1319,6 @@ paths: query applied on the `name` property. " tags: - items - security: - - {} responses: '200': content: @@ -1381,10 +1338,11 @@ paths: type: string description: This parameter can be a string or an integer. required: true + examples: + '1': + value: '1' tags: - items - security: - - {} responses: '200': content: @@ -1418,8 +1376,6 @@ paths: query applied on the `name` property. " tags: - items - security: - - {} responses: '200': content: @@ -1439,10 +1395,11 @@ paths: type: string description: This parameter can be a string or an integer. required: true + examples: + '1': + value: '1' tags: - items - security: - - {} responses: '200': content: @@ -1476,8 +1433,6 @@ paths: query applied on the `name` property. " tags: - utility - security: - - {} responses: '200': content: @@ -1497,10 +1452,11 @@ paths: type: string description: This parameter can be a string or an integer. required: true + examples: + '1': + value: '1' tags: - utility - security: - - {} responses: '200': content: @@ -1535,8 +1491,6 @@ paths: query applied on the `name` property. " tags: - location - security: - - {} responses: '200': content: @@ -1557,10 +1511,11 @@ paths: type: string description: This parameter can be a string or an integer. required: true + examples: + '1': + value: '1' tags: - location - security: - - {} responses: '200': content: @@ -1589,8 +1544,6 @@ paths: type: integer tags: - location - security: - - {} responses: '200': content: @@ -1611,10 +1564,11 @@ paths: type: integer description: A unique integer value identifying this location area. required: true + examples: + '1': + value: 1 tags: - location - security: - - {} responses: '200': content: @@ -1642,16 +1596,8 @@ paths: description: The initial index from which to return the results. schema: type: integer - - in: query - name: q - schema: - type: string - description: "> Only available locally and not at [pokeapi.co](https://pokeapi.co/docs/v2)\nCase-insensitive - query applied on the `name` property. " tags: - machines - security: - - {} responses: '200': content: @@ -1673,10 +1619,11 @@ paths: type: string description: This parameter can be a string or an integer. required: true + examples: + '1': + value: '1' tags: - machines - security: - - {} responses: '200': content: @@ -1713,8 +1660,6 @@ paths: query applied on the `name` property. " tags: - moves - security: - - {} responses: '200': content: @@ -1737,10 +1682,11 @@ paths: type: string description: This parameter can be a string or an integer. required: true + examples: + '1': + value: '1' tags: - moves - security: - - {} responses: '200': content: @@ -1776,8 +1722,6 @@ paths: query applied on the `name` property. " tags: - moves - security: - - {} responses: '200': content: @@ -1799,10 +1743,11 @@ paths: type: string description: This parameter can be a string or an integer. required: true + examples: + '1': + value: '1' tags: - moves - security: - - {} responses: '200': content: @@ -1837,8 +1782,6 @@ paths: query applied on the `name` property. " tags: - moves - security: - - {} responses: '200': content: @@ -1859,10 +1802,11 @@ paths: type: string description: This parameter can be a string or an integer. required: true + examples: + '1': + value: '1' tags: - moves - security: - - {} responses: '200': content: @@ -1896,8 +1840,6 @@ paths: query applied on the `name` property. " tags: - moves - security: - - {} responses: '200': content: @@ -1917,10 +1859,11 @@ paths: type: string description: This parameter can be a string or an integer. required: true + examples: + '1': + value: '1' tags: - moves - security: - - {} responses: '200': content: @@ -1954,8 +1897,6 @@ paths: query applied on the `name` property. " tags: - pokemon - security: - - {} responses: '200': content: @@ -1975,10 +1916,11 @@ paths: type: string description: This parameter can be a string or an integer. required: true + examples: + '1': + value: '1' tags: - pokemon - security: - - {} responses: '200': content: @@ -2012,8 +1954,6 @@ paths: query applied on the `name` property. " tags: - moves - security: - - {} responses: '200': content: @@ -2033,10 +1973,11 @@ paths: type: string description: This parameter can be a string or an integer. required: true + examples: + '1': + value: '1' tags: - moves - security: - - {} responses: '200': content: @@ -2071,8 +2012,6 @@ paths: query applied on the `name` property. " tags: - moves - security: - - {} responses: '200': content: @@ -2093,10 +2032,11 @@ paths: type: string description: This parameter can be a string or an integer. required: true + examples: + '1': + value: '1' tags: - moves - security: - - {} responses: '200': content: @@ -2131,8 +2071,6 @@ paths: query applied on the `name` property. " tags: - pokemon - security: - - {} responses: '200': content: @@ -2153,10 +2091,11 @@ paths: type: string description: This parameter can be a string or an integer. required: true + examples: + '1': + value: '1' tags: - pokemon - security: - - {} responses: '200': content: @@ -2191,8 +2130,6 @@ paths: query applied on the `name` property. " tags: - location - security: - - {} responses: '200': content: @@ -2213,10 +2150,11 @@ paths: type: string description: This parameter can be a string or an integer. required: true + examples: + '1': + value: '1' tags: - location - security: - - {} responses: '200': content: @@ -2254,8 +2192,6 @@ paths: query applied on the `name` property. " tags: - games - security: - - {} responses: '200': content: @@ -2279,10 +2215,11 @@ paths: type: string description: This parameter can be a string or an integer. required: true + examples: + '1': + value: '1' tags: - games - security: - - {} responses: '200': content: @@ -2321,8 +2258,6 @@ paths: query applied on the `name` property. " tags: - pokemon - security: - - {} responses: '200': content: @@ -2347,10 +2282,11 @@ paths: type: string description: This parameter can be a string or an integer. required: true + examples: + '1': + value: '1' tags: - pokemon - security: - - {} responses: '200': content: @@ -2387,8 +2323,6 @@ paths: query applied on the `name` property. " tags: - pokemon - security: - - {} responses: '200': content: @@ -2411,10 +2345,11 @@ paths: type: string description: This parameter can be a string or an integer. required: true + examples: + '1': + value: '1' tags: - pokemon - security: - - {} responses: '200': content: @@ -2451,8 +2386,6 @@ paths: query applied on the `name` property. " tags: - pokemon - security: - - {} responses: '200': content: @@ -2475,10 +2408,11 @@ paths: type: string description: This parameter can be a string or an integer. required: true + examples: + '1': + value: '1' tags: - pokemon - security: - - {} responses: '200': content: @@ -2513,8 +2447,6 @@ paths: query applied on the `name` property. " tags: - pokemon - security: - - {} responses: '200': content: @@ -2535,10 +2467,11 @@ paths: type: string description: This parameter can be a string or an integer. required: true + examples: + '1': + value: '1' tags: - pokemon - security: - - {} responses: '200': content: @@ -2572,8 +2505,6 @@ paths: query applied on the `name` property. " tags: - pokemon - security: - - {} responses: '200': content: @@ -2593,10 +2524,11 @@ paths: type: string description: This parameter can be a string or an integer. required: true + examples: + '1': + value: '1' tags: - pokemon - security: - - {} responses: '200': content: @@ -2633,8 +2565,6 @@ paths: query applied on the `name` property. " tags: - pokemon - security: - - {} responses: '200': content: @@ -2657,10 +2587,11 @@ paths: type: string description: This parameter can be a string or an integer. required: true + examples: + '1': + value: '1' tags: - pokemon - security: - - {} responses: '200': content: @@ -2697,8 +2628,6 @@ paths: query applied on the `name` property. " tags: - pokemon - security: - - {} responses: '200': content: @@ -2721,10 +2650,11 @@ paths: type: string description: This parameter can be a string or an integer. required: true + examples: + '1': + value: '1' tags: - pokemon - security: - - {} responses: '200': content: @@ -2760,8 +2690,6 @@ paths: query applied on the `name` property. " tags: - location - security: - - {} responses: '200': content: @@ -2783,10 +2711,11 @@ paths: type: string description: This parameter can be a string or an integer. required: true + examples: + '1': + value: '1' tags: - location - security: - - {} responses: '200': content: @@ -2822,8 +2751,6 @@ paths: query applied on the `name` property. " tags: - pokemon - security: - - {} responses: '200': content: @@ -2845,10 +2772,11 @@ paths: type: string description: This parameter can be a string or an integer. required: true + examples: + '1': + value: '1' tags: - pokemon - security: - - {} responses: '200': content: @@ -2875,16 +2803,8 @@ paths: description: The initial index from which to return the results. schema: type: integer - - in: query - name: q - schema: - type: string - description: "> Only available locally and not at [pokeapi.co](https://pokeapi.co/docs/v2)\nCase-insensitive - query applied on the `name` property. " tags: - contests - security: - - {} responses: '200': content: @@ -2905,10 +2825,11 @@ paths: type: string description: This parameter can be a string or an integer. required: true + examples: + '1': + value: '1' tags: - contests - security: - - {} responses: '200': content: @@ -2945,8 +2866,6 @@ paths: query applied on the `name` property. " tags: - pokemon - security: - - {} responses: '200': content: @@ -2969,10 +2888,11 @@ paths: type: string description: This parameter can be a string or an integer. required: true + examples: + '1': + value: '1' tags: - pokemon - security: - - {} responses: '200': content: @@ -3006,8 +2926,6 @@ paths: query applied on the `name` property. " tags: - games - security: - - {} responses: '200': content: @@ -3027,10 +2945,11 @@ paths: type: string description: This parameter can be a string or an integer. required: true + examples: + '1': + value: '1' tags: - games - security: - - {} responses: '200': content: @@ -3064,8 +2983,6 @@ paths: query applied on the `name` property. " tags: - games - security: - - {} responses: '200': content: @@ -3085,10 +3002,11 @@ paths: type: string description: This parameter can be a string or an integer. required: true + examples: + '1': + value: '1' tags: - games - security: - - {} responses: '200': content: @@ -3105,13 +3023,14 @@ paths: - in: path name: pokemon_id schema: - type: string - pattern: ^\d+$ + type: integer + description: A unique integer value identifying the Pokémon. required: true + examples: + '1': + value: 1 tags: - encounters - security: - - {} responses: '200': content: @@ -3127,12 +3046,16 @@ components: type: object properties: version_group: - $ref: '#/components/schemas/VersionGroupSummary' + allOf: + - $ref: '#/components/schemas/VersionGroupSummary' + description: The version group in which the previous effect of this ability + originated. effect_entries: type: array items: $ref: '#/components/schemas/AbilityChangeEffectText' readOnly: true + description: The previous effect of this ability listed in different languages. required: - effect_entries - version_group @@ -3141,9 +3064,13 @@ components: properties: effect: type: string + description: The localized effect text for an API resource in a specific + language. maxLength: 6000 language: - $ref: '#/components/schemas/LanguageSummary' + allOf: + - $ref: '#/components/schemas/LanguageSummary' + description: The language this effect is in. required: - effect - language @@ -3153,38 +3080,50 @@ components: id: type: integer readOnly: true + description: The identifier for this resource. name: type: string + description: The name for this resource. maxLength: 200 is_main_series: type: boolean + description: Whether or not this ability originated in the main series of + the video games. generation: - $ref: '#/components/schemas/GenerationSummary' + allOf: + - $ref: '#/components/schemas/GenerationSummary' + description: The generation this ability originated in. names: type: array items: $ref: '#/components/schemas/AbilityName' readOnly: true + description: The name of this resource listed in different languages. effect_entries: type: array items: $ref: '#/components/schemas/AbilityEffectText' readOnly: true + description: The effect of this ability listed in different languages. effect_changes: type: array items: $ref: '#/components/schemas/AbilityChange' readOnly: true + description: The list of previous effects this ability has had across version + groups. flavor_text_entries: type: array items: $ref: '#/components/schemas/AbilityFlavorText' readOnly: true + description: The flavor text of this ability listed in different languages. pokemon: type: array items: $ref: '#/components/schemas/AbilityPokemonDetail' readOnly: true + description: A list of Pokémon that could potentially have this ability. required: - effect_changes - effect_entries @@ -3199,12 +3138,17 @@ components: properties: effect: type: string + description: The localized effect text for an API resource in a specific + language. maxLength: 6000 short_effect: type: string + description: The localized effect text in brief. maxLength: 300 language: - $ref: '#/components/schemas/LanguageSummary' + allOf: + - $ref: '#/components/schemas/LanguageSummary' + description: The language this effect is in. required: - effect - language @@ -3214,10 +3158,15 @@ components: properties: flavor_text: type: string + description: The localized name for an API resource in a specific language. language: - $ref: '#/components/schemas/LanguageSummary' + allOf: + - $ref: '#/components/schemas/LanguageSummary' + description: The language this text resource is in. version_group: - $ref: '#/components/schemas/VersionGroupSummary' + allOf: + - $ref: '#/components/schemas/VersionGroupSummary' + description: The version group that uses this flavor text. required: - flavor_text - language @@ -3227,9 +3176,12 @@ components: properties: name: type: string + description: The localized name for an API resource in a specific language. maxLength: 200 language: - $ref: '#/components/schemas/LanguageSummary' + allOf: + - $ref: '#/components/schemas/LanguageSummary' + description: The language this name is in. required: - language - name @@ -3238,12 +3190,18 @@ components: properties: is_hidden: type: boolean + description: Whether or not this a hidden ability for the referenced Pokémon. slot: type: integer maximum: 2147483647 minimum: -2147483648 + description: 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 + pokemon. pokemon: - $ref: '#/components/schemas/PokemonSummary' + allOf: + - $ref: '#/components/schemas/PokemonSummary' + description: The Pokémon this ability could belong to. required: - pokemon - slot @@ -3252,11 +3210,13 @@ components: properties: name: type: string + description: The name of the referenced resource. maxLength: 200 url: type: string format: uri readOnly: true + description: The URL of the referenced resource. required: - name - url @@ -3266,8 +3226,10 @@ components: id: type: integer readOnly: true + description: The identifier for this resource. name: type: string + description: The name for this resource. maxLength: 200 growth_time: type: @@ -3275,47 +3237,68 @@ components: - 'null' maximum: 2147483647 minimum: -2147483648 + description: 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. max_harvest: type: - integer - 'null' maximum: 2147483647 minimum: -2147483648 + description: The maximum number of these berries that can grow on one tree + in Generation IV. natural_gift_power: type: - integer - 'null' maximum: 2147483647 minimum: -2147483648 + description: The power of the move "Natural Gift" when used with this Berry. size: type: - integer - 'null' maximum: 2147483647 minimum: -2147483648 + description: The size of this Berry, in millimeters. smoothness: type: - integer - 'null' maximum: 2147483647 minimum: -2147483648 + description: The smoothness of this Berry, used in making Pokéblocks or + Poffins. soil_dryness: type: - integer - 'null' maximum: 2147483647 minimum: -2147483648 + description: The speed at which this Berry dries out the soil as it grows. + A higher rate means the soil dries more quickly. firmness: - $ref: '#/components/schemas/BerryFirmnessSummary' + oneOf: + - $ref: '#/components/schemas/BerryFirmnessSummary' + - type: 'null' + description: The firmness of this berry, used in making Pokéblocks or Poffins. flavors: type: array items: $ref: '#/components/schemas/BerryFlavorMap' readOnly: true + description: A list of references to each flavor a berry can have and the + potency of each of those flavors in regard to this berry. item: - $ref: '#/components/schemas/ItemSummary' + allOf: + - $ref: '#/components/schemas/ItemSummary' + description: Berries are actually items. This is a reference to the item + specific data for this berry. natural_gift_type: - $ref: '#/components/schemas/TypeSummary' + oneOf: + - $ref: '#/components/schemas/TypeSummary' + - type: 'null' + description: The type inherited by "Natural Gift" when used with this Berry. required: - firmness - flavors @@ -3329,19 +3312,23 @@ components: id: type: integer readOnly: true + description: The identifier for this resource. name: type: string + description: The name for this resource. maxLength: 200 berries: type: array items: $ref: '#/components/schemas/BerrySummary' readOnly: true + description: A list of the berries with this firmness. names: type: array items: $ref: '#/components/schemas/BerryFirmnessName' readOnly: true + description: The name of this resource listed in different languages. required: - berries - id @@ -3352,9 +3339,12 @@ components: properties: name: type: string + description: The localized name for an API resource in a specific language. maxLength: 200 language: - $ref: '#/components/schemas/LanguageSummary' + allOf: + - $ref: '#/components/schemas/LanguageSummary' + description: The language this name is in. required: - language - name @@ -3363,11 +3353,13 @@ components: properties: name: type: string + description: The name of the referenced resource. maxLength: 200 url: type: string format: uri readOnly: true + description: The URL of the referenced resource. required: - name - url @@ -3378,8 +3370,11 @@ components: type: integer maximum: 2147483647 minimum: -2147483648 + description: How powerful the referenced flavor is for this berry. berry: - $ref: '#/components/schemas/BerrySummary' + allOf: + - $ref: '#/components/schemas/BerrySummary' + description: The berry with the referenced flavor. required: - berry - potency @@ -3389,21 +3384,27 @@ components: id: type: integer readOnly: true + description: The identifier for this resource. name: type: string + description: The name for this resource. maxLength: 200 berries: type: array items: $ref: '#/components/schemas/BerryFlavorBerryMap' readOnly: true + description: A list of the berries with this flavor. contest_type: - $ref: '#/components/schemas/ContestTypeSummary' + allOf: + - $ref: '#/components/schemas/ContestTypeSummary' + description: The contest type that correlates with this berry flavor. names: type: array items: $ref: '#/components/schemas/BerryFlavorName' readOnly: true + description: The name of this resource listed in different languages. required: - berries - contest_type @@ -3417,8 +3418,11 @@ components: type: integer maximum: 2147483647 minimum: -2147483648 + description: How powerful the referenced flavor is for this berry. flavor: - $ref: '#/components/schemas/BerryFlavorSummary' + allOf: + - $ref: '#/components/schemas/BerryFlavorSummary' + description: The referenced berry flavor. required: - flavor - potency @@ -3427,9 +3431,12 @@ components: properties: name: type: string + description: The localized name for an API resource in a specific language. maxLength: 200 language: - $ref: '#/components/schemas/LanguageSummary' + allOf: + - $ref: '#/components/schemas/LanguageSummary' + description: The language this name is in. required: - language - name @@ -3438,11 +3445,13 @@ components: properties: name: type: string + description: The name of the referenced resource. maxLength: 200 url: type: string format: uri readOnly: true + description: The URL of the referenced resource. required: - name - url @@ -3451,11 +3460,13 @@ components: properties: name: type: string + description: The name of the referenced resource. maxLength: 200 url: type: string format: uri readOnly: true + description: The URL of the referenced resource. required: - name - url @@ -3464,9 +3475,13 @@ components: properties: description: type: string + description: The localized description for an API resource in a specific + language. maxLength: 2000 language: - $ref: '#/components/schemas/LanguageSummary' + allOf: + - $ref: '#/components/schemas/LanguageSummary' + description: The language this name is in. required: - language CharacteristicDetail: @@ -3475,20 +3490,28 @@ components: id: type: integer readOnly: true + description: The identifier for this resource. gene_modulo: type: integer + description: The remainder of the highest stat/IV divided by 5. possible_values: type: array items: type: integer readOnly: true + description: The possible values of the highest stat that would result in + a Pokémon recieving this characteristic when divided by 5. highest_stat: - $ref: '#/components/schemas/StatSummary' + allOf: + - $ref: '#/components/schemas/StatSummary' + description: The stat which results in this characteristic. descriptions: type: array items: $ref: '#/components/schemas/CharacteristicDescription' readOnly: true + description: The descriptions of this characteristic listed in different + languages. required: - descriptions - gene_modulo @@ -3502,6 +3525,7 @@ components: type: string format: uri readOnly: true + description: The URL of the referenced resource. required: - url ContestEffectDetail: @@ -3510,24 +3534,30 @@ components: id: type: integer readOnly: true + description: The identifier for this resource. appeal: type: integer maximum: 2147483647 minimum: -2147483648 + description: The base number of hearts the user of this move gets. jam: type: integer maximum: 2147483647 minimum: -2147483648 + description: The base number of hearts the user's opponent loses. effect_entries: type: array items: $ref: '#/components/schemas/ContestEffectEffectText' readOnly: true + description: The result of this contest effect listed in different languages. flavor_text_entries: type: array items: $ref: '#/components/schemas/ContestEffectFlavorText' readOnly: true + description: The flavor text of this contest effect listed in different + languages. required: - appeal - effect_entries @@ -3539,9 +3569,13 @@ components: properties: effect: type: string + description: The localized effect text for an API resource in a specific + language. maxLength: 6000 language: - $ref: '#/components/schemas/LanguageSummary' + allOf: + - $ref: '#/components/schemas/LanguageSummary' + description: The language this effect is in. required: - effect - language @@ -3550,9 +3584,13 @@ components: properties: flavor_text: type: string + description: The localized flavor text for an API resource in a specific + language. maxLength: 500 language: - $ref: '#/components/schemas/LanguageSummary' + allOf: + - $ref: '#/components/schemas/LanguageSummary' + description: The language this name is in. required: - flavor_text - language @@ -3563,6 +3601,7 @@ components: type: string format: uri readOnly: true + description: The URL of the referenced resource. required: - url ContestTypeDetail: @@ -3571,18 +3610,22 @@ components: id: type: integer readOnly: true + description: The identifier for this resource. name: type: string + description: The name for this resource. maxLength: 200 berry_flavor: allOf: - $ref: '#/components/schemas/BerryFlavorSummary' readOnly: true + description: The berry flavor that correlates with this contest type. names: type: array items: $ref: '#/components/schemas/ContestTypeName' readOnly: true + description: The name of this contest type listed in different languages. required: - berry_flavor - id @@ -3593,12 +3636,16 @@ components: properties: name: type: string + description: The name for this contest. maxLength: 200 color: type: string + description: The color associated with this contest's name. maxLength: 10 language: - $ref: '#/components/schemas/LanguageSummary' + allOf: + - $ref: '#/components/schemas/LanguageSummary' + description: The language that this name is in. required: - color - language @@ -3608,11 +3655,13 @@ components: properties: name: type: string + description: The name of the referenced resource. maxLength: 200 url: type: string format: uri readOnly: true + description: The URL of the referenced resource. required: - name - url @@ -3622,14 +3671,17 @@ components: id: type: integer readOnly: true + description: The identifier for this resource. name: type: string + description: The name for this resource. maxLength: 200 names: type: array items: $ref: '#/components/schemas/CurrencyName' readOnly: true + description: The name of this resource listed in different languages. required: - id - name @@ -3639,9 +3691,12 @@ components: properties: name: type: string + description: The localized name for an API resource in a specific language. maxLength: 200 language: - $ref: '#/components/schemas/LanguageSummary' + allOf: + - $ref: '#/components/schemas/LanguageSummary' + description: The language this name is in. required: - language - name @@ -3650,11 +3705,13 @@ components: properties: name: type: string + description: The name of the referenced resource. maxLength: 200 url: type: string format: uri readOnly: true + description: The URL of the referenced resource. required: - name - url @@ -3664,19 +3721,24 @@ components: id: type: integer readOnly: true + description: The identifier for this resource. name: type: string + description: The name for this resource. maxLength: 200 names: type: array items: $ref: '#/components/schemas/EggGroupName' readOnly: true + description: The name of this resource listed in different languages. pokemon_species: type: array items: $ref: '#/components/schemas/PokemonSpeciesSummary' readOnly: true + description: A list of all Pokémon species that are members of this egg + group. required: - id - name @@ -3687,9 +3749,12 @@ components: properties: name: type: string + description: The localized name for an API resource in a specific language. maxLength: 200 language: - $ref: '#/components/schemas/LanguageSummary' + allOf: + - $ref: '#/components/schemas/LanguageSummary' + description: The language this name is in. required: - language - name @@ -3698,11 +3763,13 @@ components: properties: name: type: string + description: The name of the referenced resource. maxLength: 200 url: type: string format: uri readOnly: true + description: The URL of the referenced resource. required: - name - url @@ -3712,19 +3779,23 @@ components: id: type: integer readOnly: true + description: The identifier for this resource. name: type: string + description: The name for this resource. maxLength: 200 values: type: array items: $ref: '#/components/schemas/EncounterConditionValueSummary' readOnly: true + description: A list of possible values for this encounter condition. names: type: array items: $ref: '#/components/schemas/EncounterConditionName' readOnly: true + description: The name of this resource listed in different languages. required: - id - name @@ -3735,9 +3806,12 @@ components: properties: name: type: string + description: The localized name for an API resource in a specific language. maxLength: 200 language: - $ref: '#/components/schemas/LanguageSummary' + allOf: + - $ref: '#/components/schemas/LanguageSummary' + description: The language this name is in. required: - language - name @@ -3746,11 +3820,13 @@ components: properties: name: type: string + description: The name of the referenced resource. maxLength: 200 url: type: string format: uri readOnly: true + description: The URL of the referenced resource. required: - name - url @@ -3760,16 +3836,21 @@ components: id: type: integer readOnly: true + description: The identifier for this resource. name: type: string + description: The name for this resource. maxLength: 200 condition: - $ref: '#/components/schemas/EncounterConditionSummary' + allOf: + - $ref: '#/components/schemas/EncounterConditionSummary' + description: The condition this encounter condition value pertains to. names: type: array items: $ref: '#/components/schemas/EncounterConditionValueName' readOnly: true + description: The name of this resource listed in different languages. required: - condition - id @@ -3780,9 +3861,12 @@ components: properties: name: type: string + description: The localized name for an API resource in a specific language. maxLength: 200 language: - $ref: '#/components/schemas/LanguageSummary' + allOf: + - $ref: '#/components/schemas/LanguageSummary' + description: The language this name is in. required: - language - name @@ -3791,11 +3875,13 @@ components: properties: name: type: string + description: The name of the referenced resource. maxLength: 200 url: type: string format: uri readOnly: true + description: The URL of the referenced resource. required: - name - url @@ -3805,8 +3891,10 @@ components: id: type: integer readOnly: true + description: The identifier for this resource. name: type: string + description: The name for this resource. maxLength: 200 order: type: @@ -3814,11 +3902,13 @@ components: - 'null' maximum: 2147483647 minimum: -2147483648 + description: A good value for sorting. names: type: array items: $ref: '#/components/schemas/EncounterMethodName' readOnly: true + description: The name of this resource listed in different languages. required: - id - name @@ -3828,9 +3918,12 @@ components: properties: name: type: string + description: The localized name for an API resource in a specific language. maxLength: 200 language: - $ref: '#/components/schemas/LanguageSummary' + allOf: + - $ref: '#/components/schemas/LanguageSummary' + description: The language this name is in. required: - language - name @@ -3839,11 +3932,13 @@ components: properties: name: type: string + description: The name of the referenced resource. maxLength: 200 url: type: string format: uri readOnly: true + description: The URL of the referenced resource. required: - name - url @@ -3856,24 +3951,36 @@ components: - 'null' maximum: 2147483647 minimum: -2147483648 + description: The minimum number of perfect IVs, or null if unspecified. always_shiny: type: boolean + description: Whether the encountered Pokémon is always shiny. never_shiny: type: boolean + description: Whether the encountered Pokémon can never be shiny. is_alpha: type: boolean + description: Whether the encountered Pokémon is an alpha Pokémon. EvolutionChainDetail: type: object properties: id: type: integer readOnly: true + description: The identifier for this resource. baby_trigger_item: - $ref: '#/components/schemas/ItemSummary' + oneOf: + - $ref: '#/components/schemas/ItemSummary' + - type: 'null' + description: 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. chain: allOf: - $ref: '#/components/schemas/EvolutionChainLink' readOnly: true + description: 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. required: - baby_trigger_item - chain @@ -3883,17 +3990,24 @@ components: properties: is_baby: type: boolean + description: Whether or not this link is for a baby Pokémon. This would + only ever be true on the base link. species: - $ref: '#/components/schemas/PokemonSpeciesSummary' + allOf: + - $ref: '#/components/schemas/PokemonSpeciesSummary' + description: The Pokémon species at this point in the evolution chain. evolution_details: type: array items: $ref: '#/components/schemas/PokemonEvolution' + description: All details regarding the specific details of the referenced + Pokémon species evolution. evolves_to: type: array items: - type: object - additionalProperties: {} + $ref: '#/components/schemas/EvolutionChainLink' + readOnly: true + description: A List of chain objects. required: - evolution_details - evolves_to @@ -3906,6 +4020,7 @@ components: type: string format: uri readOnly: true + description: The URL of the referenced resource. required: - url EvolutionConditionExpression: @@ -3936,19 +4051,23 @@ components: id: type: integer readOnly: true + description: The identifier for this resource. name: type: string + description: The name for this resource. maxLength: 200 names: type: array items: $ref: '#/components/schemas/EvolutionTriggerName' readOnly: true + description: The name of this resource listed in different languages. pokemon_species: type: array items: $ref: '#/components/schemas/PokemonSpeciesSummary' readOnly: true + description: A list of pokemon species that result from this evolution trigger. required: - id - name @@ -3959,9 +4078,12 @@ components: properties: name: type: string + description: The localized name for an API resource in a specific language. maxLength: 200 language: - $ref: '#/components/schemas/LanguageSummary' + allOf: + - $ref: '#/components/schemas/LanguageSummary' + description: The language this name is in. required: - language - name @@ -3970,11 +4092,13 @@ components: properties: name: type: string + description: The name of the referenced resource. maxLength: 200 url: type: string format: uri readOnly: true + description: The URL of the referenced resource. required: - name - url @@ -3983,9 +4107,13 @@ components: properties: description: type: string + description: The localized description for an API resource in a specific + language. maxLength: 2000 language: - $ref: '#/components/schemas/LanguageSummary' + allOf: + - $ref: '#/components/schemas/LanguageSummary' + description: The language this name is in. required: - language EvolutionVariableDetail: @@ -3994,33 +4122,39 @@ components: id: type: integer readOnly: true + description: The identifier for this resource. name: type: string + description: The name for this resource. maxLength: 200 symbol: type: string + description: The symbol used for this variable in evolution condition expressions. maxLength: 10 data_type: type: string + description: The data type of this variable. maxLength: 20 source: type: string - description: 'Where the value comes from: ''pokemon'' for data stored on - the Pokemon (e.g. EC, PID), ''player-input'' for an action taken by the - player while evolving (e.g. SPIN_DIR, SPIN_SEC)' + description: The source of the variable value. maxLength: 20 version_group: - $ref: '#/components/schemas/VersionGroupSummary' + allOf: + - $ref: '#/components/schemas/VersionGroupSummary' + description: The version group in which this variable was introduced. names: type: array items: $ref: '#/components/schemas/EvolutionVariableName' readOnly: true + description: The name of this resource listed in different languages. descriptions: type: array items: $ref: '#/components/schemas/EvolutionVariableDescription' readOnly: true + description: The description of this resource listed in different languages. required: - descriptions - id @@ -4033,9 +4167,12 @@ components: properties: name: type: string + description: The localized name for an API resource in a specific language. maxLength: 200 language: - $ref: '#/components/schemas/LanguageSummary' + allOf: + - $ref: '#/components/schemas/LanguageSummary' + description: The language this name is in. required: - language - name @@ -4044,11 +4181,13 @@ components: properties: name: type: string + description: The name of the referenced resource. maxLength: 200 url: type: string format: uri readOnly: true + description: The URL of the referenced resource. required: - name - url @@ -4059,10 +4198,12 @@ components: type: integer maximum: 2147483647 minimum: -2147483648 + description: The level gained. experience: type: integer maximum: 2147483647 minimum: -2147483648 + description: The amount of experience required to reach the referenced level. required: - experience - level @@ -4072,19 +4213,25 @@ components: id: type: integer readOnly: true + description: The identifier for this resource. name: type: string + description: The name for this resource. maxLength: 200 pokemon_species_details: type: array items: $ref: '#/components/schemas/GenderPokemonSpecies' readOnly: true + description: A list of Pokémon species that can be this gender and how likely + it is that they will be. required_for_evolution: type: array items: $ref: '#/components/schemas/PokemonSpeciesSummary' readOnly: true + description: A list of Pokémon species that required this gender in order + for a Pokémon to evolve into them. required: - id - name @@ -4095,8 +4242,12 @@ components: properties: rate: type: integer + description: The chance of this Pokémon being female, in eighths; or -1 + for genderless. pokemon_species: - $ref: '#/components/schemas/PokemonSpeciesSummary' + allOf: + - $ref: '#/components/schemas/PokemonSpeciesSummary' + description: A Pokémon species that can be the referenced gender. required: - pokemon_species - rate @@ -4105,11 +4256,13 @@ components: properties: name: type: string + description: The name of the referenced resource. maxLength: 200 url: type: string format: uri readOnly: true + description: The URL of the referenced resource. required: - name - url @@ -4119,41 +4272,51 @@ components: id: type: integer readOnly: true + description: The identifier for this resource. name: type: string + description: The name for this resource. maxLength: 200 abilities: type: array items: $ref: '#/components/schemas/AbilitySummary' readOnly: true + description: A list of abilities that were introduced in this generation. main_region: - $ref: '#/components/schemas/RegionSummary' + allOf: + - $ref: '#/components/schemas/RegionSummary' + description: The main region travelled in this generation. moves: type: array items: $ref: '#/components/schemas/MoveSummary' readOnly: true + description: A list of moves that were introduced in this generation. names: type: array items: $ref: '#/components/schemas/GenerationName' readOnly: true + description: The name of this resource listed in different languages. pokemon_species: type: array items: $ref: '#/components/schemas/PokemonSpeciesSummary' readOnly: true + description: A list of Pokémon species that were introduced in this generation. types: type: array items: $ref: '#/components/schemas/TypeSummary' readOnly: true + description: A list of types that were introduced in this generation. version_groups: type: array items: $ref: '#/components/schemas/VersionGroupSummary' readOnly: true + description: A list of version groups that were introduced in this generation. required: - abilities - id @@ -4169,9 +4332,12 @@ components: properties: name: type: string + description: The localized name for an API resource in a specific language. maxLength: 200 language: - $ref: '#/components/schemas/LanguageSummary' + allOf: + - $ref: '#/components/schemas/LanguageSummary' + description: The language this name is in. required: - language - name @@ -4180,11 +4346,13 @@ components: properties: name: type: string + description: The name of the referenced resource. maxLength: 200 url: type: string format: uri readOnly: true + description: The URL of the referenced resource. required: - name - url @@ -4193,9 +4361,13 @@ components: properties: description: type: string + description: The localized description for an API resource in a specific + language. maxLength: 2000 language: - $ref: '#/components/schemas/LanguageSummary' + allOf: + - $ref: '#/components/schemas/LanguageSummary' + description: The language this name is in. required: - language GrowthRateDetail: @@ -4204,27 +4376,36 @@ components: id: type: integer readOnly: true + description: The identifier for this resource. name: type: string + description: The name for this resource. maxLength: 200 formula: type: string + description: The formula used to calculate the rate at which the Pokémon + species gains level. maxLength: 500 descriptions: type: array items: $ref: '#/components/schemas/GrowthRateDescription' readOnly: true + description: The descriptions of this characteristic listed in different + languages. levels: type: array items: $ref: '#/components/schemas/Experience' readOnly: true + description: A list of levels and the amount of experienced needed to atain + them based on this growth rate. pokemon_species: type: array items: $ref: '#/components/schemas/PokemonSpeciesSummary' readOnly: true + description: A list of Pokémon species that gain levels at this growth rate. required: - descriptions - formula @@ -4237,11 +4418,13 @@ components: properties: name: type: string + description: The name of the referenced resource. maxLength: 200 url: type: string format: uri readOnly: true + description: The URL of the referenced resource. required: - name - url @@ -4250,9 +4433,13 @@ components: properties: description: type: string + description: The localized description for an API resource in a specific + language. maxLength: 2000 language: - $ref: '#/components/schemas/LanguageSummary' + allOf: + - $ref: '#/components/schemas/LanguageSummary' + description: The language this name is in. required: - language ItemAttributeDetail: @@ -4261,24 +4448,30 @@ components: id: type: integer readOnly: true + description: The identifier for this resource. name: type: string + description: The name for this resource. maxLength: 200 descriptions: type: array items: $ref: '#/components/schemas/ItemAttributeDescription' readOnly: true + description: The description of this item attribute listed in different + languages. items: type: array items: $ref: '#/components/schemas/ItemSummary' readOnly: true + description: A list of items that have this attribute. names: type: array items: $ref: '#/components/schemas/ItemAttributeName' readOnly: true + description: The name of this item attribute listed in different languages. required: - descriptions - id @@ -4290,9 +4483,12 @@ components: properties: name: type: string + description: The localized name for an API resource in a specific language. maxLength: 200 language: - $ref: '#/components/schemas/LanguageSummary' + allOf: + - $ref: '#/components/schemas/LanguageSummary' + description: The language this name is in. required: - language - name @@ -4301,11 +4497,13 @@ components: properties: name: type: string + description: The name of the referenced resource. maxLength: 200 url: type: string format: uri readOnly: true + description: The URL of the referenced resource. required: - name - url @@ -4315,21 +4513,27 @@ components: id: type: integer readOnly: true + description: The identifier for this resource. name: type: string + description: The name for this resource. maxLength: 200 items: type: array items: $ref: '#/components/schemas/ItemSummary' readOnly: true + description: A list of items that are a part of this category. names: type: array items: $ref: '#/components/schemas/ItemCategoryName' readOnly: true + description: The name of this item category listed in different languages. pocket: - $ref: '#/components/schemas/ItemPocketSummary' + allOf: + - $ref: '#/components/schemas/ItemPocketSummary' + description: The pocket items in this category would be put in. required: - id - items @@ -4341,9 +4545,12 @@ components: properties: name: type: string + description: The localized name for an API resource in a specific language. maxLength: 200 language: - $ref: '#/components/schemas/LanguageSummary' + allOf: + - $ref: '#/components/schemas/LanguageSummary' + description: The language this name is in. required: - language - name @@ -4352,11 +4559,13 @@ components: properties: name: type: string + description: The name of the referenced resource. maxLength: 200 url: type: string format: uri readOnly: true + description: The URL of the referenced resource. required: - name - url @@ -4366,8 +4575,10 @@ components: id: type: integer readOnly: true + description: The identifier for this resource. name: type: string + description: The name for this resource. maxLength: 200 fling_power: type: @@ -4375,59 +4586,78 @@ components: - 'null' maximum: 2147483647 minimum: -2147483648 + description: The power of the move Fling when used with this item. fling_effect: - $ref: '#/components/schemas/ItemFlingEffectSummary' + oneOf: + - $ref: '#/components/schemas/ItemFlingEffectSummary' + - type: 'null' + description: The effect of the move Fling when used with this item. attributes: type: array items: $ref: '#/components/schemas/ItemAttributeSummary' readOnly: true + description: A list of attributes this item has. category: - $ref: '#/components/schemas/ItemCategorySummary' + allOf: + - $ref: '#/components/schemas/ItemCategorySummary' + description: The category of items this item falls into. effect_entries: type: array items: $ref: '#/components/schemas/ItemEffectText' readOnly: true + description: The effect of this ability listed in different languages. flavor_text_entries: type: array items: $ref: '#/components/schemas/ItemFlavorText' readOnly: true + description: The flavor text of this ability listed in different languages. game_indices: type: array items: $ref: '#/components/schemas/ItemGameIndex' readOnly: true + description: A list of game indices relevent to this item by generation. prices: type: array items: $ref: '#/components/schemas/ItemPrice' readOnly: true + description: Purchase and sell prices by currency and version group. Prices + may be null when the item cannot be bought or sold. names: type: array items: $ref: '#/components/schemas/ItemName' readOnly: true + description: The name of this item listed in different languages. held_by_pokemon: type: array items: $ref: '#/components/schemas/PokemonHeldItem' readOnly: true + description: A list of Pokémon that might be found in the wild holding this + item. sprites: allOf: - $ref: '#/components/schemas/ItemSprites' readOnly: true + description: A set of sprites used to depict this item in the game. baby_trigger_for: oneOf: - $ref: '#/components/schemas/EvolutionChainSummary' - type: 'null' readOnly: true + description: An evolution chain this item requires to produce a bay during + mating. machines: type: array items: $ref: '#/components/schemas/ItemMachine' readOnly: true + description: A list of the machines related to this item. required: - attributes - baby_trigger_for @@ -4448,12 +4678,17 @@ components: properties: effect: type: string + description: The localized effect text for an API resource in a specific + language. maxLength: 6000 short_effect: type: string + description: The localized effect text in brief. maxLength: 300 language: - $ref: '#/components/schemas/LanguageSummary' + allOf: + - $ref: '#/components/schemas/LanguageSummary' + description: The language this effect is in. required: - effect - language @@ -4463,10 +4698,16 @@ components: properties: text: type: string + description: The localized flavor text for an API resource in a specific + language. version_group: - $ref: '#/components/schemas/VersionGroupSummary' + allOf: + - $ref: '#/components/schemas/VersionGroupSummary' + description: The version group which uses this flavor text. language: - $ref: '#/components/schemas/LanguageSummary' + allOf: + - $ref: '#/components/schemas/LanguageSummary' + description: The language this name is in. required: - language - text @@ -4477,19 +4718,23 @@ components: id: type: integer readOnly: true + description: The identifier for this resource. name: type: string + description: The name for this resource. maxLength: 200 effect_entries: type: array items: $ref: '#/components/schemas/ItemFlingEffectEffectText' readOnly: true + description: The result of this fling effect listed in different languages. items: type: array items: $ref: '#/components/schemas/ItemSummary' readOnly: true + description: A list of items that have this fling effect. required: - effect_entries - id @@ -4500,9 +4745,13 @@ components: properties: effect: type: string + description: The localized effect text for an API resource in a specific + language. maxLength: 6000 language: - $ref: '#/components/schemas/LanguageSummary' + allOf: + - $ref: '#/components/schemas/LanguageSummary' + description: The language this effect is in. required: - effect - language @@ -4511,11 +4760,13 @@ components: properties: name: type: string + description: The name of the referenced resource. maxLength: 200 url: type: string format: uri readOnly: true + description: The URL of the referenced resource. required: - name - url @@ -4526,8 +4777,11 @@ components: type: integer maximum: 2147483647 minimum: -2147483648 + description: The internal id of an API resource within game data. generation: - $ref: '#/components/schemas/GenerationSummary' + allOf: + - $ref: '#/components/schemas/GenerationSummary' + description: The generation relevent to this game index. required: - game_index - generation @@ -4535,9 +4789,13 @@ components: type: object properties: machine: - $ref: '#/components/schemas/MachineSummary' + allOf: + - $ref: '#/components/schemas/MachineSummary' + description: The machine that teaches a move from an item. version_group: - $ref: '#/components/schemas/VersionGroupSummary' + allOf: + - $ref: '#/components/schemas/VersionGroupSummary' + description: The version group of this specific machine. required: - machine - version_group @@ -4546,9 +4804,12 @@ components: properties: name: type: string + description: The localized name for an API resource in a specific language. maxLength: 200 language: - $ref: '#/components/schemas/LanguageSummary' + allOf: + - $ref: '#/components/schemas/LanguageSummary' + description: The language this name is in. required: - language - name @@ -4558,19 +4819,23 @@ components: id: type: integer readOnly: true + description: The identifier for this resource. name: type: string + description: The name for this resource. maxLength: 200 categories: type: array items: $ref: '#/components/schemas/ItemCategorySummary' readOnly: true + description: A list of item categories that are relevant to this item pocket. names: type: array items: $ref: '#/components/schemas/ItemPocketName' readOnly: true + description: The name of this resource listed in different languages. required: - categories - id @@ -4581,9 +4846,12 @@ components: properties: name: type: string + description: The localized name for an API resource in a specific language. maxLength: 200 language: - $ref: '#/components/schemas/LanguageSummary' + allOf: + - $ref: '#/components/schemas/LanguageSummary' + description: The language this name is in. required: - language - name @@ -4592,11 +4860,13 @@ components: properties: name: type: string + description: The name of the referenced resource. maxLength: 200 url: type: string format: uri readOnly: true + description: The URL of the referenced resource. required: - name - url @@ -4609,16 +4879,24 @@ components: - 'null' maximum: 2147483647 minimum: -2147483648 + description: The purchase price in this currency and version group, or null + if unavailable. sell_price: type: - integer - 'null' maximum: 2147483647 minimum: -2147483648 + description: The sell price in this currency and version group, or null + if unavailable. currency: - $ref: '#/components/schemas/CurrencySummary' + allOf: + - $ref: '#/components/schemas/CurrencySummary' + description: The currency used for this price. version_group: - $ref: '#/components/schemas/VersionGroupSummary' + allOf: + - $ref: '#/components/schemas/VersionGroupSummary' + description: The version group to which this price applies. required: - currency - version_group @@ -4629,6 +4907,7 @@ components: type: - string - 'null' + description: The default depiction of this item. required: - default ItemSummary: @@ -4636,11 +4915,13 @@ components: properties: name: type: string + description: The name of the referenced resource. maxLength: 200 url: type: string format: uri readOnly: true + description: The URL of the referenced resource. required: - name - url @@ -4650,22 +4931,31 @@ components: id: type: integer readOnly: true + description: The identifier for this resource. name: type: string + description: The name for this resource. maxLength: 200 official: type: boolean + description: Whether or not the games are published in this language. iso639: type: string + description: The two-letter ISO 639-1 language code. Multiple PokéAPI language + records may share this code. maxLength: 10 iso3166: type: string + description: The two-letter ISO 3166-1 alpha-2 code of the country or region + associated with this language record. Multiple PokéAPI language records + may share this code. maxLength: 2 names: type: array items: $ref: '#/components/schemas/LanguageName' readOnly: true + description: The name of this resource listed in different languages. required: - id - iso3166 @@ -4677,9 +4967,12 @@ components: properties: name: type: string + description: The localized name for an API resource in a specific language. maxLength: 200 language: - $ref: '#/components/schemas/LanguageSummary' + allOf: + - $ref: '#/components/schemas/LanguageSummary' + description: The language this name is in. required: - language - name @@ -4688,11 +4981,13 @@ components: properties: name: type: string + description: The name of the referenced resource. maxLength: 200 url: type: string format: uri readOnly: true + description: The URL of the referenced resource. required: - name - url @@ -4702,30 +4997,41 @@ components: id: type: integer readOnly: true + description: The identifier for this resource. name: type: string + description: The name for this resource. maxLength: 200 game_index: type: integer maximum: 2147483647 minimum: -2147483648 + description: The internal id of an API resource within game data. encounter_method_rates: type: array items: $ref: '#/components/schemas/LocationAreaEncounterRate' readOnly: true + description: 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. location: - $ref: '#/components/schemas/LocationSummary' + allOf: + - $ref: '#/components/schemas/LocationSummary' + description: The region this location area can be found in. names: type: array items: $ref: '#/components/schemas/LocationAreaName' readOnly: true + description: The name of this resource listed in different languages. pokemon_encounters: type: array items: $ref: '#/components/schemas/LocationAreaPokemonEncounter' readOnly: true + description: A list of Pokémon that can be encountered in this area along + with version specific details about the encounter. required: - encounter_method_rates - game_index @@ -4739,23 +5045,32 @@ components: properties: min_level: type: integer + description: The lowest level the Pokémon could be encountered at. max_level: type: integer + description: The highest level the Pokémon could be encountered at. chance: type: integer default: 0 + description: Percent chance that this encounter will occur. method: - $ref: '#/components/schemas/EncounterMethodSummary' + allOf: + - $ref: '#/components/schemas/EncounterMethodSummary' + description: The method by which this encounter happens. condition_values: type: array items: $ref: '#/components/schemas/EncounterConditionValueSummary' readOnly: true + description: A list of condition values that must be in effect for this + encounter to occur. pokemon_details: oneOf: - $ref: '#/components/schemas/EncounterPokemonDetail' - type: 'null' readOnly: true + description: Additional properties of the encountered Pokémon, or null if + unspecified. required: - condition_values - max_level @@ -4765,11 +5080,14 @@ components: type: object properties: encounter_method: - $ref: '#/components/schemas/EncounterMethodSummary' + allOf: + - $ref: '#/components/schemas/EncounterMethodSummary' + description: The method in which Pokémon may be encountered in an area.. version_details: type: array items: $ref: '#/components/schemas/LocationAreaEncounterVersionDetail' + description: The chance of the encounter to occur on a version of the game. required: - encounter_method - version_details @@ -4778,8 +5096,12 @@ components: properties: rate: type: integer + description: The chance of an encounter to occur. version: - $ref: '#/components/schemas/VersionSummary' + allOf: + - $ref: '#/components/schemas/VersionSummary' + description: The version of the game in which the encounter can occur with + the given chance. required: - rate - version @@ -4788,9 +5110,12 @@ components: properties: name: type: string + description: The localized name for an API resource in a specific language. maxLength: 200 language: - $ref: '#/components/schemas/LanguageSummary' + allOf: + - $ref: '#/components/schemas/LanguageSummary' + description: The language this name is in. required: - language - name @@ -4798,11 +5123,15 @@ components: type: object properties: pokemon: - $ref: '#/components/schemas/PokemonSummary' + allOf: + - $ref: '#/components/schemas/PokemonSummary' + description: The Pokémon being encountered. version_details: type: array items: $ref: '#/components/schemas/LocationAreaPokemonEncounterVersion' + description: A list of versions and encounters with Pokémon that might happen + in the referenced location area. required: - pokemon - version_details @@ -4810,13 +5139,17 @@ components: type: object properties: version: - $ref: '#/components/schemas/VersionSummary' + allOf: + - $ref: '#/components/schemas/VersionSummary' + description: The game version this encounter happens in. max_chance: type: integer + description: The total percentage of all encounter potential. encounter_details: type: array items: $ref: '#/components/schemas/LocationAreaEncounterDetail' + description: A list of encounters and their specifics. required: - encounter_details - max_chance @@ -4826,11 +5159,13 @@ components: properties: name: type: string + description: The name of the referenced resource. maxLength: 200 url: type: string format: uri readOnly: true + description: The URL of the referenced resource. required: - name - url @@ -4840,28 +5175,34 @@ components: id: type: integer readOnly: true + description: The identifier for this resource. name: type: string + description: The name for this resource. maxLength: 200 region: oneOf: - $ref: '#/components/schemas/RegionSummary' - type: 'null' + description: The region this location can be found in. names: type: array items: $ref: '#/components/schemas/LocationName' readOnly: true + description: The name of this resource listed in different languages. game_indices: type: array items: $ref: '#/components/schemas/LocationGameIndex' readOnly: true + description: A list of game indices relevent to this location by generation. areas: type: array items: $ref: '#/components/schemas/LocationAreaSummary' readOnly: true + description: Areas that can be found within this location. required: - areas - game_indices @@ -4876,8 +5217,11 @@ components: type: integer maximum: 2147483647 minimum: -2147483648 + description: The internal id of an API resource within game data. generation: - $ref: '#/components/schemas/GenerationSummary' + allOf: + - $ref: '#/components/schemas/GenerationSummary' + description: The generation relevent to this game index. required: - game_index - generation @@ -4886,9 +5230,12 @@ components: properties: name: type: string + description: The localized name for an API resource in a specific language. maxLength: 200 language: - $ref: '#/components/schemas/LanguageSummary' + allOf: + - $ref: '#/components/schemas/LanguageSummary' + description: The language this name is in. required: - language - name @@ -4897,11 +5244,13 @@ components: properties: name: type: string + description: The name of the referenced resource. maxLength: 200 url: type: string format: uri readOnly: true + description: The URL of the referenced resource. required: - name - url @@ -4911,12 +5260,19 @@ components: id: type: integer readOnly: true + description: The identifier for this resource. item: - $ref: '#/components/schemas/ItemSummary' + allOf: + - $ref: '#/components/schemas/ItemSummary' + description: The TM or HM item that corresponds to this machine. version_group: - $ref: '#/components/schemas/VersionGroupSummary' + allOf: + - $ref: '#/components/schemas/VersionGroupSummary' + description: The version group that this machine applies to. move: - $ref: '#/components/schemas/MoveSummary' + allOf: + - $ref: '#/components/schemas/MoveSummary' + description: The move that is taught by this machine. required: - id - item @@ -4929,6 +5285,7 @@ components: type: string format: uri readOnly: true + description: The URL of the referenced resource. required: - url MoveBattleStyleDetail: @@ -4937,14 +5294,17 @@ components: id: type: integer readOnly: true + description: The identifier for this resource. name: type: string + description: The name for this resource. maxLength: 200 names: type: array items: $ref: '#/components/schemas/MoveBattleStyleName' readOnly: true + description: The name of this resource listed in different languages. required: - id - name @@ -4954,9 +5314,12 @@ components: properties: name: type: string + description: The localized name for an API resource in a specific language. maxLength: 200 language: - $ref: '#/components/schemas/LanguageSummary' + allOf: + - $ref: '#/components/schemas/LanguageSummary' + description: The language this name is in. required: - language - name @@ -4965,11 +5328,13 @@ components: properties: name: type: string + description: The name of the referenced resource. maxLength: 200 url: type: string format: uri readOnly: true + description: The URL of the referenced resource. required: - name - url @@ -4982,29 +5347,43 @@ components: - 'null' maximum: 2147483647 minimum: -2147483648 + description: The percent value of how likely this move is to be successful. power: type: - integer - 'null' maximum: 2147483647 minimum: -2147483648 + description: The base power before the listed version group, or null if + power did not change. pp: type: - integer - 'null' maximum: 2147483647 minimum: -2147483648 + description: Power points. The number of times this move can be used. effect_chance: - type: integer + type: + - integer + - 'null' + description: The percent value of how likely it is this moves effect will + take effect. effect_entries: type: array items: $ref: '#/components/schemas/MoveEffectEffectText' readOnly: true + description: The effect of this move listed in different languages. type: - $ref: '#/components/schemas/TypeSummary' + oneOf: + - $ref: '#/components/schemas/TypeSummary' + - type: 'null' + description: The elemental type of this move. version_group: - $ref: '#/components/schemas/VersionGroupSummary' + allOf: + - $ref: '#/components/schemas/VersionGroupSummary' + description: The version group in which these move stat values were in effect. required: - effect_chance - effect_entries @@ -5019,12 +5398,14 @@ components: - 'null' items: $ref: '#/components/schemas/MoveSummary' + description: A list of moves to use before this move. use_after: type: - array - 'null' items: $ref: '#/components/schemas/MoveSummary' + description: A list of moves to use after this move. required: - use_after - use_before @@ -5032,9 +5413,15 @@ components: type: object properties: normal: - $ref: '#/components/schemas/MoveComboUsage' + allOf: + - $ref: '#/components/schemas/MoveComboUsage' + description: A detail of moves this move can be used before or after, granting + additional appeal points in contests. super: - $ref: '#/components/schemas/MoveComboUsage' + allOf: + - $ref: '#/components/schemas/MoveComboUsage' + description: A detail of moves this move can be used before or after, granting + additional appeal points in super contests. required: - normal - super @@ -5043,9 +5430,13 @@ components: properties: description: type: string + description: The localized description for an API resource in a specific + language. maxLength: 2000 language: - $ref: '#/components/schemas/LanguageSummary' + allOf: + - $ref: '#/components/schemas/LanguageSummary' + description: The language this name is in. required: - language MoveDamageClassDetail: @@ -5054,24 +5445,29 @@ components: id: type: integer readOnly: true + description: The identifier for this resource. name: type: string + description: The name for this resource. maxLength: 200 descriptions: type: array items: $ref: '#/components/schemas/MoveDamageClassDescription' readOnly: true + description: The description of this resource listed in different languages. moves: type: array items: $ref: '#/components/schemas/MoveSummary' readOnly: true + description: A list of moves that fall into this damage class. names: type: array items: $ref: '#/components/schemas/MoveDamageClassName' readOnly: true + description: The name of this resource listed in different languages. required: - descriptions - id @@ -5083,9 +5479,12 @@ components: properties: name: type: string + description: The localized name for an API resource in a specific language. maxLength: 200 language: - $ref: '#/components/schemas/LanguageSummary' + allOf: + - $ref: '#/components/schemas/LanguageSummary' + description: The language this name is in. required: - language - name @@ -5094,11 +5493,13 @@ components: properties: name: type: string + description: The name of the referenced resource. maxLength: 200 url: type: string format: uri readOnly: true + description: The URL of the referenced resource. required: - name - url @@ -5108,8 +5509,10 @@ components: id: type: integer readOnly: true + description: The identifier for this resource. name: type: string + description: The name for this resource. maxLength: 200 accuracy: type: @@ -5117,89 +5520,133 @@ components: - 'null' maximum: 2147483647 minimum: -2147483648 + description: The percent value of how likely this move is to be successful. effect_chance: - type: integer + type: + - integer + - 'null' + description: The percent value of how likely it is this moves effect will + happen. pp: type: - integer - 'null' maximum: 2147483647 minimum: -2147483648 + description: Power points. The number of times this move can be used. priority: type: - integer - 'null' maximum: 2147483647 minimum: -2147483648 + description: 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. power: type: - integer - 'null' maximum: 2147483647 minimum: -2147483648 + description: The base power of this move, or null if it has no fixed base + power. contest_combos: oneOf: - $ref: '#/components/schemas/MoveCombos' - type: 'null' readOnly: true + description: A detail of normal and super contest combos that require this + move. contest_type: - $ref: '#/components/schemas/ContestTypeSummary' + oneOf: + - $ref: '#/components/schemas/ContestTypeSummary' + - type: 'null' + description: The type of appeal this move gives a Pokémon when used in a + contest. contest_effect: - $ref: '#/components/schemas/ContestEffectSummary' + oneOf: + - $ref: '#/components/schemas/ContestEffectSummary' + - type: 'null' + description: The effect the move has when used in a contest. damage_class: - $ref: '#/components/schemas/MoveDamageClassSummary' + allOf: + - $ref: '#/components/schemas/MoveDamageClassSummary' + description: The type of damage the move inflicts on the target, e.g. physical. effect_entries: type: array items: $ref: '#/components/schemas/MoveEffectEffectText' readOnly: true + description: The effect of this move listed in different languages. effect_changes: type: array items: $ref: '#/components/schemas/MoveEffectChange' readOnly: true + description: The list of previous effects this move has had across version + groups of the games. generation: - $ref: '#/components/schemas/GenerationSummary' - meta: allOf: + - $ref: '#/components/schemas/GenerationSummary' + description: The generation in which this move was introduced. + meta: + oneOf: - $ref: '#/components/schemas/MoveMeta' + - type: 'null' readOnly: true + description: Metadata about this move names: type: array items: $ref: '#/components/schemas/MoveName' readOnly: true + description: The name of this resource listed in different languages. past_values: type: array items: $ref: '#/components/schemas/MoveChange' readOnly: true + description: A list of move resource value changes across version groups + of the game. stat_changes: type: array items: $ref: '#/components/schemas/MoveMetaStatChange' readOnly: true + description: A list of stats this moves effects and how much it effects + them. super_contest_effect: - $ref: '#/components/schemas/SuperContestEffectSummary' + oneOf: + - $ref: '#/components/schemas/SuperContestEffectSummary' + - type: 'null' + description: The effect the move has when used in a super contest. target: - $ref: '#/components/schemas/MoveTargetSummary' + allOf: + - $ref: '#/components/schemas/MoveTargetSummary' + description: The type of target that will receive the effects of the attack. type: - $ref: '#/components/schemas/TypeSummary' + allOf: + - $ref: '#/components/schemas/TypeSummary' + description: The elemental type of this move. machines: type: array items: $ref: '#/components/schemas/ItemMachine' readOnly: true + description: A list of the machines that teach this move. flavor_text_entries: type: array items: $ref: '#/components/schemas/MoveFlavorText' readOnly: true + description: The flavor text of this move listed in different languages. learned_by_pokemon: type: array items: $ref: '#/components/schemas/PokemonSummary' readOnly: true + description: List of Pokemon that can learn the move required: - contest_combos - contest_effect @@ -5225,12 +5672,16 @@ components: type: object properties: version_group: - $ref: '#/components/schemas/VersionGroupSummary' + allOf: + - $ref: '#/components/schemas/VersionGroupSummary' + description: The version group in which the previous effect of this ability + originated. effect_entries: type: array items: $ref: '#/components/schemas/MoveEffectChangeEffectText' readOnly: true + description: The previous effect of this ability listed in different languages. required: - effect_entries - version_group @@ -5239,9 +5690,13 @@ components: properties: effect: type: string + description: The localized effect text for an API resource in a specific + language. maxLength: 6000 language: - $ref: '#/components/schemas/LanguageSummary' + allOf: + - $ref: '#/components/schemas/LanguageSummary' + description: The language this effect is in. required: - effect - language @@ -5250,12 +5705,17 @@ components: properties: effect: type: string + description: The localized effect text for an API resource in a specific + language. maxLength: 6000 short_effect: type: string + description: The localized effect text in brief. maxLength: 300 language: - $ref: '#/components/schemas/LanguageSummary' + allOf: + - $ref: '#/components/schemas/LanguageSummary' + description: The language this effect is in. required: - effect - language @@ -5265,10 +5725,16 @@ components: properties: flavor_text: type: string + description: The localized flavor text for an api resource in a specific + language. language: - $ref: '#/components/schemas/LanguageSummary' + allOf: + - $ref: '#/components/schemas/LanguageSummary' + description: The language this name is in. version_group: - $ref: '#/components/schemas/VersionGroupSummary' + allOf: + - $ref: '#/components/schemas/VersionGroupSummary' + description: The version group that uses this flavor text. required: - flavor_text - language @@ -5278,9 +5744,13 @@ components: properties: description: type: string + description: The localized description for an API resource in a specific + language. maxLength: 2000 language: - $ref: '#/components/schemas/LanguageSummary' + allOf: + - $ref: '#/components/schemas/LanguageSummary' + description: The language this name is in. required: - language MoveLearnMethodDetail: @@ -5289,24 +5759,30 @@ components: id: type: integer readOnly: true + description: The identifier for this resource. name: type: string + description: The name for this resource. maxLength: 200 names: type: array items: $ref: '#/components/schemas/MoveLearnMethodName' readOnly: true + description: The name of this resource listed in different languages. descriptions: type: array items: $ref: '#/components/schemas/MoveLearnMethodDescription' readOnly: true + description: The description of this resource listed in different languages. version_groups: type: array items: $ref: '#/components/schemas/VersionGroupSummary' readOnly: true + description: A list of version groups where moves can be learned through + this method. required: - descriptions - id @@ -5318,9 +5794,12 @@ components: properties: name: type: string + description: The localized name for an API resource in a specific language. maxLength: 200 language: - $ref: '#/components/schemas/LanguageSummary' + allOf: + - $ref: '#/components/schemas/LanguageSummary' + description: The language this name is in. required: - language - name @@ -5329,11 +5808,13 @@ components: properties: name: type: string + description: The name of the referenced resource. maxLength: 200 url: type: string format: uri readOnly: true + description: The URL of the referenced resource. required: - name - url @@ -5341,69 +5822,92 @@ components: type: object properties: ailment: - $ref: '#/components/schemas/MoveMetaAilmentSummary' + allOf: + - $ref: '#/components/schemas/MoveMetaAilmentSummary' + description: The status ailment this move inflicts on its target. category: - $ref: '#/components/schemas/MoveMetaCategorySummary' + allOf: + - $ref: '#/components/schemas/MoveMetaCategorySummary' + description: The category of move this move falls under, e.g. damage or + ailment. min_hits: type: - integer - 'null' maximum: 2147483647 minimum: -2147483648 + description: The minimum number of times this move hits. Null if it always + only hits once. max_hits: type: - integer - 'null' maximum: 2147483647 minimum: -2147483648 + description: The maximum number of times this move hits. Null if it always + only hits once. min_turns: type: - integer - 'null' maximum: 2147483647 minimum: -2147483648 + description: The minimum number of turns this move continues to take effect. + Null if it always only lasts one turn. max_turns: type: - integer - 'null' maximum: 2147483647 minimum: -2147483648 + description: The maximum number of turns this move continues to take effect. + Null if it always only lasts one turn. drain: type: - integer - 'null' maximum: 2147483647 minimum: -2147483648 + description: HP drain (if positive) or Recoil damage (if negative), in percent + of damage done. healing: type: - integer - 'null' maximum: 2147483647 minimum: -2147483648 + description: The amount of hp gained by the attacking Pokemon, in percent + of it's maximum HP. crit_rate: type: - integer - 'null' maximum: 2147483647 minimum: -2147483648 + description: Critical hit rate bonus. ailment_chance: type: - integer - 'null' maximum: 2147483647 minimum: -2147483648 + description: The likelihood this attack will cause an ailment. flinch_chance: type: - integer - 'null' maximum: 2147483647 minimum: -2147483648 + description: The likelihood this attack will cause the target Pokémon to + flinch. stat_chance: type: - integer - 'null' maximum: 2147483647 minimum: -2147483648 + description: The likelihood this attack will cause a stat change in the + target Pokémon. required: - ailment - category @@ -5413,19 +5917,23 @@ components: id: type: integer readOnly: true + description: The identifier for this resource. name: type: string + description: The name for this resource. maxLength: 200 moves: type: array items: $ref: '#/components/schemas/MoveSummary' readOnly: true + description: A list of moves that cause this ailment. names: type: array items: $ref: '#/components/schemas/MoveMetaAilmentName' readOnly: true + description: The name of this resource listed in different languages. required: - id - moves @@ -5436,9 +5944,12 @@ components: properties: name: type: string + description: The localized name for an API resource in a specific language. maxLength: 200 language: - $ref: '#/components/schemas/LanguageSummary' + allOf: + - $ref: '#/components/schemas/LanguageSummary' + description: The language this name is in. required: - language - name @@ -5447,11 +5958,13 @@ components: properties: name: type: string + description: The name of the referenced resource. maxLength: 200 url: type: string format: uri readOnly: true + description: The URL of the referenced resource. required: - name - url @@ -5460,9 +5973,13 @@ components: properties: description: type: string + description: The localized description for an API resource in a specific + language. maxLength: 2000 language: - $ref: '#/components/schemas/LanguageSummary' + allOf: + - $ref: '#/components/schemas/LanguageSummary' + description: The language this name is in. required: - language MoveMetaCategoryDetail: @@ -5471,19 +5988,23 @@ components: id: type: integer readOnly: true + description: The identifier for this resource. name: type: string + description: The name for this resource. maxLength: 200 descriptions: type: array items: $ref: '#/components/schemas/MoveMetaCategoryDescription' readOnly: true + description: The description of this resource listed in different languages. moves: type: array items: $ref: '#/components/schemas/MoveSummary' readOnly: true + description: A list of moves that fall into this category. required: - descriptions - id @@ -5494,11 +6015,13 @@ components: properties: name: type: string + description: The name of the referenced resource. maxLength: 200 url: type: string format: uri readOnly: true + description: The URL of the referenced resource. required: - name - url @@ -5509,8 +6032,11 @@ components: type: integer maximum: 2147483647 minimum: -2147483648 + description: The amount of change. stat: - $ref: '#/components/schemas/StatSummary' + allOf: + - $ref: '#/components/schemas/StatSummary' + description: The stat being affected. required: - change - stat @@ -5519,9 +6045,12 @@ components: properties: name: type: string + description: The localized name for an API resource in a specific language. maxLength: 200 language: - $ref: '#/components/schemas/LanguageSummary' + allOf: + - $ref: '#/components/schemas/LanguageSummary' + description: The language this name is in. required: - language - name @@ -5532,8 +6061,11 @@ components: type: integer maximum: 2147483647 minimum: -2147483648 + description: The maximum amount of change to the referenced stat. move: - $ref: '#/components/schemas/MoveSummary' + allOf: + - $ref: '#/components/schemas/MoveSummary' + description: The move causing the change. required: - change - move @@ -5542,11 +6074,13 @@ components: properties: name: type: string + description: The name of the referenced resource. maxLength: 200 url: type: string format: uri readOnly: true + description: The URL of the referenced resource. required: - name - url @@ -5555,9 +6089,13 @@ components: properties: description: type: string + description: The localized description for an API resource in a specific + language. maxLength: 2000 language: - $ref: '#/components/schemas/LanguageSummary' + allOf: + - $ref: '#/components/schemas/LanguageSummary' + description: The language this name is in. required: - language MoveTargetDetail: @@ -5566,24 +6104,29 @@ components: id: type: integer readOnly: true + description: The identifier for this resource. name: type: string + description: The name for this resource. maxLength: 200 descriptions: type: array items: $ref: '#/components/schemas/MoveTargetDescription' readOnly: true + description: The description of this resource listed in different languages. moves: type: array items: $ref: '#/components/schemas/MoveSummary' readOnly: true + description: A list of moves that that are directed at this target. names: type: array items: $ref: '#/components/schemas/MoveTargetName' readOnly: true + description: The name of this resource listed in different languages. required: - descriptions - id @@ -5595,9 +6138,12 @@ components: properties: name: type: string + description: The localized name for an API resource in a specific language. maxLength: 200 language: - $ref: '#/components/schemas/LanguageSummary' + allOf: + - $ref: '#/components/schemas/LanguageSummary' + description: The language this name is in. required: - language - name @@ -5606,11 +6152,13 @@ components: properties: name: type: string + description: The name of the referenced resource. maxLength: 200 url: type: string format: uri readOnly: true + description: The URL of the referenced resource. required: - name - url @@ -5621,12 +6169,16 @@ components: type: integer maximum: 2147483647 minimum: -2147483648 + description: Chance of using the move, in percent, if HP is under one half. high_hp_preference: type: integer maximum: 2147483647 minimum: -2147483648 + description: Chance of using the move, in percent, if HP is over one half. move_battle_style: - $ref: '#/components/schemas/MoveBattleStyleSummary' + allOf: + - $ref: '#/components/schemas/MoveBattleStyleSummary' + description: The move battle style. required: - high_hp_preference - low_hp_preference @@ -5637,39 +6189,52 @@ components: id: type: integer readOnly: true + description: The identifier for this resource. name: type: string + description: The name for this resource. maxLength: 200 decreased_stat: - $ref: '#/components/schemas/StatSummary' + oneOf: + - $ref: '#/components/schemas/StatSummary' + - type: 'null' + description: The stat decreased by 10% in Pokémon with this nature. increased_stat: - $ref: '#/components/schemas/StatSummary' + oneOf: + - $ref: '#/components/schemas/StatSummary' + - type: 'null' + description: The stat increased by 10% in Pokémon with this nature. likes_flavor: - $ref: '#/components/schemas/BerryFlavorSummary' + oneOf: + - $ref: '#/components/schemas/BerryFlavorSummary' + - type: 'null' + description: The flavor liked by Pokémon with this nature. hates_flavor: - $ref: '#/components/schemas/BerryFlavorSummary' - berries: - type: array - items: - $ref: '#/components/schemas/BerrySummary' - readOnly: true + oneOf: + - $ref: '#/components/schemas/BerryFlavorSummary' + - type: 'null' + description: The flavor hated by Pokémon with this nature. pokeathlon_stat_changes: type: array items: $ref: '#/components/schemas/NaturePokeathlonStat' readOnly: true + description: A list of Pokéathlon stats this nature effects and how much + it effects them. move_battle_style_preferences: type: array items: $ref: '#/components/schemas/NatureBattleStylePreference' readOnly: true + description: 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. names: type: array items: $ref: '#/components/schemas/NatureName' readOnly: true + description: The name of this resource listed in different languages. required: - - berries - decreased_stat - hates_flavor - id @@ -5684,9 +6249,12 @@ components: properties: name: type: string + description: The localized name for an API resource in a specific language. maxLength: 200 language: - $ref: '#/components/schemas/LanguageSummary' + allOf: + - $ref: '#/components/schemas/LanguageSummary' + description: The language this name is in. required: - language - name @@ -5697,8 +6265,11 @@ components: type: integer maximum: 2147483647 minimum: -2147483648 + description: The amount of change. pokeathlon_stat: - $ref: '#/components/schemas/PokeathlonStatSummary' + allOf: + - $ref: '#/components/schemas/PokeathlonStatSummary' + description: The stat being affected. required: - max_change - pokeathlon_stat @@ -5707,11 +6278,13 @@ components: properties: name: type: string + description: The name of the referenced resource. maxLength: 200 url: type: string format: uri readOnly: true + description: The URL of the referenced resource. required: - name - url @@ -5723,21 +6296,29 @@ components: properties: count: type: integer - example: 123 + example: 100 + description: The total number of resources available from this API. next: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=400&limit=100 + description: The URL for the next page in the list, or null if there is + no next page. + example: https://pokeapi.co/api/v2/ability/?offset=40&limit=20 previous: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=200&limit=100 + description: The URL for the previous page in the list, or null if there + is no previous page. + example: https://pokeapi.co/api/v2/ability/?offset=0&limit=20 results: type: array items: $ref: '#/components/schemas/AbilitySummary' + description: A list of API resources on this page. PaginatedBerryFirmnessSummaryList: type: object required: @@ -5746,21 +6327,29 @@ components: properties: count: type: integer - example: 123 + example: 100 + description: The total number of resources available from this API. next: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=400&limit=100 + description: The URL for the next page in the list, or null if there is + no next page. + example: https://pokeapi.co/api/v2/berry-firmness/?offset=40&limit=20 previous: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=200&limit=100 + description: The URL for the previous page in the list, or null if there + is no previous page. + example: https://pokeapi.co/api/v2/berry-firmness/?offset=0&limit=20 results: type: array items: $ref: '#/components/schemas/BerryFirmnessSummary' + description: A list of API resources on this page. PaginatedBerryFlavorSummaryList: type: object required: @@ -5769,21 +6358,29 @@ components: properties: count: type: integer - example: 123 + example: 100 + description: The total number of resources available from this API. next: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=400&limit=100 + description: The URL for the next page in the list, or null if there is + no next page. + example: https://pokeapi.co/api/v2/berry-flavor/?offset=40&limit=20 previous: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=200&limit=100 + description: The URL for the previous page in the list, or null if there + is no previous page. + example: https://pokeapi.co/api/v2/berry-flavor/?offset=0&limit=20 results: type: array items: $ref: '#/components/schemas/BerryFlavorSummary' + description: A list of API resources on this page. PaginatedBerrySummaryList: type: object required: @@ -5792,21 +6389,29 @@ components: properties: count: type: integer - example: 123 + example: 100 + description: The total number of resources available from this API. next: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=400&limit=100 + description: The URL for the next page in the list, or null if there is + no next page. + example: https://pokeapi.co/api/v2/berry/?offset=40&limit=20 previous: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=200&limit=100 + description: The URL for the previous page in the list, or null if there + is no previous page. + example: https://pokeapi.co/api/v2/berry/?offset=0&limit=20 results: type: array items: $ref: '#/components/schemas/BerrySummary' + description: A list of API resources on this page. PaginatedCharacteristicSummaryList: type: object required: @@ -5815,21 +6420,29 @@ components: properties: count: type: integer - example: 123 + example: 100 + description: The total number of resources available from this API. next: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=400&limit=100 + description: The URL for the next page in the list, or null if there is + no next page. + example: https://pokeapi.co/api/v2/characteristic/?offset=40&limit=20 previous: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=200&limit=100 + description: The URL for the previous page in the list, or null if there + is no previous page. + example: https://pokeapi.co/api/v2/characteristic/?offset=0&limit=20 results: type: array items: $ref: '#/components/schemas/CharacteristicSummary' + description: A list of API resources on this page. PaginatedContestEffectSummaryList: type: object required: @@ -5838,21 +6451,29 @@ components: properties: count: type: integer - example: 123 + example: 100 + description: The total number of resources available from this API. next: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=400&limit=100 + description: The URL for the next page in the list, or null if there is + no next page. + example: https://pokeapi.co/api/v2/contest-effect/?offset=40&limit=20 previous: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=200&limit=100 + description: The URL for the previous page in the list, or null if there + is no previous page. + example: https://pokeapi.co/api/v2/contest-effect/?offset=0&limit=20 results: type: array items: $ref: '#/components/schemas/ContestEffectSummary' + description: A list of API resources on this page. PaginatedContestTypeSummaryList: type: object required: @@ -5861,21 +6482,29 @@ components: properties: count: type: integer - example: 123 + example: 100 + description: The total number of resources available from this API. next: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=400&limit=100 + description: The URL for the next page in the list, or null if there is + no next page. + example: https://pokeapi.co/api/v2/contest-type/?offset=40&limit=20 previous: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=200&limit=100 + description: The URL for the previous page in the list, or null if there + is no previous page. + example: https://pokeapi.co/api/v2/contest-type/?offset=0&limit=20 results: type: array items: $ref: '#/components/schemas/ContestTypeSummary' + description: A list of API resources on this page. PaginatedCurrencySummaryList: type: object required: @@ -5884,21 +6513,29 @@ components: properties: count: type: integer - example: 123 + example: 100 + description: The total number of resources available from this API. next: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=400&limit=100 + description: The URL for the next page in the list, or null if there is + no next page. + example: https://pokeapi.co/api/v2/currency/?offset=40&limit=20 previous: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=200&limit=100 + description: The URL for the previous page in the list, or null if there + is no previous page. + example: https://pokeapi.co/api/v2/currency/?offset=0&limit=20 results: type: array items: $ref: '#/components/schemas/CurrencySummary' + description: A list of API resources on this page. PaginatedEggGroupSummaryList: type: object required: @@ -5907,21 +6544,29 @@ components: properties: count: type: integer - example: 123 + example: 100 + description: The total number of resources available from this API. next: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=400&limit=100 + description: The URL for the next page in the list, or null if there is + no next page. + example: https://pokeapi.co/api/v2/egg-group/?offset=40&limit=20 previous: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=200&limit=100 + description: The URL for the previous page in the list, or null if there + is no previous page. + example: https://pokeapi.co/api/v2/egg-group/?offset=0&limit=20 results: type: array items: $ref: '#/components/schemas/EggGroupSummary' + description: A list of API resources on this page. PaginatedEncounterConditionSummaryList: type: object required: @@ -5930,21 +6575,29 @@ components: properties: count: type: integer - example: 123 + example: 100 + description: The total number of resources available from this API. next: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=400&limit=100 + description: The URL for the next page in the list, or null if there is + no next page. + example: https://pokeapi.co/api/v2/encounter-condition/?offset=40&limit=20 previous: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=200&limit=100 + description: The URL for the previous page in the list, or null if there + is no previous page. + example: https://pokeapi.co/api/v2/encounter-condition/?offset=0&limit=20 results: type: array items: $ref: '#/components/schemas/EncounterConditionSummary' + description: A list of API resources on this page. PaginatedEncounterConditionValueSummaryList: type: object required: @@ -5953,21 +6606,29 @@ components: properties: count: type: integer - example: 123 + example: 100 + description: The total number of resources available from this API. next: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=400&limit=100 + description: The URL for the next page in the list, or null if there is + no next page. + example: https://pokeapi.co/api/v2/encounter-condition-value/?offset=40&limit=20 previous: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=200&limit=100 + description: The URL for the previous page in the list, or null if there + is no previous page. + example: https://pokeapi.co/api/v2/encounter-condition-value/?offset=0&limit=20 results: type: array items: $ref: '#/components/schemas/EncounterConditionValueSummary' + description: A list of API resources on this page. PaginatedEncounterMethodSummaryList: type: object required: @@ -5976,21 +6637,29 @@ components: properties: count: type: integer - example: 123 + example: 100 + description: The total number of resources available from this API. next: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=400&limit=100 + description: The URL for the next page in the list, or null if there is + no next page. + example: https://pokeapi.co/api/v2/encounter-method/?offset=40&limit=20 previous: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=200&limit=100 + description: The URL for the previous page in the list, or null if there + is no previous page. + example: https://pokeapi.co/api/v2/encounter-method/?offset=0&limit=20 results: type: array items: $ref: '#/components/schemas/EncounterMethodSummary' + description: A list of API resources on this page. PaginatedEvolutionChainSummaryList: type: object required: @@ -5999,21 +6668,29 @@ components: properties: count: type: integer - example: 123 + example: 100 + description: The total number of resources available from this API. next: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=400&limit=100 + description: The URL for the next page in the list, or null if there is + no next page. + example: https://pokeapi.co/api/v2/evolution-chain/?offset=40&limit=20 previous: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=200&limit=100 + description: The URL for the previous page in the list, or null if there + is no previous page. + example: https://pokeapi.co/api/v2/evolution-chain/?offset=0&limit=20 results: type: array items: $ref: '#/components/schemas/EvolutionChainSummary' + description: A list of API resources on this page. PaginatedEvolutionTriggerSummaryList: type: object required: @@ -6022,21 +6699,29 @@ components: properties: count: type: integer - example: 123 + example: 100 + description: The total number of resources available from this API. next: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=400&limit=100 + description: The URL for the next page in the list, or null if there is + no next page. + example: https://pokeapi.co/api/v2/evolution-trigger/?offset=40&limit=20 previous: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=200&limit=100 + description: The URL for the previous page in the list, or null if there + is no previous page. + example: https://pokeapi.co/api/v2/evolution-trigger/?offset=0&limit=20 results: type: array items: $ref: '#/components/schemas/EvolutionTriggerSummary' + description: A list of API resources on this page. PaginatedEvolutionVariableSummaryList: type: object required: @@ -6045,21 +6730,29 @@ components: properties: count: type: integer - example: 123 + example: 100 + description: The total number of resources available from this API. next: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=400&limit=100 + description: The URL for the next page in the list, or null if there is + no next page. + example: https://pokeapi.co/api/v2/evolution-variable/?offset=40&limit=20 previous: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=200&limit=100 + description: The URL for the previous page in the list, or null if there + is no previous page. + example: https://pokeapi.co/api/v2/evolution-variable/?offset=0&limit=20 results: type: array items: $ref: '#/components/schemas/EvolutionVariableSummary' + description: A list of API resources on this page. PaginatedGenderSummaryList: type: object required: @@ -6068,21 +6761,29 @@ components: properties: count: type: integer - example: 123 + example: 100 + description: The total number of resources available from this API. next: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=400&limit=100 + description: The URL for the next page in the list, or null if there is + no next page. + example: https://pokeapi.co/api/v2/gender/?offset=40&limit=20 previous: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=200&limit=100 + description: The URL for the previous page in the list, or null if there + is no previous page. + example: https://pokeapi.co/api/v2/gender/?offset=0&limit=20 results: type: array items: $ref: '#/components/schemas/GenderSummary' + description: A list of API resources on this page. PaginatedGenerationSummaryList: type: object required: @@ -6091,21 +6792,29 @@ components: properties: count: type: integer - example: 123 + example: 100 + description: The total number of resources available from this API. next: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=400&limit=100 + description: The URL for the next page in the list, or null if there is + no next page. + example: https://pokeapi.co/api/v2/generation/?offset=40&limit=20 previous: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=200&limit=100 + description: The URL for the previous page in the list, or null if there + is no previous page. + example: https://pokeapi.co/api/v2/generation/?offset=0&limit=20 results: type: array items: $ref: '#/components/schemas/GenerationSummary' + description: A list of API resources on this page. PaginatedGrowthRateSummaryList: type: object required: @@ -6114,21 +6823,29 @@ components: properties: count: type: integer - example: 123 + example: 100 + description: The total number of resources available from this API. next: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=400&limit=100 + description: The URL for the next page in the list, or null if there is + no next page. + example: https://pokeapi.co/api/v2/growth-rate/?offset=40&limit=20 previous: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=200&limit=100 + description: The URL for the previous page in the list, or null if there + is no previous page. + example: https://pokeapi.co/api/v2/growth-rate/?offset=0&limit=20 results: type: array items: $ref: '#/components/schemas/GrowthRateSummary' + description: A list of API resources on this page. PaginatedItemAttributeSummaryList: type: object required: @@ -6137,21 +6854,29 @@ components: properties: count: type: integer - example: 123 + example: 100 + description: The total number of resources available from this API. next: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=400&limit=100 + description: The URL for the next page in the list, or null if there is + no next page. + example: https://pokeapi.co/api/v2/item-attribute/?offset=40&limit=20 previous: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=200&limit=100 + description: The URL for the previous page in the list, or null if there + is no previous page. + example: https://pokeapi.co/api/v2/item-attribute/?offset=0&limit=20 results: type: array items: $ref: '#/components/schemas/ItemAttributeSummary' + description: A list of API resources on this page. PaginatedItemCategorySummaryList: type: object required: @@ -6160,21 +6885,29 @@ components: properties: count: type: integer - example: 123 + example: 100 + description: The total number of resources available from this API. next: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=400&limit=100 + description: The URL for the next page in the list, or null if there is + no next page. + example: https://pokeapi.co/api/v2/item-category/?offset=40&limit=20 previous: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=200&limit=100 + description: The URL for the previous page in the list, or null if there + is no previous page. + example: https://pokeapi.co/api/v2/item-category/?offset=0&limit=20 results: type: array items: $ref: '#/components/schemas/ItemCategorySummary' + description: A list of API resources on this page. PaginatedItemFlingEffectSummaryList: type: object required: @@ -6183,21 +6916,29 @@ components: properties: count: type: integer - example: 123 + example: 100 + description: The total number of resources available from this API. next: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=400&limit=100 + description: The URL for the next page in the list, or null if there is + no next page. + example: https://pokeapi.co/api/v2/item-fling-effect/?offset=40&limit=20 previous: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=200&limit=100 + description: The URL for the previous page in the list, or null if there + is no previous page. + example: https://pokeapi.co/api/v2/item-fling-effect/?offset=0&limit=20 results: type: array items: $ref: '#/components/schemas/ItemFlingEffectSummary' + description: A list of API resources on this page. PaginatedItemPocketSummaryList: type: object required: @@ -6206,21 +6947,29 @@ components: properties: count: type: integer - example: 123 + example: 100 + description: The total number of resources available from this API. next: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=400&limit=100 + description: The URL for the next page in the list, or null if there is + no next page. + example: https://pokeapi.co/api/v2/item-pocket/?offset=40&limit=20 previous: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=200&limit=100 + description: The URL for the previous page in the list, or null if there + is no previous page. + example: https://pokeapi.co/api/v2/item-pocket/?offset=0&limit=20 results: type: array items: $ref: '#/components/schemas/ItemPocketSummary' + description: A list of API resources on this page. PaginatedItemSummaryList: type: object required: @@ -6229,21 +6978,29 @@ components: properties: count: type: integer - example: 123 + example: 100 + description: The total number of resources available from this API. next: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=400&limit=100 + description: The URL for the next page in the list, or null if there is + no next page. + example: https://pokeapi.co/api/v2/item/?offset=40&limit=20 previous: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=200&limit=100 + description: The URL for the previous page in the list, or null if there + is no previous page. + example: https://pokeapi.co/api/v2/item/?offset=0&limit=20 results: type: array items: $ref: '#/components/schemas/ItemSummary' + description: A list of API resources on this page. PaginatedLanguageSummaryList: type: object required: @@ -6252,21 +7009,29 @@ components: properties: count: type: integer - example: 123 + example: 100 + description: The total number of resources available from this API. next: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=400&limit=100 + description: The URL for the next page in the list, or null if there is + no next page. + example: https://pokeapi.co/api/v2/language/?offset=40&limit=20 previous: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=200&limit=100 + description: The URL for the previous page in the list, or null if there + is no previous page. + example: https://pokeapi.co/api/v2/language/?offset=0&limit=20 results: type: array items: $ref: '#/components/schemas/LanguageSummary' + description: A list of API resources on this page. PaginatedLocationAreaSummaryList: type: object required: @@ -6275,21 +7040,29 @@ components: properties: count: type: integer - example: 123 + example: 100 + description: The total number of resources available from this API. next: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=400&limit=100 + description: The URL for the next page in the list, or null if there is + no next page. + example: https://pokeapi.co/api/v2/location-area/?offset=40&limit=20 previous: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=200&limit=100 + description: The URL for the previous page in the list, or null if there + is no previous page. + example: https://pokeapi.co/api/v2/location-area/?offset=0&limit=20 results: type: array items: $ref: '#/components/schemas/LocationAreaSummary' + description: A list of API resources on this page. PaginatedLocationSummaryList: type: object required: @@ -6298,21 +7071,29 @@ components: properties: count: type: integer - example: 123 + example: 100 + description: The total number of resources available from this API. next: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=400&limit=100 + description: The URL for the next page in the list, or null if there is + no next page. + example: https://pokeapi.co/api/v2/location/?offset=40&limit=20 previous: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=200&limit=100 + description: The URL for the previous page in the list, or null if there + is no previous page. + example: https://pokeapi.co/api/v2/location/?offset=0&limit=20 results: type: array items: $ref: '#/components/schemas/LocationSummary' + description: A list of API resources on this page. PaginatedMachineSummaryList: type: object required: @@ -6321,21 +7102,29 @@ components: properties: count: type: integer - example: 123 + example: 100 + description: The total number of resources available from this API. next: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=400&limit=100 + description: The URL for the next page in the list, or null if there is + no next page. + example: https://pokeapi.co/api/v2/machine/?offset=40&limit=20 previous: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=200&limit=100 + description: The URL for the previous page in the list, or null if there + is no previous page. + example: https://pokeapi.co/api/v2/machine/?offset=0&limit=20 results: type: array items: $ref: '#/components/schemas/MachineSummary' + description: A list of API resources on this page. PaginatedMoveBattleStyleSummaryList: type: object required: @@ -6344,21 +7133,29 @@ components: properties: count: type: integer - example: 123 + example: 100 + description: The total number of resources available from this API. next: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=400&limit=100 + description: The URL for the next page in the list, or null if there is + no next page. + example: https://pokeapi.co/api/v2/move-battle-style/?offset=40&limit=20 previous: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=200&limit=100 + description: The URL for the previous page in the list, or null if there + is no previous page. + example: https://pokeapi.co/api/v2/move-battle-style/?offset=0&limit=20 results: type: array items: $ref: '#/components/schemas/MoveBattleStyleSummary' + description: A list of API resources on this page. PaginatedMoveDamageClassSummaryList: type: object required: @@ -6367,21 +7164,29 @@ components: properties: count: type: integer - example: 123 + example: 100 + description: The total number of resources available from this API. next: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=400&limit=100 + description: The URL for the next page in the list, or null if there is + no next page. + example: https://pokeapi.co/api/v2/move-damage-class/?offset=40&limit=20 previous: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=200&limit=100 + description: The URL for the previous page in the list, or null if there + is no previous page. + example: https://pokeapi.co/api/v2/move-damage-class/?offset=0&limit=20 results: type: array items: $ref: '#/components/schemas/MoveDamageClassSummary' + description: A list of API resources on this page. PaginatedMoveLearnMethodSummaryList: type: object required: @@ -6390,21 +7195,29 @@ components: properties: count: type: integer - example: 123 + example: 100 + description: The total number of resources available from this API. next: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=400&limit=100 + description: The URL for the next page in the list, or null if there is + no next page. + example: https://pokeapi.co/api/v2/move-learn-method/?offset=40&limit=20 previous: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=200&limit=100 + description: The URL for the previous page in the list, or null if there + is no previous page. + example: https://pokeapi.co/api/v2/move-learn-method/?offset=0&limit=20 results: type: array items: $ref: '#/components/schemas/MoveLearnMethodSummary' + description: A list of API resources on this page. PaginatedMoveMetaAilmentSummaryList: type: object required: @@ -6413,21 +7226,29 @@ components: properties: count: type: integer - example: 123 + example: 100 + description: The total number of resources available from this API. next: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=400&limit=100 + description: The URL for the next page in the list, or null if there is + no next page. + example: https://pokeapi.co/api/v2/move-ailment/?offset=40&limit=20 previous: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=200&limit=100 + description: The URL for the previous page in the list, or null if there + is no previous page. + example: https://pokeapi.co/api/v2/move-ailment/?offset=0&limit=20 results: type: array items: $ref: '#/components/schemas/MoveMetaAilmentSummary' + description: A list of API resources on this page. PaginatedMoveMetaCategorySummaryList: type: object required: @@ -6436,21 +7257,29 @@ components: properties: count: type: integer - example: 123 + example: 100 + description: The total number of resources available from this API. next: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=400&limit=100 + description: The URL for the next page in the list, or null if there is + no next page. + example: https://pokeapi.co/api/v2/move-category/?offset=40&limit=20 previous: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=200&limit=100 + description: The URL for the previous page in the list, or null if there + is no previous page. + example: https://pokeapi.co/api/v2/move-category/?offset=0&limit=20 results: type: array items: $ref: '#/components/schemas/MoveMetaCategorySummary' + description: A list of API resources on this page. PaginatedMoveSummaryList: type: object required: @@ -6459,21 +7288,29 @@ components: properties: count: type: integer - example: 123 + example: 100 + description: The total number of resources available from this API. next: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=400&limit=100 + description: The URL for the next page in the list, or null if there is + no next page. + example: https://pokeapi.co/api/v2/move/?offset=40&limit=20 previous: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=200&limit=100 + description: The URL for the previous page in the list, or null if there + is no previous page. + example: https://pokeapi.co/api/v2/move/?offset=0&limit=20 results: type: array items: $ref: '#/components/schemas/MoveSummary' + description: A list of API resources on this page. PaginatedMoveTargetSummaryList: type: object required: @@ -6482,21 +7319,29 @@ components: properties: count: type: integer - example: 123 + example: 100 + description: The total number of resources available from this API. next: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=400&limit=100 + description: The URL for the next page in the list, or null if there is + no next page. + example: https://pokeapi.co/api/v2/move-target/?offset=40&limit=20 previous: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=200&limit=100 + description: The URL for the previous page in the list, or null if there + is no previous page. + example: https://pokeapi.co/api/v2/move-target/?offset=0&limit=20 results: type: array items: $ref: '#/components/schemas/MoveTargetSummary' + description: A list of API resources on this page. PaginatedNatureSummaryList: type: object required: @@ -6505,21 +7350,29 @@ components: properties: count: type: integer - example: 123 + example: 100 + description: The total number of resources available from this API. next: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=400&limit=100 + description: The URL for the next page in the list, or null if there is + no next page. + example: https://pokeapi.co/api/v2/nature/?offset=40&limit=20 previous: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=200&limit=100 + description: The URL for the previous page in the list, or null if there + is no previous page. + example: https://pokeapi.co/api/v2/nature/?offset=0&limit=20 results: type: array items: $ref: '#/components/schemas/NatureSummary' + description: A list of API resources on this page. PaginatedPalParkAreaSummaryList: type: object required: @@ -6528,21 +7381,29 @@ components: properties: count: type: integer - example: 123 + example: 100 + description: The total number of resources available from this API. next: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=400&limit=100 + description: The URL for the next page in the list, or null if there is + no next page. + example: https://pokeapi.co/api/v2/pal-park-area/?offset=40&limit=20 previous: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=200&limit=100 + description: The URL for the previous page in the list, or null if there + is no previous page. + example: https://pokeapi.co/api/v2/pal-park-area/?offset=0&limit=20 results: type: array items: $ref: '#/components/schemas/PalParkAreaSummary' + description: A list of API resources on this page. PaginatedPokeathlonStatSummaryList: type: object required: @@ -6551,21 +7412,29 @@ components: properties: count: type: integer - example: 123 + example: 100 + description: The total number of resources available from this API. next: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=400&limit=100 + description: The URL for the next page in the list, or null if there is + no next page. + example: https://pokeapi.co/api/v2/pokeathlon-stat/?offset=40&limit=20 previous: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=200&limit=100 + description: The URL for the previous page in the list, or null if there + is no previous page. + example: https://pokeapi.co/api/v2/pokeathlon-stat/?offset=0&limit=20 results: type: array items: $ref: '#/components/schemas/PokeathlonStatSummary' + description: A list of API resources on this page. PaginatedPokedexSummaryList: type: object required: @@ -6574,21 +7443,29 @@ components: properties: count: type: integer - example: 123 + example: 100 + description: The total number of resources available from this API. next: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=400&limit=100 + description: The URL for the next page in the list, or null if there is + no next page. + example: https://pokeapi.co/api/v2/pokedex/?offset=40&limit=20 previous: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=200&limit=100 + description: The URL for the previous page in the list, or null if there + is no previous page. + example: https://pokeapi.co/api/v2/pokedex/?offset=0&limit=20 results: type: array items: $ref: '#/components/schemas/PokedexSummary' + description: A list of API resources on this page. PaginatedPokemonColorSummaryList: type: object required: @@ -6597,21 +7474,29 @@ components: properties: count: type: integer - example: 123 + example: 100 + description: The total number of resources available from this API. next: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=400&limit=100 + description: The URL for the next page in the list, or null if there is + no next page. + example: https://pokeapi.co/api/v2/pokemon-color/?offset=40&limit=20 previous: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=200&limit=100 + description: The URL for the previous page in the list, or null if there + is no previous page. + example: https://pokeapi.co/api/v2/pokemon-color/?offset=0&limit=20 results: type: array items: $ref: '#/components/schemas/PokemonColorSummary' + description: A list of API resources on this page. PaginatedPokemonFormSummaryList: type: object required: @@ -6620,21 +7505,29 @@ components: properties: count: type: integer - example: 123 + example: 100 + description: The total number of resources available from this API. next: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=400&limit=100 + description: The URL for the next page in the list, or null if there is + no next page. + example: https://pokeapi.co/api/v2/pokemon-form/?offset=40&limit=20 previous: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=200&limit=100 + description: The URL for the previous page in the list, or null if there + is no previous page. + example: https://pokeapi.co/api/v2/pokemon-form/?offset=0&limit=20 results: type: array items: $ref: '#/components/schemas/PokemonFormSummary' + description: A list of API resources on this page. PaginatedPokemonHabitatSummaryList: type: object required: @@ -6643,21 +7536,29 @@ components: properties: count: type: integer - example: 123 + example: 100 + description: The total number of resources available from this API. next: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=400&limit=100 + description: The URL for the next page in the list, or null if there is + no next page. + example: https://pokeapi.co/api/v2/pokemon-habitat/?offset=40&limit=20 previous: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=200&limit=100 + description: The URL for the previous page in the list, or null if there + is no previous page. + example: https://pokeapi.co/api/v2/pokemon-habitat/?offset=0&limit=20 results: type: array items: $ref: '#/components/schemas/PokemonHabitatSummary' + description: A list of API resources on this page. PaginatedPokemonShapeSummaryList: type: object required: @@ -6666,21 +7567,29 @@ components: properties: count: type: integer - example: 123 + example: 100 + description: The total number of resources available from this API. next: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=400&limit=100 + description: The URL for the next page in the list, or null if there is + no next page. + example: https://pokeapi.co/api/v2/pokemon-shape/?offset=40&limit=20 previous: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=200&limit=100 + description: The URL for the previous page in the list, or null if there + is no previous page. + example: https://pokeapi.co/api/v2/pokemon-shape/?offset=0&limit=20 results: type: array items: $ref: '#/components/schemas/PokemonShapeSummary' + description: A list of API resources on this page. PaginatedPokemonSpeciesSummaryList: type: object required: @@ -6689,21 +7598,29 @@ components: properties: count: type: integer - example: 123 + example: 100 + description: The total number of resources available from this API. next: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=400&limit=100 + description: The URL for the next page in the list, or null if there is + no next page. + example: https://pokeapi.co/api/v2/pokemon-species/?offset=40&limit=20 previous: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=200&limit=100 + description: The URL for the previous page in the list, or null if there + is no previous page. + example: https://pokeapi.co/api/v2/pokemon-species/?offset=0&limit=20 results: type: array items: $ref: '#/components/schemas/PokemonSpeciesSummary' + description: A list of API resources on this page. PaginatedPokemonSummaryList: type: object required: @@ -6712,21 +7629,29 @@ components: properties: count: type: integer - example: 123 + example: 100 + description: The total number of resources available from this API. next: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=400&limit=100 + description: The URL for the next page in the list, or null if there is + no next page. + example: https://pokeapi.co/api/v2/pokemon/?offset=40&limit=20 previous: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=200&limit=100 + description: The URL for the previous page in the list, or null if there + is no previous page. + example: https://pokeapi.co/api/v2/pokemon/?offset=0&limit=20 results: type: array items: $ref: '#/components/schemas/PokemonSummary' + description: A list of API resources on this page. PaginatedRegionSummaryList: type: object required: @@ -6735,21 +7660,29 @@ components: properties: count: type: integer - example: 123 + example: 100 + description: The total number of resources available from this API. next: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=400&limit=100 + description: The URL for the next page in the list, or null if there is + no next page. + example: https://pokeapi.co/api/v2/region/?offset=40&limit=20 previous: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=200&limit=100 + description: The URL for the previous page in the list, or null if there + is no previous page. + example: https://pokeapi.co/api/v2/region/?offset=0&limit=20 results: type: array items: $ref: '#/components/schemas/RegionSummary' + description: A list of API resources on this page. PaginatedStatSummaryList: type: object required: @@ -6758,21 +7691,29 @@ components: properties: count: type: integer - example: 123 + example: 100 + description: The total number of resources available from this API. next: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=400&limit=100 + description: The URL for the next page in the list, or null if there is + no next page. + example: https://pokeapi.co/api/v2/stat/?offset=40&limit=20 previous: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=200&limit=100 + description: The URL for the previous page in the list, or null if there + is no previous page. + example: https://pokeapi.co/api/v2/stat/?offset=0&limit=20 results: type: array items: $ref: '#/components/schemas/StatSummary' + description: A list of API resources on this page. PaginatedSuperContestEffectSummaryList: type: object required: @@ -6781,21 +7722,29 @@ components: properties: count: type: integer - example: 123 + example: 100 + description: The total number of resources available from this API. next: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=400&limit=100 + description: The URL for the next page in the list, or null if there is + no next page. + example: https://pokeapi.co/api/v2/super-contest-effect/?offset=40&limit=20 previous: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=200&limit=100 + description: The URL for the previous page in the list, or null if there + is no previous page. + example: https://pokeapi.co/api/v2/super-contest-effect/?offset=0&limit=20 results: type: array items: $ref: '#/components/schemas/SuperContestEffectSummary' + description: A list of API resources on this page. PaginatedTypeSummaryList: type: object required: @@ -6804,21 +7753,29 @@ components: properties: count: type: integer - example: 123 + example: 100 + description: The total number of resources available from this API. next: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=400&limit=100 + description: The URL for the next page in the list, or null if there is + no next page. + example: https://pokeapi.co/api/v2/type/?offset=40&limit=20 previous: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=200&limit=100 + description: The URL for the previous page in the list, or null if there + is no previous page. + example: https://pokeapi.co/api/v2/type/?offset=0&limit=20 results: type: array items: $ref: '#/components/schemas/TypeSummary' + description: A list of API resources on this page. PaginatedVersionGroupSummaryList: type: object required: @@ -6827,21 +7784,29 @@ components: properties: count: type: integer - example: 123 + example: 100 + description: The total number of resources available from this API. next: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=400&limit=100 + description: The URL for the next page in the list, or null if there is + no next page. + example: https://pokeapi.co/api/v2/version-group/?offset=40&limit=20 previous: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=200&limit=100 + description: The URL for the previous page in the list, or null if there + is no previous page. + example: https://pokeapi.co/api/v2/version-group/?offset=0&limit=20 results: type: array items: $ref: '#/components/schemas/VersionGroupSummary' + description: A list of API resources on this page. PaginatedVersionSummaryList: type: object required: @@ -6850,40 +7815,53 @@ components: properties: count: type: integer - example: 123 + example: 100 + description: The total number of resources available from this API. next: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=400&limit=100 + description: The URL for the next page in the list, or null if there is + no next page. + example: https://pokeapi.co/api/v2/version/?offset=40&limit=20 previous: - type: string - nullable: true + type: + - string + - 'null' format: uri - example: http://api.example.org/accounts/?offset=200&limit=100 + description: The URL for the previous page in the list, or null if there + is no previous page. + example: https://pokeapi.co/api/v2/version/?offset=0&limit=20 results: type: array items: $ref: '#/components/schemas/VersionSummary' + description: A list of API resources on this page. PalParkAreaDetail: type: object properties: id: type: integer readOnly: true + description: The identifier for this resource. name: type: string + description: The name for this resource. maxLength: 200 names: type: array items: $ref: '#/components/schemas/PalParkAreaName' readOnly: true + description: The name of this resource listed in different languages. pokemon_encounters: type: array items: $ref: '#/components/schemas/PalParkEncounter' readOnly: true + description: A list of Pokémon encountered in thi pal park area along with + details. required: - id - name @@ -6894,9 +7872,12 @@ components: properties: name: type: string + description: The localized name for an API resource in a specific language. maxLength: 200 language: - $ref: '#/components/schemas/LanguageSummary' + allOf: + - $ref: '#/components/schemas/LanguageSummary' + description: The language this name is in. required: - language - name @@ -6905,11 +7886,13 @@ components: properties: name: type: string + description: The name of the referenced resource. maxLength: 200 url: type: string format: uri readOnly: true + description: The URL of the referenced resource. required: - name - url @@ -6922,12 +7905,18 @@ components: - 'null' maximum: 2147483647 minimum: -2147483648 + description: The base score given to the player when this Pokémon is caught + during a pal park run. rate: type: integer maximum: 2147483647 minimum: -2147483648 + description: The base rate for encountering this Pokémon in this pal park + area. pokemon_species: - $ref: '#/components/schemas/PokemonSpeciesSummary' + allOf: + - $ref: '#/components/schemas/PokemonSpeciesSummary' + description: The Pokémon species being encountered. required: - pokemon_species - rate @@ -6938,14 +7927,17 @@ components: type: - string - 'null' + description: The deployment time as a Unix timestamp string. hash: type: - string - 'null' + description: The source commit hash used for this deployment. tag: type: - string - 'null' + description: The deployment tag, or null if the deployment has no tag. required: - deploy_date - hash @@ -6957,8 +7949,11 @@ components: type: integer maximum: 2147483647 minimum: -2147483648 + description: The maximum amount of change to the referenced Pokéathlon stat. nature: - $ref: '#/components/schemas/NatureSummary' + allOf: + - $ref: '#/components/schemas/NatureSummary' + description: The nature causing the change. required: - max_change - nature @@ -6969,10 +7964,14 @@ components: type: array items: $ref: '#/components/schemas/PokeathlonStatAffectingNature' + description: A list of natures and how they change the referenced Pokéathlon + stat. decrease: type: array items: $ref: '#/components/schemas/PokeathlonStatAffectingNature' + description: A list of natures and how they change the referenced Pokéathlon + stat. required: - decrease - increase @@ -6982,18 +7981,23 @@ components: id: type: integer readOnly: true + description: The identifier for this resource. name: type: string + description: The name for this resource. maxLength: 200 affecting_natures: allOf: - $ref: '#/components/schemas/PokeathlonStatAffectingNatures' readOnly: true + description: A detail of natures which affect this Pokéathlon stat positively + or negatively. names: type: array items: $ref: '#/components/schemas/PokeathlonStatName' readOnly: true + description: The name of this resource listed in different languages. required: - affecting_natures - id @@ -7004,9 +8008,12 @@ components: properties: name: type: string + description: The localized name for an API resource in a specific language. maxLength: 200 language: - $ref: '#/components/schemas/LanguageSummary' + allOf: + - $ref: '#/components/schemas/LanguageSummary' + description: The language this name is in. required: - language - name @@ -7015,11 +8022,13 @@ components: properties: name: type: string + description: The name of the referenced resource. maxLength: 200 url: type: string format: uri readOnly: true + description: The URL of the referenced resource. required: - name - url @@ -7028,9 +8037,13 @@ components: properties: description: type: string + description: The localized description for an API resource in a specific + language. maxLength: 2000 language: - $ref: '#/components/schemas/LanguageSummary' + allOf: + - $ref: '#/components/schemas/LanguageSummary' + description: The language this name is in. required: - language PokedexDetail: @@ -7039,33 +8052,44 @@ components: id: type: integer readOnly: true + description: The identifier for this resource. name: type: string + description: The name for this resource. maxLength: 200 is_main_series: type: boolean + description: Whether or not this Pokédex originated in the main series of + the video games. descriptions: type: array items: $ref: '#/components/schemas/PokedexDescription' readOnly: true + description: The description of this resource listed in different languages. names: type: array items: $ref: '#/components/schemas/PokedexName' readOnly: true + description: The name of this resource listed in different languages. pokemon_entries: type: array items: $ref: '#/components/schemas/PokemonDexNumber' readOnly: true + description: A list of Pokémon catalogued in this Pokédex and their indexes. region: - $ref: '#/components/schemas/RegionSummary' + oneOf: + - $ref: '#/components/schemas/RegionSummary' + - type: 'null' + description: The region this Pokédex catalogues Pokémon for. version_groups: type: array items: $ref: '#/components/schemas/VersionGroupSummary' readOnly: true + description: A list of version groups this Pokédex is relevant to. required: - descriptions - id @@ -7079,9 +8103,12 @@ components: properties: name: type: string + description: The localized name for an API resource in a specific language. maxLength: 200 language: - $ref: '#/components/schemas/LanguageSummary' + allOf: + - $ref: '#/components/schemas/LanguageSummary' + description: The language this name is in. required: - language - name @@ -7090,11 +8117,13 @@ components: properties: name: type: string + description: The name of the referenced resource. maxLength: 200 url: type: string format: uri readOnly: true + description: The URL of the referenced resource. required: - name - url @@ -7103,12 +8132,16 @@ components: properties: is_hidden: type: boolean + description: Whether or not this is a hidden ability. slot: type: integer maximum: 2147483647 minimum: -2147483648 + description: The slot this ability occupies in this Pokémon species. ability: - $ref: '#/components/schemas/AbilitySummary' + allOf: + - $ref: '#/components/schemas/AbilitySummary' + description: The ability the Pokémon may have. required: - ability - slot @@ -7117,12 +8150,17 @@ components: properties: is_hidden: type: boolean + description: Whether or not this is a hidden ability. slot: type: integer maximum: 2147483647 minimum: -2147483648 + description: The slot this ability occupies in this Pokémon species. ability: - $ref: '#/components/schemas/AbilitySummary' + oneOf: + - $ref: '#/components/schemas/AbilitySummary' + - type: 'null' + description: The ability the Pokémon may have. required: - ability - slot @@ -7132,19 +8170,23 @@ components: id: type: integer readOnly: true + description: The identifier for this resource. name: type: string + description: The name for this resource. maxLength: 200 names: type: array items: $ref: '#/components/schemas/PokemonColorName' readOnly: true + description: The name of this resource listed in different languages. pokemon_species: type: array items: $ref: '#/components/schemas/PokemonSpeciesSummary' readOnly: true + description: A list of the Pokémon species that have this color. required: - id - name @@ -7155,9 +8197,12 @@ components: properties: name: type: string + description: The localized name for an API resource in a specific language. maxLength: 200 language: - $ref: '#/components/schemas/LanguageSummary' + allOf: + - $ref: '#/components/schemas/LanguageSummary' + description: The language this name is in. required: - language - name @@ -7166,11 +8211,13 @@ components: properties: name: type: string + description: The name of the referenced resource. maxLength: 200 url: type: string format: uri readOnly: true + description: The URL of the referenced resource. required: - name - url @@ -7181,10 +8228,12 @@ components: type: - string - 'null' + description: The latest depiction of this Pokémon's cry. legacy: type: - string - 'null' + description: The legacy depiction of this Pokémon's cry. required: - latest - legacy @@ -7194,8 +8243,10 @@ components: id: type: integer readOnly: true + description: The identifier for this resource. name: type: string + description: The name for this resource. maxLength: 200 base_experience: type: @@ -7203,89 +8254,117 @@ components: - 'null' maximum: 2147483647 minimum: -2147483648 + description: The base experience gained for defeating this Pokémon. height: type: - integer - 'null' maximum: 2147483647 minimum: -2147483648 + description: The height of this Pokémon in decimetres. is_default: type: boolean + description: Set for exactly one Pokémon used as the default for each species. order: type: - integer - 'null' maximum: 2147483647 minimum: -2147483648 + description: Order for sorting. Almost national order, except families are + grouped together. weight: type: - integer - 'null' maximum: 2147483647 minimum: -2147483648 + description: The weight of this Pokémon in hectograms. abilities: type: array items: $ref: '#/components/schemas/PokemonAbility' readOnly: true + description: A list of abilities this Pokémon could potentially have. past_abilities: type: array items: $ref: '#/components/schemas/PokemonPastAbility' readOnly: true + description: A list of details showing abilities this pokémon had in previous + generations forms: type: array items: $ref: '#/components/schemas/PokemonFormSummary' readOnly: true + description: A list of forms this Pokémon can take on. game_indices: type: array items: $ref: '#/components/schemas/PokemonGameIndex' readOnly: true + description: A list of game indices relevent to Pokémon item by generation. held_items: type: array items: - $ref: '#/components/schemas/PokemonHeldItem' + $ref: '#/components/schemas/PokemonHeldItemSummary' readOnly: true + description: A list of items this Pokémon may be holding when encountered. location_area_encounters: type: string readOnly: true + description: A link to a list of location areas, as well as encounter details + pertaining to specific versions. moves: type: array items: $ref: '#/components/schemas/PokemonMove' readOnly: true + description: A list of moves along with learn methods and level details + pertaining to specific version groups. species: - $ref: '#/components/schemas/PokemonSpeciesSummary' + allOf: + - $ref: '#/components/schemas/PokemonSpeciesSummary' + description: The species this Pokémon belongs to. sprites: allOf: - $ref: '#/components/schemas/PokemonSprites' readOnly: true + description: A set of sprites used to depict this Pokémon in the game. A + visual representation of the various sprites can be found at PokeAPI/sprites cries: allOf: - $ref: '#/components/schemas/PokemonCries' readOnly: true + description: A set of cries used to depict this Pokémon in the game. A visual + representation of the various cries can be found at PokeAPI/cries stats: type: array items: $ref: '#/components/schemas/PokemonStat' readOnly: true + description: A list of base stat values for this Pokémon. past_stats: type: array items: $ref: '#/components/schemas/PokemonPastStat' readOnly: true + description: A list of details showing stats this pokémon had in previous + generations types: type: array items: $ref: '#/components/schemas/PokemonType' readOnly: true + description: A list of details showing types this Pokémon has. past_types: type: array items: $ref: '#/components/schemas/PokemonPastType' readOnly: true + description: A list of details showing types this pokémon had in previous + generations required: - abilities - cries @@ -7308,8 +8387,11 @@ components: properties: entry_number: type: integer + description: The index number within the Pokédex. pokedex: - $ref: '#/components/schemas/PokedexSummary' + allOf: + - $ref: '#/components/schemas/PokedexSummary' + description: The Pokédex the referenced Pokémon species can be found in. required: - entry_number - pokedex @@ -7318,8 +8400,11 @@ components: properties: entry_number: type: integer + description: The index of this Pokémon species entry within the Pokédex. pokemon_species: - $ref: '#/components/schemas/PokemonSpeciesSummary' + allOf: + - $ref: '#/components/schemas/PokemonSpeciesSummary' + description: The Pokémon species being encountered. required: - entry_number - pokemon_species @@ -7328,16 +8413,23 @@ components: properties: chance: type: integer + description: Percent chance that this encounter will occur. condition_values: type: array items: $ref: '#/components/schemas/EncounterConditionValueSummary' + description: A list of condition values that must be in effect for this + encounter to occur. max_level: type: integer + description: The highest level the Pokémon could be encountered at. method: - $ref: '#/components/schemas/EncounterMethodSummary' + allOf: + - $ref: '#/components/schemas/EncounterMethodSummary' + description: The method by which this encounter happens. min_level: type: integer + description: The lowest level the Pokémon could be encountered at. required: - chance - condition_values @@ -7348,11 +8440,16 @@ components: type: object properties: location_area: - $ref: '#/components/schemas/LocationAreaSummary' + allOf: + - $ref: '#/components/schemas/LocationAreaSummary' + description: The location area the referenced Pokémon can be encountered + in. version_details: type: array items: $ref: '#/components/schemas/PokemonEncounterVersionDetailResponse' + description: A list of versions and encounters with the referenced Pokémon + that might happen. required: - location_area - version_details @@ -7360,13 +8457,17 @@ components: type: object properties: version: - $ref: '#/components/schemas/VersionSummary' + allOf: + - $ref: '#/components/schemas/VersionSummary' + description: The game version this encounter happens in. max_chance: type: integer + description: The total percentage of all encounter potential. encounter_details: type: array items: $ref: '#/components/schemas/PokemonEncounterDetailResponse' + description: A list of encounters and their specifics. required: - encounter_details - max_chance @@ -7375,108 +8476,197 @@ components: type: object properties: version_group: - $ref: '#/components/schemas/VersionGroupSummary' + allOf: + - $ref: '#/components/schemas/VersionGroupSummary' + description: The version group in which these evolution requirements apply. is_default: type: boolean + description: 'Whether the evolution is considered as the expected evolution + in a main series game. Each unique Pokémon variety of a line capable of + evolution should have exactly one ''default'' evolution. For example, + the Meowth species has three default evolutions as there are three distinct + varieties it can evolve into: Persian, Alolan Persian, and Perrserker.' item: - $ref: '#/components/schemas/ItemSummary' + oneOf: + - $ref: '#/components/schemas/ItemSummary' + - type: 'null' + description: The item required to cause evolution this into Pokémon species. trigger: - $ref: '#/components/schemas/EvolutionTriggerSummary' + allOf: + - $ref: '#/components/schemas/EvolutionTriggerSummary' + description: The type of event that triggers evolution into this Pokémon + species. gender: type: - integer - 'null' + description: The id of the gender of the evolving Pokémon species must be + in order to evolve into this Pokémon species. held_item: - $ref: '#/components/schemas/ItemSummary' + oneOf: + - $ref: '#/components/schemas/ItemSummary' + - type: 'null' + description: The item the evolving Pokémon species must be holding during + the evolution trigger event to evolve into this Pokémon species. known_move: - $ref: '#/components/schemas/MoveSummary' + oneOf: + - $ref: '#/components/schemas/MoveSummary' + - type: 'null' + description: 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. known_move_type: - $ref: '#/components/schemas/TypeSummary' + oneOf: + - $ref: '#/components/schemas/TypeSummary' + - type: 'null' + description: 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. location: - $ref: '#/components/schemas/LocationSummary' + oneOf: + - $ref: '#/components/schemas/LocationSummary' + - type: 'null' + description: The location the evolution must be triggered at. min_level: type: - integer - 'null' maximum: 2147483647 minimum: -2147483648 + description: The minimum required level of the evolving Pokémon species + to evolve into this Pokémon species. min_happiness: type: - integer - 'null' maximum: 2147483647 minimum: -2147483648 + description: The minimum required level of happiness the evolving Pokémon + species to evolve into this Pokémon species. min_beauty: type: - integer - 'null' maximum: 2147483647 minimum: -2147483648 + description: The minimum required level of beauty the evolving Pokémon species + to evolve into this Pokémon species. min_affection: type: - integer - 'null' maximum: 2147483647 minimum: -2147483648 + description: The minimum required level of affection the evolving Pokémon + species to evolve into this Pokémon species. near_special_rock: type: boolean + description: Whether or not you need to be near a Moss Rock or Icy Rock + to evolve into this Pokémon species. needs_multiplayer: type: boolean + description: Whether or not multiplayer link play is needed to evolve into + this Pokémon species (e.g. Union Circle). needs_overworld_rain: type: boolean + description: Whether or not it must be raining in the overworld to cause + evolution this Pokémon species. party_species: - $ref: '#/components/schemas/PokemonSpeciesSummary' + oneOf: + - $ref: '#/components/schemas/PokemonSpeciesSummary' + - type: 'null' + description: 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. party_type: - $ref: '#/components/schemas/TypeSummary' + oneOf: + - $ref: '#/components/schemas/TypeSummary' + - type: 'null' + description: 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. relative_physical_stats: type: - integer - 'null' maximum: 2147483647 minimum: -2147483648 + description: The required relation between the Pokémon's Attack and Defense + stats. 1 means Attack > Defense. 0 means Attack = Defense. -1 means Attack + < Defense. time_of_day: type: string + description: The required time of day. Day or night. maxLength: 10 trade_species: - $ref: '#/components/schemas/PokemonSpeciesSummary' + oneOf: + - $ref: '#/components/schemas/PokemonSpeciesSummary' + - type: 'null' + description: Pokémon species for which this one must be traded. turn_upside_down: type: boolean + description: Whether or not the 3DS needs to be turned upside-down as this + Pokémon levels up. region: - $ref: '#/components/schemas/RegionSummary' + oneOf: + - $ref: '#/components/schemas/RegionSummary' + - type: 'null' + description: The required region in which this evolution can occur. required_pokemon_form: - $ref: '#/components/schemas/PokemonFormSummary' + oneOf: + - $ref: '#/components/schemas/PokemonFormSummary' + - type: 'null' + description: The Pokémon form required before evolving, or null if unrestricted. evolved_pokemon_form: - $ref: '#/components/schemas/PokemonFormSummary' + oneOf: + - $ref: '#/components/schemas/PokemonFormSummary' + - type: 'null' + description: The Pokémon form produced by this evolution, or null if unspecified. used_move: - $ref: '#/components/schemas/MoveSummary' + oneOf: + - $ref: '#/components/schemas/MoveSummary' + - type: 'null' + description: The move that must be used by the evolving Pokémon species + during the evolution trigger event in order to evolve into this Pokémon + species. min_move_count: type: - integer - 'null' maximum: 2147483647 minimum: -2147483648 + description: The minimum number of times a move must be used in order to + evolve into this Pokémon species. min_steps: type: - integer - 'null' maximum: 2147483647 minimum: -2147483648 + description: The minimum number of steps that must be taken in order to + evolve into this Pokémon species. min_damage_taken: type: - integer - 'null' maximum: 2147483647 minimum: -2147483648 + description: The minimum amount of damage taken during the evolution trigger + event in order to evolve into this Pokémon species. allowed_natures: - type: array + type: + - array + - 'null' items: $ref: '#/components/schemas/NatureSummary' readOnly: true + description: The natures that allow this evolution, or null if unrestricted. condition_expression: oneOf: - $ref: '#/components/schemas/EvolutionConditionExpression' - type: 'null' readOnly: true + description: An additional evolution condition expressed in reverse Polish + notation, or null if none. required: - allowed_natures - condition_expression @@ -7500,8 +8690,10 @@ components: id: type: integer readOnly: true + description: The identifier for this resource. name: type: string + description: The name for this resource. maxLength: 200 order: type: @@ -7509,54 +8701,77 @@ components: - 'null' maximum: 2147483647 minimum: -2147483648 + description: 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. form_order: type: - integer - 'null' maximum: 2147483647 minimum: -2147483648 + description: The order in which forms should be sorted within a species' + forms. is_default: type: boolean + description: True for exactly one form used as the default for each Pokémon. is_battle_only: type: boolean + description: Whether or not this form can only happen during battle. is_mega: type: boolean + description: Whether or not this form requires mega evolution. form_name: type: string + description: The name of this form. maxLength: 30 pokemon: - $ref: '#/components/schemas/PokemonSummary' + allOf: + - $ref: '#/components/schemas/PokemonSummary' + description: The Pokémon that can take on this form. sprites: allOf: - $ref: '#/components/schemas/PokemonFormSprites' readOnly: true + description: A set of sprites used to depict this Pokémon form in the game. version_group: - $ref: '#/components/schemas/VersionGroupSummary' + allOf: + - $ref: '#/components/schemas/VersionGroupSummary' + description: The version group this Pokémon form was introduced in. form_names: type: array items: $ref: '#/components/schemas/PokemonFormName' readOnly: true + description: The form specific form name of this Pokémon form, or empty + if the form does not have a specific name. names: type: array items: $ref: '#/components/schemas/PokemonFormName' readOnly: true + description: The form specific full name of this Pokémon form, or empty + if the form does not have a specific name. types: type: array items: $ref: '#/components/schemas/PokemonFormType' readOnly: true + description: A list of details showing types this Pokémon form has. trigger_conditions: type: array items: $ref: '#/components/schemas/PokemonFormTriggerCondition' readOnly: true + description: The conditions that trigger this form. Resource names and URLs + are included when the trigger requires a resource. flavor_text_entries: type: array items: $ref: '#/components/schemas/PokemonFormFlavorText' readOnly: true + description: The flavor text of this form listed in different languages + and versions. required: - flavor_text_entries - form_name @@ -7574,10 +8789,20 @@ components: properties: flavor_text: type: string + description: 'The localized flavor text for an API resource in a specific + language. Note that this text is left unprocessed as it is found in game + files. This means that it contains special characters that one might want + to replace with their visible decodable version. Please check out this + issue to find out more. ' language: - $ref: '#/components/schemas/LanguageSummary' + allOf: + - $ref: '#/components/schemas/LanguageSummary' + description: The language this name is in. version: - $ref: '#/components/schemas/VersionSummary' + allOf: + - $ref: '#/components/schemas/VersionSummary' + description: The game version this flavor text is extracted from. required: - flavor_text - language @@ -7587,28 +8812,93 @@ components: properties: name: type: string + description: The localized name for an API resource in a specific language. maxLength: 200 language: - $ref: '#/components/schemas/LanguageSummary' + allOf: + - $ref: '#/components/schemas/LanguageSummary' + description: The language this name is in. required: - language - name PokemonFormSprites: type: object properties: - sprites: {} + front_default: + type: + - string + - 'null' + description: The default depiction of this Pokémon from the front in battle. + front_shiny: + type: + - string + - 'null' + description: The shiny depiction of this Pokémon from the front in battle. + front_female: + type: + - string + - 'null' + description: The female depiction of this Pokémon from the front in battle. + front_shiny_female: + type: + - string + - 'null' + description: The shiny female depiction of this Pokémon from the front in + battle. + back_default: + type: + - string + - 'null' + description: The default depiction of this Pokémon from the back in battle. + back_shiny: + type: + - string + - 'null' + description: The shiny depiction of this Pokémon from the back in battle. + back_female: + type: + - string + - 'null' + description: The female depiction of this Pokémon from the back in battle. + back_shiny_female: + type: + - string + - 'null' + description: The shiny female depiction of this Pokémon from the back in + battle. + other: + allOf: + - $ref: '#/components/schemas/PokemonSpritesOther' + description: Additional sprites grouped by source, such as official artwork, + HOME, and Showdown. Available keys vary by resource. + versions: + type: object + additionalProperties: + type: object + additionalProperties: {} + description: Sprites grouped by generation and game. Available keys vary + by resource. required: - - sprites + - back_default + - back_female + - back_shiny + - back_shiny_female + - front_default + - front_female + - front_shiny + - front_shiny_female PokemonFormSummary: type: object properties: name: type: string + description: The name of the referenced resource. maxLength: 200 url: type: string format: uri readOnly: true + description: The URL of the referenced resource. required: - name - url @@ -7617,10 +8907,22 @@ components: properties: trigger: type: string + description: The trigger for this form change. + name: + type: string + description: The name of the required item, ability, or move. Only present + for a resource-based trigger. + url: + type: string + format: uri + description: The URL of the required item, ability, or move. Only present + for a resource-based trigger. base_form: - $ref: '#/components/schemas/PokemonFormSummary' + allOf: + - $ref: '#/components/schemas/PokemonFormSummary' + description: The required base form. Only present when the trigger specifies + one. required: - - base_form - trigger PokemonFormType: type: object @@ -7629,8 +8931,11 @@ components: type: integer maximum: 2147483647 minimum: -2147483648 + description: The order the Pokémon's types are listed in. type: - $ref: '#/components/schemas/TypeSummary' + allOf: + - $ref: '#/components/schemas/TypeSummary' + description: The type the referenced Form has. required: - slot - type @@ -7641,8 +8946,11 @@ components: type: integer maximum: 2147483647 minimum: -2147483648 + description: The internal id of an API resource within game data. version: - $ref: '#/components/schemas/VersionSummary' + allOf: + - $ref: '#/components/schemas/VersionSummary' + description: The version relevent to this game index. required: - game_index - version @@ -7652,19 +8960,23 @@ components: id: type: integer readOnly: true + description: The identifier for this resource. name: type: string + description: The name for this resource. maxLength: 200 names: type: array items: $ref: '#/components/schemas/PokemonHabitatName' readOnly: true + description: The name of this resource listed in different languages. pokemon_species: type: array items: $ref: '#/components/schemas/PokemonSpeciesSummary' readOnly: true + description: A list of the Pokémon species that can be found in this habitat. required: - id - name @@ -7675,9 +8987,12 @@ components: properties: name: type: string + description: The localized name for an API resource in a specific language. maxLength: 200 language: - $ref: '#/components/schemas/LanguageSummary' + allOf: + - $ref: '#/components/schemas/LanguageSummary' + description: The language this name is in. required: - language - name @@ -7686,11 +9001,13 @@ components: properties: name: type: string + description: The name of the referenced resource. maxLength: 200 url: type: string format: uri readOnly: true + description: The URL of the referenced resource. required: - name - url @@ -7698,21 +9015,44 @@ components: type: object properties: pokemon: - $ref: '#/components/schemas/PokemonSummary' + allOf: + - $ref: '#/components/schemas/PokemonSummary' + description: The Pokémon that holds this item. version_details: type: array items: $ref: '#/components/schemas/PokemonHeldItemVersion' + description: The details for the version that this item is held in by the + Pokémon. required: - pokemon - version_details + PokemonHeldItemSummary: + type: object + properties: + item: + allOf: + - $ref: '#/components/schemas/ItemSummary' + description: The item the referenced Pokémon holds. + version_details: + type: array + items: + $ref: '#/components/schemas/PokemonHeldItemVersion' + description: The details of the different versions in which the item is + held. + required: + - item + - version_details PokemonHeldItemVersion: type: object properties: rarity: type: integer + description: How often the item is held. version: - $ref: '#/components/schemas/VersionSummary' + allOf: + - $ref: '#/components/schemas/VersionSummary' + description: The version in which the item is held. required: - rarity - version @@ -7720,11 +9060,15 @@ components: type: object properties: move: - $ref: '#/components/schemas/MoveSummary' + allOf: + - $ref: '#/components/schemas/MoveSummary' + description: The move the Pokémon can learn. version_group_details: type: array items: $ref: '#/components/schemas/PokemonMoveVersionGroup' + description: The details of the version in which the Pokémon can learn the + move. required: - move - version_group_details @@ -7733,12 +9077,21 @@ components: properties: level_learned_at: type: integer + description: The minimum level to learn the move. move_learn_method: - $ref: '#/components/schemas/MoveLearnMethodSummary' + allOf: + - $ref: '#/components/schemas/MoveLearnMethodSummary' + description: The method by which the move is learned. version_group: - $ref: '#/components/schemas/VersionGroupSummary' + allOf: + - $ref: '#/components/schemas/VersionGroupSummary' + description: The version group in which the move is learned. order: - type: integer + type: + - integer + - 'null' + description: Order by which the pokemon will learn the move. A newly learnt + move will replace the move with lowest order. required: - level_learned_at - move_learn_method @@ -7750,8 +9103,13 @@ components: type: array items: $ref: '#/components/schemas/PokemonAbilityPast' + description: The abilities the referenced pokémon had up to and including + the listed generation. If null, the slot was previously empty. generation: - $ref: '#/components/schemas/GenerationSummary' + allOf: + - $ref: '#/components/schemas/GenerationSummary' + description: The last generation in which the referenced pokémon had the + listed abilities. required: - abilities - generation @@ -7759,11 +9117,15 @@ components: type: object properties: generation: - $ref: '#/components/schemas/GenerationSummary' + allOf: + - $ref: '#/components/schemas/GenerationSummary' + description: The last generation in which the referenced pokémon had the + listed stats. stats: type: array items: $ref: '#/components/schemas/PokemonStat' + description: The stat the Pokémon had up to and including the listed generation. required: - generation - stats @@ -7771,11 +9133,16 @@ components: type: object properties: generation: - $ref: '#/components/schemas/GenerationSummary' + allOf: + - $ref: '#/components/schemas/GenerationSummary' + description: The last generation in which the referenced pokémon had the + listed types. types: type: array items: - $ref: '#/components/schemas/TypePokemon' + $ref: '#/components/schemas/PokemonType' + description: The types the referenced pokémon had up to and including the + listed generation. required: - generation - types @@ -7784,9 +9151,13 @@ components: properties: awesome_name: type: string + description: The localized "scientific" name for an API resource in a specific + language. maxLength: 30 language: - $ref: '#/components/schemas/LanguageSummary' + allOf: + - $ref: '#/components/schemas/LanguageSummary' + description: The language this "scientific" name is in. required: - awesome_name - language @@ -7796,24 +9167,30 @@ components: id: type: integer readOnly: true + description: The identifier for this resource. name: type: string + description: The name for this resource. maxLength: 200 awesome_names: type: array items: $ref: '#/components/schemas/PokemonShapeAwesomeName' readOnly: true + description: The "scientific" name of this Pokémon shape listed in different + languages. names: type: array items: $ref: '#/components/schemas/PokemonShapeName' readOnly: true + description: The name of this resource listed in different languages. pokemon_species: type: array items: $ref: '#/components/schemas/PokemonSpeciesSummary' readOnly: true + description: A list of the Pokémon species that have this shape. required: - awesome_names - id @@ -7825,9 +9202,12 @@ components: properties: name: type: string + description: The localized name for an API resource in a specific language. maxLength: 200 language: - $ref: '#/components/schemas/LanguageSummary' + allOf: + - $ref: '#/components/schemas/LanguageSummary' + description: The language this name is in. required: - language - name @@ -7836,11 +9216,13 @@ components: properties: name: type: string + description: The name of the referenced resource. maxLength: 200 url: type: string format: uri readOnly: true + description: The URL of the referenced resource. required: - name - url @@ -7849,9 +9231,13 @@ components: properties: description: type: string + description: The localized description for an API resource in a specific + language. maxLength: 2000 language: - $ref: '#/components/schemas/LanguageSummary' + allOf: + - $ref: '#/components/schemas/LanguageSummary' + description: The language this name is in. required: - language PokemonSpeciesDetail: @@ -7860,8 +9246,10 @@ components: id: type: integer readOnly: true + description: The identifier for this resource. name: type: string + description: The name for this resource. maxLength: 200 order: type: @@ -7869,94 +9257,143 @@ components: - 'null' maximum: 2147483647 minimum: -2147483648 + description: The order in which species should be sorted. Based on National + Dex order, except families are grouped together and sorted by stage. gender_rate: type: - integer - 'null' maximum: 2147483647 minimum: -2147483648 + description: The chance of this Pokémon being female, in eighths; or -1 + for genderless. capture_rate: type: - integer - 'null' maximum: 2147483647 minimum: -2147483648 + description: The base capture rate; up to 255. The higher the number, the + easier the catch. base_happiness: type: - integer - 'null' maximum: 2147483647 minimum: -2147483648 + description: The happiness when caught by a normal Pokéball; up to 255. + The higher the number, the happier the Pokémon. is_baby: type: boolean + description: Whether or not this is a baby Pokémon. is_legendary: type: boolean + description: Whether or not this is a legendary Pokémon. is_mythical: type: boolean + description: Whether or not this is a mythical Pokémon. hatch_counter: type: - integer - 'null' maximum: 2147483647 minimum: -2147483648 + description: 'Initial hatch counter: one must walk Y × (hatch_counter + + 1) steps before this Pokémon''s egg hatches, unless utilizing bonuses + like Flame Body''s. Y varies per generation. In Generations II, III, and + VII, Egg cycles are 256 steps long. In Generation IV, Egg cycles are 255 + steps long. In Pokémon Brilliant Diamond and Shining Pearl, Egg cycles + are also 255 steps long, but are shorter on special dates. In Generations + V and VI, Egg cycles are 257 steps long. In Pokémon Sword and Shield, + and in Pokémon Scarlet and Violet, Egg cycles are 128 steps long.' has_gender_differences: type: boolean + description: Whether or not this Pokémon has visual gender differences. forms_switchable: type: boolean + description: Whether or not this Pokémon has multiple forms and can switch + between them. growth_rate: - $ref: '#/components/schemas/GrowthRateSummary' + allOf: + - $ref: '#/components/schemas/GrowthRateSummary' + description: The rate at which this Pokémon species gains levels. pokedex_numbers: type: array items: $ref: '#/components/schemas/PokemonDexEntry' readOnly: true + description: A list of Pokedexes and the indexes reserved within them for + this Pokémon species. egg_groups: type: array items: $ref: '#/components/schemas/EggGroupSummary' readOnly: true + description: A list of egg groups this Pokémon species is a member of. color: - $ref: '#/components/schemas/PokemonColorSummary' + allOf: + - $ref: '#/components/schemas/PokemonColorSummary' + description: The color of this Pokémon for Pokédex search. shape: - $ref: '#/components/schemas/PokemonShapeSummary' + allOf: + - $ref: '#/components/schemas/PokemonShapeSummary' + description: The shape of this Pokémon for Pokédex search. evolves_from_species: - $ref: '#/components/schemas/PokemonSpeciesSummary' + oneOf: + - $ref: '#/components/schemas/PokemonSpeciesSummary' + - type: 'null' + description: The Pokémon species that evolves into this Pokemon_species. evolution_chain: - $ref: '#/components/schemas/EvolutionChainSummary' + allOf: + - $ref: '#/components/schemas/EvolutionChainSummary' + description: The evolution chain this Pokémon species is a member of. habitat: - $ref: '#/components/schemas/PokemonHabitatSummary' + oneOf: + - $ref: '#/components/schemas/PokemonHabitatSummary' + - type: 'null' + description: The habitat this Pokémon species can be encountered in. generation: - $ref: '#/components/schemas/GenerationSummary' + allOf: + - $ref: '#/components/schemas/GenerationSummary' + description: The generation this Pokémon species was introduced in. names: type: array items: $ref: '#/components/schemas/PokemonSpeciesName' readOnly: true + description: The name of this resource listed in different languages. pal_park_encounters: type: array items: $ref: '#/components/schemas/PokemonSpeciesPalParkEncounter' readOnly: true + description: A list of encounters that can be had with this Pokémon species + in pal park. form_descriptions: type: array items: $ref: '#/components/schemas/PokemonSpeciesDescription' readOnly: true + description: Descriptions of different forms Pokémon take on within the + Pokémon species. flavor_text_entries: type: array items: $ref: '#/components/schemas/PokemonSpeciesFlavorText' readOnly: true + description: A list of flavor text entries for this Pokémon species. genera: type: array items: $ref: '#/components/schemas/PokemonSpeciesGenus' readOnly: true + description: The genus of this Pokémon species listed in multiple languages. varieties: type: array items: $ref: '#/components/schemas/PokemonSpeciesVariety' readOnly: true + description: A list of the Pokémon that exist within this Pokémon species. required: - color - egg_groups @@ -7980,10 +9417,20 @@ components: properties: flavor_text: type: string + description: 'The localized flavor text for an API resource in a specific + language. Note that this text is left unprocessed as it is found in game + files. This means that it contains special characters that one might want + to replace with their visible decodable version. Please check out this + issue to find out more. ' language: - $ref: '#/components/schemas/LanguageSummary' + allOf: + - $ref: '#/components/schemas/LanguageSummary' + description: The language this name is in. version: - $ref: '#/components/schemas/VersionSummary' + allOf: + - $ref: '#/components/schemas/VersionSummary' + description: The game version this flavor text is extracted from. required: - flavor_text - language @@ -7993,9 +9440,12 @@ components: properties: genus: type: string + description: The localized genus for the referenced Pokémon species maxLength: 30 language: - $ref: '#/components/schemas/LanguageSummary' + allOf: + - $ref: '#/components/schemas/LanguageSummary' + description: The language this genus is in. required: - genus - language @@ -8004,9 +9454,12 @@ components: properties: name: type: string + description: The localized name for an API resource in a specific language. maxLength: 200 language: - $ref: '#/components/schemas/LanguageSummary' + allOf: + - $ref: '#/components/schemas/LanguageSummary' + description: The language this name is in. required: - language - name @@ -8019,12 +9472,18 @@ components: - 'null' maximum: 2147483647 minimum: -2147483648 + description: The base score given to the player when the referenced Pokémon + is caught during a pal park run. rate: type: integer maximum: 2147483647 minimum: -2147483648 + description: The base rate for encountering the referenced Pokémon in this + pal park area. area: - $ref: '#/components/schemas/PalParkAreaSummary' + allOf: + - $ref: '#/components/schemas/PalParkAreaSummary' + description: The pal park area where this encounter happens. required: - area - rate @@ -8033,11 +9492,13 @@ components: properties: name: type: string + description: The name of the referenced resource. maxLength: 200 url: type: string format: uri readOnly: true + description: The URL of the referenced resource. required: - name - url @@ -8046,8 +9507,11 @@ components: properties: is_default: type: boolean + description: Whether this variety is the default variety. pokemon: - $ref: '#/components/schemas/PokemonSummary' + allOf: + - $ref: '#/components/schemas/PokemonSummary' + description: The Pokémon variety. required: - is_default - pokemon @@ -8058,8 +9522,217 @@ components: type: - string - 'null' + description: The default depiction of this Pokémon from the front in battle. + front_shiny: + type: + - string + - 'null' + description: The shiny depiction of this Pokémon from the front in battle. + front_female: + type: + - string + - 'null' + description: The female depiction of this Pokémon from the front in battle. + front_shiny_female: + type: + - string + - 'null' + description: The shiny female depiction of this Pokémon from the front in + battle. + back_default: + type: + - string + - 'null' + description: The default depiction of this Pokémon from the back in battle. + back_shiny: + type: + - string + - 'null' + description: The shiny depiction of this Pokémon from the back in battle. + back_female: + type: + - string + - 'null' + description: The female depiction of this Pokémon from the back in battle. + back_shiny_female: + type: + - string + - 'null' + description: The shiny female depiction of this Pokémon from the back in + battle. + other: + allOf: + - $ref: '#/components/schemas/PokemonSpritesOther' + description: Additional sprites grouped by source, such as official artwork, + HOME, and Showdown. Available keys vary by resource. + versions: + type: object + additionalProperties: + type: object + additionalProperties: {} + description: Sprites grouped by generation and game. Available keys vary + by resource. + required: + - back_default + - back_female + - back_shiny + - back_shiny_female + - front_default + - front_female + - front_shiny + - front_shiny_female + PokemonSpritesOther: + type: object + properties: + dream_world: + allOf: + - $ref: '#/components/schemas/PokemonSpritesOtherDreamWorld' + description: Pokémon Dream World artwork URLs. + home: + allOf: + - $ref: '#/components/schemas/PokemonSpritesOtherHome' + description: Pokémon HOME sprite URLs. + showdown: + allOf: + - $ref: '#/components/schemas/PokemonSpritesOtherShowdown' + description: Pokémon Showdown sprite URLs. + official-artwork: + allOf: + - $ref: '#/components/schemas/PokemonSpritesOtherOfficialArtwork' + description: Official Pokémon artwork URLs, including shiny artwork and + version-specific variants. + PokemonSpritesOtherDreamWorld: + type: object + properties: + front_default: + type: + - string + - 'null' + description: The URL of the default Pokémon Dream World front image, or + null if unavailable. + front_female: + type: + - string + - 'null' + description: The URL of the female Pokémon Dream World front image, or null + if unavailable. + required: + - front_default + - front_female + PokemonSpritesOtherHome: + type: object + properties: + front_default: + type: + - string + - 'null' + description: The URL of the default Pokémon HOME front image, or null if + unavailable. + front_female: + type: + - string + - 'null' + description: The URL of the female Pokémon HOME front image, or null if + unavailable. + front_shiny: + type: + - string + - 'null' + description: The URL of the shiny Pokémon HOME front image, or null if unavailable. + front_shiny_female: + type: + - string + - 'null' + description: The URL of the shiny female Pokémon HOME front image, or null + if unavailable. + required: + - front_default + - front_female + - front_shiny + - front_shiny_female + PokemonSpritesOtherOfficialArtwork: + type: object + properties: + front_default: + type: + - string + - 'null' + description: The URL of the default front official artwork, or null if unavailable. + front_shiny: + type: + - string + - 'null' + description: The URL of the shiny front official artwork, or null if unavailable. + versions: + type: object + additionalProperties: + type: object + additionalProperties: {} + description: Additional official artwork grouped by version. Available keys + vary by resource. + required: + - front_default + - front_shiny + PokemonSpritesOtherShowdown: + type: object + properties: + front_default: + type: + - string + - 'null' + description: The URL of the default Pokémon Showdown front image, or null + if unavailable. + front_female: + type: + - string + - 'null' + description: The URL of the female Pokémon Showdown front image, or null + if unavailable. + front_shiny: + type: + - string + - 'null' + description: The URL of the shiny Pokémon Showdown front image, or null + if unavailable. + front_shiny_female: + type: + - string + - 'null' + description: The URL of the shiny female Pokémon Showdown front image, or + null if unavailable. + back_default: + type: + - string + - 'null' + description: The URL of the default Pokémon Showdown back image, or null + if unavailable. + back_female: + type: + - string + - 'null' + description: The URL of the female Pokémon Showdown back image, or null + if unavailable. + back_shiny: + type: + - string + - 'null' + description: The URL of the shiny Pokémon Showdown back image, or null if + unavailable. + back_shiny_female: + type: + - string + - 'null' + description: The URL of the shiny female Pokémon Showdown back image, or + null if unavailable. required: + - back_default + - back_female + - back_shiny + - back_shiny_female - front_default + - front_female + - front_shiny + - front_shiny_female PokemonStat: type: object properties: @@ -8067,12 +9740,16 @@ components: type: integer maximum: 2147483647 minimum: -2147483648 + description: The base value of the stat. effort: type: integer maximum: 2147483647 minimum: -2147483648 + description: The effort points (EV) the Pokémon has in the stat. stat: - $ref: '#/components/schemas/StatSummary' + allOf: + - $ref: '#/components/schemas/StatSummary' + description: The stat the Pokémon has. required: - base_stat - effort @@ -8082,11 +9759,13 @@ components: properties: name: type: string + description: The name of the referenced resource. maxLength: 200 url: type: string format: uri readOnly: true + description: The URL of the referenced resource. required: - name - url @@ -8097,8 +9776,11 @@ components: type: integer maximum: 2147483647 minimum: -2147483648 + description: The order the Pokémon's types are listed in. type: - $ref: '#/components/schemas/TypeSummary' + allOf: + - $ref: '#/components/schemas/TypeSummary' + description: The type the referenced Pokémon has. required: - slot - type @@ -8108,34 +9790,41 @@ components: id: type: integer readOnly: true + description: The identifier for this resource. name: type: string + description: The name for this resource. maxLength: 200 locations: type: array items: $ref: '#/components/schemas/LocationSummary' readOnly: true + description: A list of locations that can be found in this region. main_generation: oneOf: - $ref: '#/components/schemas/GenerationSummary' - type: 'null' readOnly: true + description: The generation this region was introduced in. names: type: array items: $ref: '#/components/schemas/RegionName' readOnly: true + description: The name of this resource listed in different languages. pokedexes: type: array items: $ref: '#/components/schemas/PokedexSummary' readOnly: true + description: A list of pokédexes that catalogue Pokémon in this region. version_groups: type: array items: $ref: '#/components/schemas/VersionGroupSummary' readOnly: true + description: A list of version groups where this region can be visited. required: - id - locations @@ -8149,9 +9838,12 @@ components: properties: name: type: string + description: The localized name for an API resource in a specific language. maxLength: 200 language: - $ref: '#/components/schemas/LanguageSummary' + allOf: + - $ref: '#/components/schemas/LanguageSummary' + description: The language this name is in. required: - language - name @@ -8160,11 +9852,13 @@ components: properties: name: type: string + description: The name of the referenced resource. maxLength: 200 url: type: string format: uri readOnly: true + description: The URL of the referenced resource. required: - name - url @@ -8175,10 +9869,12 @@ components: type: array items: $ref: '#/components/schemas/MoveStatChange' + description: A list of moves and how they change the referenced stat. decrease: type: array items: $ref: '#/components/schemas/MoveStatChange' + description: A list of moves and how they change the referenced stat. required: - decrease - increase @@ -8189,10 +9885,12 @@ components: type: array items: $ref: '#/components/schemas/NatureSummary' + description: A list of natures and how they change the referenced stat. decrease: type: array items: $ref: '#/components/schemas/NatureSummary' + description: A list of nature sand how they change the referenced stat. required: - decrease - increase @@ -8202,40 +9900,53 @@ components: id: type: integer readOnly: true + description: The identifier for this resource. name: type: string + description: The name for this resource. maxLength: 200 game_index: type: integer maximum: 2147483647 minimum: -2147483648 + description: ID the games use for this stat. is_battle_only: type: boolean + description: Whether this stat only exists within a battle. affecting_moves: allOf: - $ref: '#/components/schemas/StatAffectingMoves' readOnly: true + description: A detail of moves which affect this stat positively or negatively. affecting_natures: allOf: - $ref: '#/components/schemas/StatAffectingNatures' readOnly: true + description: A detail of natures which affect this stat positively or negatively. affecting_items: type: array items: $ref: '#/components/schemas/ItemSummary' readOnly: true + description: Items that affect this stat, such as vitamins and battle items. characteristics: type: array items: $ref: '#/components/schemas/CharacteristicSummary' readOnly: true + description: A list of characteristics that are set on a Pokémon when its + highest base stat is this stat. move_damage_class: - $ref: '#/components/schemas/MoveDamageClassSummary' + oneOf: + - $ref: '#/components/schemas/MoveDamageClassSummary' + - type: 'null' + description: The class of damage this stat is directly related to. names: type: array items: $ref: '#/components/schemas/StatName' readOnly: true + description: The name of this resource listed in different languages. required: - affecting_items - affecting_moves @@ -8251,9 +9962,12 @@ components: properties: name: type: string + description: The localized name for an API resource in a specific language. maxLength: 200 language: - $ref: '#/components/schemas/LanguageSummary' + allOf: + - $ref: '#/components/schemas/LanguageSummary' + description: The language this name is in. required: - language - name @@ -8262,11 +9976,13 @@ components: properties: name: type: string + description: The name of the referenced resource. maxLength: 200 url: type: string format: uri readOnly: true + description: The URL of the referenced resource. required: - name - url @@ -8276,20 +9992,25 @@ components: id: type: integer readOnly: true + description: The identifier for this resource. appeal: type: integer maximum: 2147483647 minimum: -2147483648 + description: The level of appeal this super contest effect has. flavor_text_entries: type: array items: $ref: '#/components/schemas/SuperContestEffectFlavorText' readOnly: true + description: The flavor text of this super contest effect listed in different + languages. moves: type: array items: $ref: '#/components/schemas/MoveSummary' readOnly: true + description: A list of moves that have the effect when used in super contests. required: - appeal - flavor_text_entries @@ -8300,9 +10021,13 @@ components: properties: flavor_text: type: string + description: The localized flavor text for an API resource in a specific + language. maxLength: 500 language: - $ref: '#/components/schemas/LanguageSummary' + allOf: + - $ref: '#/components/schemas/LanguageSummary' + description: The language this name is in. required: - flavor_text - language @@ -8313,6 +10038,7 @@ components: type: string format: uri readOnly: true + description: The URL of the referenced resource. required: - url TypeDetail: @@ -8322,46 +10048,66 @@ components: id: type: integer readOnly: true + description: The identifier for this resource. name: type: string + description: The name for this resource. maxLength: 200 damage_relations: allOf: - $ref: '#/components/schemas/TypeRelationships' readOnly: true + description: A detail of how effective this type is toward others and vice + versa. past_damage_relations: type: array items: $ref: '#/components/schemas/TypePastRelationships' readOnly: true + description: A list of details of how effective this type was toward others + and vice versa in previous generations game_indices: type: array items: $ref: '#/components/schemas/TypeGameIndex' readOnly: true + description: A list of game indices relevent to this item by generation. generation: - $ref: '#/components/schemas/GenerationSummary' + allOf: + - $ref: '#/components/schemas/GenerationSummary' + description: The generation this type was introduced in. move_damage_class: - $ref: '#/components/schemas/MoveDamageClassSummary' + oneOf: + - $ref: '#/components/schemas/MoveDamageClassSummary' + - type: 'null' + description: The class of damage inflicted by this type. names: type: array items: $ref: '#/components/schemas/TypeName' readOnly: true + description: The name of this resource listed in different languages. pokemon: type: array items: $ref: '#/components/schemas/TypePokemon' readOnly: true + description: A list of details of Pokémon that have this type. moves: type: array items: $ref: '#/components/schemas/MoveSummary' readOnly: true + description: A list of moves that have this type. sprites: - allOf: - - $ref: '#/components/schemas/TypeSprite' + type: object + additionalProperties: + type: object + additionalProperties: + $ref: '#/components/schemas/TypeGameSprite' readOnly: true + description: Type icons grouped by generation and game, with name_icon and + symbol_icon URLs. Unavailable icons are null. required: - damage_relations - game_indices @@ -8381,19 +10127,39 @@ components: type: integer maximum: 2147483647 minimum: -2147483648 + description: The internal id of an API resource within game data. generation: - $ref: '#/components/schemas/GenerationSummary' + allOf: + - $ref: '#/components/schemas/GenerationSummary' + description: The generation relevent to this game index. required: - game_index - generation + TypeGameSprite: + type: object + properties: + name_icon: + type: + - string + - 'null' + description: The URL of the icon displaying the type name in this game, + or null if unavailable. + symbol_icon: + type: + - string + - 'null' + description: The URL of the type symbol icon in this game, or null if unavailable. TypeName: type: object properties: name: type: string + description: The localized name for an API resource in a specific language. maxLength: 200 language: - $ref: '#/components/schemas/LanguageSummary' + allOf: + - $ref: '#/components/schemas/LanguageSummary' + description: The language this name is in. required: - language - name @@ -8401,9 +10167,15 @@ components: type: object properties: generation: - $ref: '#/components/schemas/GenerationSummary' + allOf: + - $ref: '#/components/schemas/GenerationSummary' + description: The last generation in which the referenced type had the listed + damage relations damage_relations: - $ref: '#/components/schemas/TypeRelationships' + allOf: + - $ref: '#/components/schemas/TypeRelationships' + description: The damage relations the referenced type had up to and including + the listed generation required: - damage_relations - generation @@ -8414,8 +10186,11 @@ components: type: integer maximum: 2147483647 minimum: -2147483648 + description: The order the Pokémon's types are listed in. pokemon: - $ref: '#/components/schemas/PokemonSummary' + allOf: + - $ref: '#/components/schemas/PokemonSummary' + description: The Pokémon that has the referenced type. required: - pokemon - slot @@ -8426,26 +10201,32 @@ components: type: array items: $ref: '#/components/schemas/TypeSummary' + description: A list of types this type has no effect on. half_damage_to: type: array items: $ref: '#/components/schemas/TypeSummary' + description: A list of types this type is not very effect against. double_damage_to: type: array items: $ref: '#/components/schemas/TypeSummary' + description: A list of types this type is very effect against. no_damage_from: type: array items: $ref: '#/components/schemas/TypeSummary' + description: A list of types that have no effect on this type. half_damage_from: type: array items: $ref: '#/components/schemas/TypeSummary' + description: A list of types that are not very effective against this type. double_damage_from: type: array items: $ref: '#/components/schemas/TypeSummary' + description: A list of types that are very effective against this type. required: - double_damage_from - double_damage_to @@ -8453,22 +10234,18 @@ components: - half_damage_to - no_damage_from - no_damage_to - TypeSprite: - type: object - properties: - sprites: {} - required: - - sprites TypeSummary: type: object properties: name: type: string + description: The name of the referenced resource. maxLength: 200 url: type: string format: uri readOnly: true + description: The URL of the referenced resource. required: - name - url @@ -8482,16 +10259,21 @@ components: id: type: integer readOnly: true + description: The identifier for this resource. name: type: string + description: The name for this resource. maxLength: 200 names: type: array items: $ref: '#/components/schemas/VersionName' readOnly: true + description: The name of this resource listed in different languages. version_group: - $ref: '#/components/schemas/VersionGroupSummary' + allOf: + - $ref: '#/components/schemas/VersionGroupSummary' + description: The version group this version belongs to. required: - id - name @@ -8503,8 +10285,10 @@ components: id: type: integer readOnly: true + description: The identifier for this resource. name: type: string + description: The name for this resource. maxLength: 200 order: type: @@ -8512,28 +10296,37 @@ components: - 'null' maximum: 2147483647 minimum: -2147483648 + description: Order for sorting. Almost by date of release, except similar + versions are grouped together. generation: - $ref: '#/components/schemas/GenerationSummary' + allOf: + - $ref: '#/components/schemas/GenerationSummary' + description: The generation this version was introduced in. move_learn_methods: type: array items: $ref: '#/components/schemas/MoveLearnMethodSummary' readOnly: true + description: A list of methods in which Pokémon can learn moves in this + version group. pokedexes: type: array items: $ref: '#/components/schemas/PokedexSummary' readOnly: true + description: A list of Pokédexes introduces in this version group. regions: type: array items: $ref: '#/components/schemas/RegionSummary' readOnly: true + description: A list of regions that can be visited in this version group. versions: type: array items: $ref: '#/components/schemas/VersionSummary' readOnly: true + description: The versions this version group owns. required: - generation - id @@ -8547,11 +10340,13 @@ components: properties: name: type: string + description: The name of the referenced resource. maxLength: 200 url: type: string format: uri readOnly: true + description: The URL of the referenced resource. required: - name - url @@ -8560,9 +10355,12 @@ components: properties: name: type: string + description: The localized name for an API resource in a specific language. maxLength: 200 language: - $ref: '#/components/schemas/LanguageSummary' + allOf: + - $ref: '#/components/schemas/LanguageSummary' + description: The language this name is in. required: - language - name @@ -8571,11 +10369,13 @@ components: properties: name: type: string + description: The name of the referenced resource. maxLength: 200 url: type: string format: uri readOnly: true + description: The URL of the referenced resource. required: - name - url @@ -8647,3 +10447,4 @@ tags: - name: utility externalDocs: url: https://pokeapi.co/docs/v2 +security: [] diff --git a/pokemon_v2/api.py b/pokemon_v2/api.py index 505adc096..53f0fb875 100644 --- a/pokemon_v2/api.py +++ b/pokemon_v2/api.py @@ -12,11 +12,13 @@ from django.shortcuts import get_object_or_404 from drf_spectacular.types import OpenApiTypes from drf_spectacular.utils import ( + OpenApiExample, OpenApiParameter, extend_schema, # pyright: ignore[reportUnknownVariableType] extend_schema_view, # pyright: ignore[reportUnknownVariableType] ) from rest_framework import serializers, viewsets +from rest_framework.pagination import LimitOffsetPagination from rest_framework.response import Response from rest_framework.views import APIView from typing_extensions import override @@ -68,6 +70,7 @@ "NatureResource", "PalParkAreaResource", "PokeapiCommonViewset", + "PokeapiLimitOffsetPagination", "PokeapiMetaResponseSerializer", "PokeapiMetaView", "PokeathlonStatResource", @@ -96,11 +99,32 @@ ########################### +# DRF hardcodes for OpenAPI 3.0 schema, override to be 3.1.0 compliant +class PokeapiLimitOffsetPagination(LimitOffsetPagination): + @override + def get_paginated_response_schema(self, schema: dict[str, Any]) -> dict[str, Any]: + response_schema = super().get_paginated_response_schema(schema) + properties = response_schema["properties"] + properties["count"]["description"] = "The total number of resources available from this API." + properties["next"]["description"] = "The URL for the next page in the list, or null if there is no next page." + properties["previous"]["description"] = ( + "The URL for the previous page in the list, or null if there is no previous page." + ) + properties["results"]["description"] = "A list of API resources on this page." + properties["count"]["example"] = 100 + for field in ("next", "previous"): + properties[field].pop("nullable", None) + properties[field].pop("example", None) + properties[field]["type"] = ["string", "null"] + return response_schema + + class ListOrDetailSerialRelation(viewsets.GenericViewSet[Any]): """ Mixin to allow association with separate serializers for list or detail view. """ + pagination_class = PokeapiLimitOffsetPagination list_serializer_class: type[serializers.BaseSerializer[Any]] | None = None @override @@ -128,7 +152,7 @@ def get_queryset(self) -> QuerySet[Any]: queryset = super().get_queryset() filter_q = self.request.GET.get("q", "") - if filter_q: + if filter_q and any(field.name == "name" for field in queryset.model._meta.fields): queryset = queryset.filter(Q(name__icontains=filter_q)) return queryset @@ -164,12 +188,24 @@ def get_object(self) -> Any: type=OpenApiTypes.STR, ) +exclude_q_query_string_parameter = OpenApiParameter( + name="q", + location=OpenApiParameter.QUERY, + exclude=True, +) + retrieve_path_parameter = OpenApiParameter( name="id", description="This parameter can be a string or an integer.", location=OpenApiParameter.PATH, type=OpenApiTypes.STR, required=True, + examples=[ + OpenApiExample( + "1", + value="1", + ), + ], ) @@ -258,6 +294,7 @@ class BerryFlavorResource(PokeapiCommonViewset): @extend_schema_view( list=extend_schema( summary="List characteristics", + parameters=[exclude_q_query_string_parameter], ) ) class CharacteristicResource(PokeapiCommonViewset): @@ -274,6 +311,7 @@ class CharacteristicResource(PokeapiCommonViewset): @extend_schema_view( list=extend_schema( summary="List contest effects", + parameters=[exclude_q_query_string_parameter], ) ) class ContestEffectResource(PokeapiCommonViewset): @@ -370,6 +408,7 @@ class EncounterMethodResource(PokeapiCommonViewset): @extend_schema_view( list=extend_schema( summary="List evolution chains", + parameters=[exclude_q_query_string_parameter], ) ) class EvolutionChainResource(PokeapiCommonViewset): @@ -594,7 +633,21 @@ class LocationResource(PokeapiCommonViewset): @extend_schema_view( list=extend_schema( summary="List location areas", - ) + ), + retrieve=extend_schema( + parameters=[ + OpenApiParameter( + name="id", + description="A unique integer value identifying this location area.", + location=OpenApiParameter.PATH, + type=OpenApiTypes.INT, + required=True, + examples=[ + OpenApiExample("1", value=1), + ], + ) + ] + ), ) class LocationAreaResource(ListOrDetailSerialRelation, viewsets.ReadOnlyModelViewSet[LocationArea]): queryset = LocationArea.objects.all() @@ -610,6 +663,7 @@ class LocationAreaResource(ListOrDetailSerialRelation, viewsets.ReadOnlyModelVie @extend_schema_view( list=extend_schema( summary="List machines", + parameters=[exclude_q_query_string_parameter], ) ) class MachineResource(PokeapiCommonViewset): @@ -930,6 +984,7 @@ class StatResource(PokeapiCommonViewset): @extend_schema_view( list=extend_schema( summary="List super contest effects", + parameters=[exclude_q_query_string_parameter], ) ) class SuperContestEffectResource(PokeapiCommonViewset): @@ -987,33 +1042,57 @@ class VersionGroupResource(PokeapiCommonViewset): class PokemonEncounterDetailResponseSerializer(serializers.Serializer[dict[str, Any]]): - chance = serializers.IntegerField() - condition_values = EncounterConditionValueSummarySerializer(many=True) - max_level = serializers.IntegerField() - method = EncounterMethodSummarySerializer() - min_level = serializers.IntegerField() + chance = serializers.IntegerField(help_text="Percent chance that this encounter will occur.") + condition_values = EncounterConditionValueSummarySerializer( + many=True, help_text="A list of condition values that must be in effect for this encounter to occur." + ) + max_level = serializers.IntegerField(help_text="The highest level the Pokémon could be encountered at.") + method = EncounterMethodSummarySerializer(help_text="The method by which this encounter happens.") + min_level = serializers.IntegerField(help_text="The lowest level the Pokémon could be encountered at.") class PokemonEncounterVersionDetailResponseSerializer(serializers.Serializer[dict[str, Any]]): - version = VersionSummarySerializer() - max_chance = serializers.IntegerField() - encounter_details = PokemonEncounterDetailResponseSerializer(many=True) + version = VersionSummarySerializer(help_text="The game version this encounter happens in.") + max_chance = serializers.IntegerField(help_text="The total percentage of all encounter potential.") + encounter_details = PokemonEncounterDetailResponseSerializer( + many=True, help_text="A list of encounters and their specifics." + ) class PokemonEncounterResponseSerializer(serializers.Serializer[dict[str, Any]]): - location_area = LocationAreaSummarySerializer() - version_details = PokemonEncounterVersionDetailResponseSerializer(many=True) + location_area = LocationAreaSummarySerializer( + help_text="The location area the referenced Pokémon can be encountered in." + ) + version_details = PokemonEncounterVersionDetailResponseSerializer( + many=True, help_text="A list of versions and encounters with the referenced Pokémon that might happen." + ) class PokemonLocationAreaEncounterSerializer(serializers.Serializer[Any]): - location_area = LocationAreaSummarySerializer() - version_details = LocationAreaPokemonEncounterVersionSerializer(many=True) + location_area = LocationAreaSummarySerializer( + help_text="The location area the referenced Pokémon can be encountered in." + ) + version_details = LocationAreaPokemonEncounterVersionSerializer( + many=True, help_text="A list of versions and encounters with the referenced Pokémon that might happen." + ) @extend_schema( description="Handles Pokemon Encounters as a sub-resource.", summary="Get pokemon encounter", tags=["encounters"], + parameters=[ + OpenApiParameter( + name="pokemon_id", + description="A unique integer value identifying the Pokémon.", + location=OpenApiParameter.PATH, + type=OpenApiTypes.INT, + required=True, + examples=[ + OpenApiExample("1", value=1), + ], + ) + ], responses={"200": PokemonEncounterResponseSerializer(many=True)}, ) class PokemonEncounterView(APIView): @@ -1069,9 +1148,9 @@ def get(self, request: Request, pokemon_id: int) -> Response: class PokeapiMetaResponseSerializer(serializers.Serializer[dict[str, Any]]): - deploy_date = serializers.CharField(allow_null=True) - hash = serializers.CharField(allow_null=True) - tag = serializers.CharField(allow_null=True) + deploy_date = serializers.CharField(allow_null=True, help_text="The deployment time as a Unix timestamp string.") + hash = serializers.CharField(allow_null=True, help_text="The source commit hash used for this deployment.") + tag = serializers.CharField(allow_null=True, help_text="The deployment tag, or null if the deployment has no tag.") @extend_schema( diff --git a/pokemon_v2/serializers.py b/pokemon_v2/serializers.py index c328d7a3e..7e752a954 100644 --- a/pokemon_v2/serializers.py +++ b/pokemon_v2/serializers.py @@ -1,4 +1,4 @@ -# ruff: noqa: F405 +# ruff: noqa: F405, E501 # pyright: reportIncompatibleVariableOverride=false, reportUnknownMemberType=false from __future__ import annotations @@ -8,6 +8,7 @@ from typing import TYPE_CHECKING, Any, ClassVar, Protocol, cast from django.db.models import Q +from drf_spectacular.helpers import lazy_serializer from drf_spectacular.utils import extend_schema_field # pyright: ignore[reportUnknownVariableType] from rest_framework import serializers from rest_framework.reverse import reverse @@ -211,6 +212,7 @@ class PokemonWithRelations(Protocol): "PokemonHabitatNameSerializer", "PokemonHabitatSummarySerializer", "PokemonHeldItemSerializer", + "PokemonHeldItemSummarySerializer", "PokemonHeldItemVersionSerializer", "PokemonMoveSerializer", "PokemonMoveVersionGroupSerializer", @@ -230,6 +232,11 @@ class PokemonWithRelations(Protocol): "PokemonSpeciesPalParkEncounterSerializer", "PokemonSpeciesSummarySerializer", "PokemonSpeciesVarietySerializer", + "PokemonSpritesOtherDreamWorldSerializer", + "PokemonSpritesOtherHomeSerializer", + "PokemonSpritesOtherOfficialArtworkSerializer", + "PokemonSpritesOtherSerializer", + "PokemonSpritesOtherShowdownSerializer", "PokemonSpritesSerializer", "PokemonStatPastSerializer", "PokemonStatSerializer", @@ -250,11 +257,11 @@ class PokemonWithRelations(Protocol): "TypeDetailSerializer", "TypeEfficacyPastSerializer", "TypeGameIndexSerializer", + "TypeGameSpriteSerializer", "TypeNameSerializer", "TypePastRelationshipsSerializer", "TypePokemonSerializer", "TypeRelationshipsSerializer", - "TypeSpriteSerializer", "TypeSummarySerializer", "VersionDetailSerializer", "VersionGroupDetailSerializer", @@ -263,6 +270,35 @@ class PokemonWithRelations(Protocol): "VersionSummarySerializer", ) +NAME_LANGUAGE_HELP: str = "The language this name is in." +LOCALIZED_NAMES_HELP: str = "The name of this resource listed in different languages." +EFFECT_LANGUAGE_HELP: str = "The language this effect is in." +LOCALIZED_DESCRIPTIONS_HELP: str = "The description of this resource listed in different languages." +GAME_INDEX_GENERATION_HELP: str = "The generation relevent to this game index." +RESOURCE_URL_HELP: str = "The URL of the referenced resource." +RESOURCE_ID_HELP: str = "The identifier for this resource." +REFERENCE_NAME_HELP: str = "The name of the referenced resource." +RESOURCE_NAME_HELP: str = "The name for this resource." +LOCALIZED_NAME_HELP: str = "The localized name for an API resource in a specific language." +LOCALIZED_DESCRIPTION_HELP: str = "The localized description for an API resource in a specific language." +LOCALIZED_EFFECT_HELP: str = "The localized effect text for an API resource in a specific language." +GAME_INDEX_HELP: str = "The internal id of an API resource within game data." +POKEMON_TYPE_SLOT_HELP: str = "The order the Pokémon's types are listed in." +LOCALIZED_SHORT_EFFECT_HELP: str = "The localized effect text in brief." +LOCALIZED_FLAVOR_TEXT_HELP: str = "The localized flavor text for an API resource in a specific language." +BERRY_FLAVOR_POTENCY_HELP: str = "How powerful the referenced flavor is for this berry." +MOVE_ACCURACY_HELP: str = "The percent value of how likely this move is to be successful." +MOVE_PP_HELP: str = "Power points. The number of times this move can be used." +POKEMON_ABILITY_HIDDEN_HELP: str = "Whether or not this is a hidden ability." +POKEMON_ABILITY_SLOT_HELP: str = "The slot this ability occupies in this Pokémon species." +POKEMON_BASE_STAT_HELP: str = "The base value of the stat." +POKEMON_EFFORT_HELP: str = "The effort points (EV) the Pokémon has in the stat." + + +def format_help_text(**fields: str) -> dict[str, dict[str, str]]: + return {name: {"help_text": text} for name, text in fields.items()} + + # PokeAPI v2 serializers in order of dependency ######################### @@ -279,78 +315,128 @@ class AbilitySummarySerializer(serializers.HyperlinkedModelSerializer[Ability]): class Meta: model = Ability fields = ("name", "url") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + name=REFERENCE_NAME_HELP, + url=RESOURCE_URL_HELP, + ) class BerryFirmnessSummarySerializer(serializers.HyperlinkedModelSerializer[BerryFirmness]): class Meta: model = BerryFirmness fields = ("name", "url") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + name=REFERENCE_NAME_HELP, + url=RESOURCE_URL_HELP, + ) class BerryFlavorSummarySerializer(serializers.HyperlinkedModelSerializer[BerryFlavor]): class Meta: model = BerryFlavor fields = ("name", "url") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + name=REFERENCE_NAME_HELP, + url=RESOURCE_URL_HELP, + ) class BerrySummarySerializer(serializers.HyperlinkedModelSerializer[Berry]): class Meta: model = Berry fields = ("name", "url") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + name=REFERENCE_NAME_HELP, + url=RESOURCE_URL_HELP, + ) class CharacteristicSummarySerializer(serializers.HyperlinkedModelSerializer[Characteristic]): class Meta: model = Characteristic fields = ("url",) + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + url=RESOURCE_URL_HELP, + ) class ContestEffectSummarySerializer(serializers.HyperlinkedModelSerializer[ContestEffect]): class Meta: model = ContestEffect fields = ("url",) + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + url=RESOURCE_URL_HELP, + ) class ContestTypeSummarySerializer(serializers.HyperlinkedModelSerializer[ContestType]): class Meta: model = ContestType fields = ("name", "url") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + name=REFERENCE_NAME_HELP, + url=RESOURCE_URL_HELP, + ) class EggGroupSummarySerializer(serializers.HyperlinkedModelSerializer[EggGroup]): class Meta: model = EggGroup fields = ("name", "url") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + name=REFERENCE_NAME_HELP, + url=RESOURCE_URL_HELP, + ) class EncounterConditionSummarySerializer(serializers.HyperlinkedModelSerializer[EncounterCondition]): class Meta: model = EncounterCondition fields = ("name", "url") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + name=REFERENCE_NAME_HELP, + url=RESOURCE_URL_HELP, + ) class EncounterConditionValueSummarySerializer(serializers.HyperlinkedModelSerializer[EncounterConditionValue]): class Meta: model = EncounterConditionValue fields = ("name", "url") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + name=REFERENCE_NAME_HELP, + url=RESOURCE_URL_HELP, + ) class EncounterMethodSummarySerializer(serializers.HyperlinkedModelSerializer[EncounterMethod]): class Meta: model = EncounterMethod fields = ("name", "url") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + name=REFERENCE_NAME_HELP, + url=RESOURCE_URL_HELP, + ) class EvolutionTriggerSummarySerializer(serializers.HyperlinkedModelSerializer[EvolutionTrigger]): class Meta: model = EvolutionTrigger fields = ("name", "url") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + name=REFERENCE_NAME_HELP, + url=RESOURCE_URL_HELP, + ) class EvolutionVariableSummarySerializer(serializers.HyperlinkedModelSerializer[EvolutionVariable]): class Meta: model = EvolutionVariable fields = ("name", "url") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + name=REFERENCE_NAME_HELP, + url=RESOURCE_URL_HELP, + ) class EvolutionConditionExpressionSerializer(serializers.Serializer[Any]): @@ -371,222 +457,367 @@ class EvolutionChainSummarySerializer(serializers.HyperlinkedModelSerializer[Evo class Meta: model = EvolutionChain fields = ("url",) + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + url=RESOURCE_URL_HELP, + ) class GenerationSummarySerializer(serializers.HyperlinkedModelSerializer[Generation]): class Meta: model = Generation fields = ("name", "url") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + name=REFERENCE_NAME_HELP, + url=RESOURCE_URL_HELP, + ) class GenderSummarySerializer(serializers.HyperlinkedModelSerializer[Gender]): class Meta: model = Gender fields = ("name", "url") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + name=REFERENCE_NAME_HELP, + url=RESOURCE_URL_HELP, + ) class GrowthRateSummarySerializer(serializers.HyperlinkedModelSerializer[GrowthRate]): class Meta: model = GrowthRate fields = ("name", "url") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + name=REFERENCE_NAME_HELP, + url=RESOURCE_URL_HELP, + ) class CurrencySummarySerializer(serializers.HyperlinkedModelSerializer[Currency]): class Meta: model = Currency fields = ("name", "url") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + name=REFERENCE_NAME_HELP, + url=RESOURCE_URL_HELP, + ) class ItemPocketSummarySerializer(serializers.HyperlinkedModelSerializer[ItemPocket]): class Meta: model = ItemPocket fields = ("name", "url") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + name=REFERENCE_NAME_HELP, + url=RESOURCE_URL_HELP, + ) class ItemCategorySummarySerializer(serializers.HyperlinkedModelSerializer[ItemCategory]): class Meta: model = ItemCategory fields = ("name", "url") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + name=REFERENCE_NAME_HELP, + url=RESOURCE_URL_HELP, + ) class ItemAttributeSummarySerializer(serializers.HyperlinkedModelSerializer[ItemAttribute]): class Meta: model = ItemAttribute fields = ("name", "url") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + name=REFERENCE_NAME_HELP, + url=RESOURCE_URL_HELP, + ) class ItemFlingEffectSummarySerializer(serializers.HyperlinkedModelSerializer[ItemFlingEffect]): class Meta: model = ItemFlingEffect fields = ("name", "url") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + name=REFERENCE_NAME_HELP, + url=RESOURCE_URL_HELP, + ) class ItemSummarySerializer(serializers.HyperlinkedModelSerializer[Item]): class Meta: model = Item fields = ("name", "url") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + name=REFERENCE_NAME_HELP, + url=RESOURCE_URL_HELP, + ) class LanguageSummarySerializer(serializers.HyperlinkedModelSerializer[Language]): class Meta: model = Language fields = ("name", "url") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + name=REFERENCE_NAME_HELP, + url=RESOURCE_URL_HELP, + ) class LocationSummarySerializer(serializers.HyperlinkedModelSerializer[Location]): class Meta: model = Location fields = ("name", "url") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + name=REFERENCE_NAME_HELP, + url=RESOURCE_URL_HELP, + ) class LocationAreaSummarySerializer(serializers.HyperlinkedModelSerializer[LocationArea]): class Meta: model = LocationArea fields = ("name", "url") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + name=REFERENCE_NAME_HELP, + url=RESOURCE_URL_HELP, + ) class MachineSummarySerializer(serializers.HyperlinkedModelSerializer[Machine]): class Meta: model = Machine fields = ("url",) + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + url=RESOURCE_URL_HELP, + ) class MoveBattleStyleSummarySerializer(serializers.HyperlinkedModelSerializer[MoveBattleStyle]): class Meta: model = MoveBattleStyle fields = ("name", "url") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + name=REFERENCE_NAME_HELP, + url=RESOURCE_URL_HELP, + ) class MoveDamageClassSummarySerializer(serializers.HyperlinkedModelSerializer[MoveDamageClass]): class Meta: model = MoveDamageClass fields = ("name", "url") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + name=REFERENCE_NAME_HELP, + url=RESOURCE_URL_HELP, + ) class MoveMetaAilmentSummarySerializer(serializers.HyperlinkedModelSerializer[MoveMetaAilment]): class Meta: model = MoveMetaAilment fields = ("name", "url") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + name=REFERENCE_NAME_HELP, + url=RESOURCE_URL_HELP, + ) class MoveMetaCategorySummarySerializer(serializers.HyperlinkedModelSerializer[MoveMetaCategory]): class Meta: model = MoveMetaCategory fields = ("name", "url") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + name=REFERENCE_NAME_HELP, + url=RESOURCE_URL_HELP, + ) class MoveTargetSummarySerializer(serializers.HyperlinkedModelSerializer[MoveTarget]): class Meta: model = MoveTarget fields = ("name", "url") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + name=REFERENCE_NAME_HELP, + url=RESOURCE_URL_HELP, + ) class MoveSummarySerializer(serializers.HyperlinkedModelSerializer[Move]): class Meta: model = Move fields = ("name", "url") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + name=REFERENCE_NAME_HELP, + url=RESOURCE_URL_HELP, + ) class MoveLearnMethodSummarySerializer(serializers.HyperlinkedModelSerializer[MoveLearnMethod]): class Meta: model = MoveLearnMethod fields = ("name", "url") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + name=REFERENCE_NAME_HELP, + url=RESOURCE_URL_HELP, + ) class NatureSummarySerializer(serializers.HyperlinkedModelSerializer[Nature]): class Meta: model = Nature fields = ("name", "url") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + name=REFERENCE_NAME_HELP, + url=RESOURCE_URL_HELP, + ) class PalParkAreaSummarySerializer(serializers.HyperlinkedModelSerializer[PalParkArea]): class Meta: model = PalParkArea fields = ("name", "url") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + name=REFERENCE_NAME_HELP, + url=RESOURCE_URL_HELP, + ) class PokeathlonStatSummarySerializer(serializers.HyperlinkedModelSerializer[PokeathlonStat]): class Meta: model = PokeathlonStat fields = ("name", "url") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + name=REFERENCE_NAME_HELP, + url=RESOURCE_URL_HELP, + ) class PokedexSummarySerializer(serializers.HyperlinkedModelSerializer[Pokedex]): class Meta: model = Pokedex fields = ("name", "url") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + name=REFERENCE_NAME_HELP, + url=RESOURCE_URL_HELP, + ) class PokemonColorSummarySerializer(serializers.HyperlinkedModelSerializer[PokemonColor]): class Meta: model = PokemonColor fields = ("name", "url") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + name=REFERENCE_NAME_HELP, + url=RESOURCE_URL_HELP, + ) class PokemonHabitatSummarySerializer(serializers.HyperlinkedModelSerializer[PokemonHabitat]): class Meta: model = PokemonHabitat fields = ("name", "url") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + name=REFERENCE_NAME_HELP, + url=RESOURCE_URL_HELP, + ) class PokemonShapeSummarySerializer(serializers.HyperlinkedModelSerializer[PokemonShape]): class Meta: model = PokemonShape fields = ("name", "url") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + name=REFERENCE_NAME_HELP, + url=RESOURCE_URL_HELP, + ) class PokemonSummarySerializer(serializers.HyperlinkedModelSerializer[Pokemon]): class Meta: model = Pokemon fields = ("name", "url") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + name=REFERENCE_NAME_HELP, + url=RESOURCE_URL_HELP, + ) class PokemonSpeciesSummarySerializer(serializers.HyperlinkedModelSerializer[PokemonSpecies]): class Meta: model = PokemonSpecies fields = ("name", "url") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + name=REFERENCE_NAME_HELP, + url=RESOURCE_URL_HELP, + ) class PokemonFormSummarySerializer(serializers.HyperlinkedModelSerializer[PokemonForm]): class Meta: model = PokemonForm fields = ("name", "url") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + name=REFERENCE_NAME_HELP, + url=RESOURCE_URL_HELP, + ) class RegionSummarySerializer(serializers.HyperlinkedModelSerializer[Region]): class Meta: model = Region fields = ("name", "url") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + name=REFERENCE_NAME_HELP, + url=RESOURCE_URL_HELP, + ) class StatSummarySerializer(serializers.HyperlinkedModelSerializer[Stat]): class Meta: model = Stat fields = ("name", "url") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + name=REFERENCE_NAME_HELP, + url=RESOURCE_URL_HELP, + ) class SuperContestEffectSummarySerializer(serializers.HyperlinkedModelSerializer[SuperContestEffect]): class Meta: model = SuperContestEffect fields = ("url",) + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + url=RESOURCE_URL_HELP, + ) class TypeSummarySerializer(serializers.HyperlinkedModelSerializer[Type]): class Meta: model = Type fields = ("name", "url") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + name=REFERENCE_NAME_HELP, + url=RESOURCE_URL_HELP, + ) class VersionSummarySerializer(serializers.HyperlinkedModelSerializer[Version]): class Meta: model = Version fields = ("name", "url") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + name=REFERENCE_NAME_HELP, + url=RESOURCE_URL_HELP, + ) class VersionGroupSummarySerializer(serializers.HyperlinkedModelSerializer[VersionGroup]): class Meta: model = VersionGroup fields = ("name", "url") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + name=REFERENCE_NAME_HELP, + url=RESOURCE_URL_HELP, + ) ##################### @@ -595,8 +826,8 @@ class Meta: class PokemonDexEntrySerializer(serializers.ModelSerializer[PokemonDexNumber]): - entry_number = serializers.IntegerField(source="pokedex_number") - pokedex = PokedexSummarySerializer() + entry_number = serializers.IntegerField(source="pokedex_number", help_text="The index number within the Pokédex.") + pokedex = PokedexSummarySerializer(help_text="The Pokédex the referenced Pokémon species can be found in.") class Meta: model = PokemonDexNumber @@ -617,18 +848,31 @@ class Meta: class CharacteristicDescriptionSerializer(serializers.ModelSerializer[CharacteristicDescription]): - language = LanguageSummarySerializer() + language = LanguageSummarySerializer(help_text=NAME_LANGUAGE_HELP) class Meta: model = CharacteristicDescription fields = ("description", "language") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + description=LOCALIZED_DESCRIPTION_HELP, + ) class CharacteristicDetailSerializer(serializers.ModelSerializer[Characteristic]): - descriptions = CharacteristicDescriptionSerializer(many=True, read_only=True, source="characteristicdescription") - highest_stat = StatSummarySerializer(source="stat") - gene_modulo = serializers.IntegerField(source="gene_mod_5") - possible_values = serializers.SerializerMethodField("get_values") + descriptions = CharacteristicDescriptionSerializer( + many=True, + read_only=True, + source="characteristicdescription", + help_text="The descriptions of this characteristic listed in different languages.", + ) + highest_stat = StatSummarySerializer(source="stat", help_text="The stat which results in this characteristic.") + gene_modulo = serializers.IntegerField( + source="gene_mod_5", help_text="The remainder of the highest stat/IV divided by 5." + ) + possible_values = serializers.SerializerMethodField( + "get_values", + help_text="The possible values of the highest stat that would result in a Pokémon recieving this characteristic when divided by 5.", + ) class Meta: model = Characteristic @@ -639,6 +883,9 @@ class Meta: "highest_stat", "descriptions", ) + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + id=RESOURCE_ID_HELP, + ) @extend_schema_field(serializers.ListField(child=serializers.IntegerField())) def get_values(self, obj: Characteristic) -> list[int]: @@ -651,64 +898,115 @@ def get_values(self, obj: Characteristic) -> list[int]: class SuperContestEffectFlavorTextSerializer(serializers.ModelSerializer[SuperContestEffectFlavorText]): - language = LanguageSummarySerializer() + language = LanguageSummarySerializer(help_text=NAME_LANGUAGE_HELP) class Meta: model = SuperContestEffectFlavorText fields = ("flavor_text", "language") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + flavor_text=LOCALIZED_FLAVOR_TEXT_HELP, + ) class SuperContestEffectDetailSerializer(serializers.ModelSerializer[SuperContestEffect]): flavor_text_entries = SuperContestEffectFlavorTextSerializer( - many=True, read_only=True, source="supercontesteffectflavortext" + many=True, + read_only=True, + source="supercontesteffectflavortext", + help_text="The flavor text of this super contest effect listed in different languages.", + ) + moves = MoveSummarySerializer( + many=True, + read_only=True, + source="move", + help_text="A list of moves that have the effect when used in super contests.", ) - moves = MoveSummarySerializer(many=True, read_only=True, source="move") class Meta: model = SuperContestEffect fields = ("id", "appeal", "flavor_text_entries", "moves") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + id=RESOURCE_ID_HELP, + appeal="The level of appeal this super contest effect has.", + ) class ContestEffectEffectTextSerializer(serializers.ModelSerializer[ContestEffectEffectText]): - language = LanguageSummarySerializer() + language = LanguageSummarySerializer(help_text=EFFECT_LANGUAGE_HELP) class Meta: model = ContestEffectEffectText fields = ("effect", "language") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + effect=LOCALIZED_EFFECT_HELP, + ) class ContestEffectFlavorTextSerializer(serializers.ModelSerializer[ContestEffectFlavorText]): - language = LanguageSummarySerializer() + language = LanguageSummarySerializer(help_text=NAME_LANGUAGE_HELP) class Meta: model = ContestEffectFlavorText fields = ("flavor_text", "language") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + flavor_text=LOCALIZED_FLAVOR_TEXT_HELP, + ) class ContestEffectDetailSerializer(serializers.ModelSerializer[ContestEffect]): - effect_entries = ContestEffectEffectTextSerializer(many=True, read_only=True, source="contesteffecteffecttext") - flavor_text_entries = ContestEffectFlavorTextSerializer(many=True, read_only=True, source="contesteffectflavortext") + effect_entries = ContestEffectEffectTextSerializer( + many=True, + read_only=True, + source="contesteffecteffecttext", + help_text="The result of this contest effect listed in different languages.", + ) + flavor_text_entries = ContestEffectFlavorTextSerializer( + many=True, + read_only=True, + source="contesteffectflavortext", + help_text="The flavor text of this contest effect listed in different languages.", + ) class Meta: model = ContestEffect fields = ("id", "appeal", "jam", "effect_entries", "flavor_text_entries") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + id=RESOURCE_ID_HELP, + appeal="The base number of hearts the user of this move gets.", + jam="The base number of hearts the user's opponent loses.", + ) class ContestTypeNameSerializer(serializers.ModelSerializer[ContestTypeName]): - language = LanguageSummarySerializer() + language = LanguageSummarySerializer(help_text="The language that this name is in.") class Meta: model = ContestTypeName fields = ("name", "color", "language") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + name="The name for this contest.", + color="The color associated with this contest's name.", + ) class ContestTypeDetailSerializer(serializers.ModelSerializer[ContestType]): - names = ContestTypeNameSerializer(many=True, read_only=True, source="contesttypename") - berry_flavor = BerryFlavorSummarySerializer(read_only=True, source="berryflavor") + names = ContestTypeNameSerializer( + many=True, + read_only=True, + source="contesttypename", + help_text="The name of this contest type listed in different languages.", + ) + berry_flavor = BerryFlavorSummarySerializer( + read_only=True, source="berryflavor", help_text="The berry flavor that correlates with this contest type." + ) class Meta: model = ContestType fields = ("id", "name", "berry_flavor", "names") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + id=RESOURCE_ID_HELP, + name=RESOURCE_NAME_HELP, + ) ######################## @@ -717,19 +1015,38 @@ class Meta: class RegionNameSerializer(serializers.ModelSerializer[RegionName]): - language = LanguageSummarySerializer() + language = LanguageSummarySerializer(help_text=NAME_LANGUAGE_HELP) class Meta: model = RegionName fields = ("name", "language") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + name=LOCALIZED_NAME_HELP, + ) class RegionDetailSerializer(serializers.ModelSerializer[Region]): - names = RegionNameSerializer(many=True, read_only=True, source="regionname") - locations = LocationSummarySerializer(many=True, read_only=True, source="location") - version_groups = serializers.SerializerMethodField("get_region_version_groups") - pokedexes = PokedexSummarySerializer(many=True, read_only=True, source="pokedex") - main_generation = GenerationSummarySerializer(read_only=True, source="generation", allow_null=True) + names = RegionNameSerializer( + many=True, + read_only=True, + source="regionname", + help_text=LOCALIZED_NAMES_HELP, + ) + locations = LocationSummarySerializer( + many=True, read_only=True, source="location", help_text="A list of locations that can be found in this region." + ) + version_groups = serializers.SerializerMethodField( + "get_region_version_groups", help_text="A list of version groups where this region can be visited." + ) + pokedexes = PokedexSummarySerializer( + many=True, + read_only=True, + source="pokedex", + help_text="A list of pokédexes that catalogue Pokémon in this region.", + ) + main_generation = GenerationSummarySerializer( + read_only=True, source="generation", allow_null=True, help_text="The generation this region was introduced in." + ) class Meta: model = Region @@ -742,6 +1059,10 @@ class Meta: "pokedexes", "version_groups", ) + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + id=RESOURCE_ID_HELP, + name=RESOURCE_NAME_HELP, + ) @extend_schema_field(VersionGroupSummarySerializer(many=True)) def get_region_version_groups(self, obj: Region) -> ReturnList[ReturnDict[str, Any]]: @@ -758,21 +1079,48 @@ def get_region_version_groups(self, obj: Region) -> ReturnList[ReturnDict[str, A class GenerationNameSerializer(serializers.ModelSerializer[GenerationName]): - language = LanguageSummarySerializer() + language = LanguageSummarySerializer(help_text=NAME_LANGUAGE_HELP) class Meta: model = GenerationName fields = ("name", "language") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + name=LOCALIZED_NAME_HELP, + ) class GenerationDetailSerializer(serializers.ModelSerializer[Generation]): - main_region = RegionSummarySerializer(source="region") - names = GenerationNameSerializer(many=True, read_only=True, source="generationname") - abilities = AbilitySummarySerializer(many=True, read_only=True, source="ability") - moves = MoveSummarySerializer(many=True, read_only=True, source="move") - pokemon_species = PokemonSpeciesSummarySerializer(many=True, read_only=True, source="pokemonspecies") - types = TypeSummarySerializer(many=True, read_only=True, source="type") - version_groups = VersionGroupSummarySerializer(many=True, read_only=True, source="versiongroup") + main_region = RegionSummarySerializer(source="region", help_text="The main region travelled in this generation.") + names = GenerationNameSerializer( + many=True, + read_only=True, + source="generationname", + help_text=LOCALIZED_NAMES_HELP, + ) + abilities = AbilitySummarySerializer( + many=True, + read_only=True, + source="ability", + help_text="A list of abilities that were introduced in this generation.", + ) + moves = MoveSummarySerializer( + many=True, read_only=True, source="move", help_text="A list of moves that were introduced in this generation." + ) + pokemon_species = PokemonSpeciesSummarySerializer( + many=True, + read_only=True, + source="pokemonspecies", + help_text="A list of Pokémon species that were introduced in this generation.", + ) + types = TypeSummarySerializer( + many=True, read_only=True, source="type", help_text="A list of types that were introduced in this generation." + ) + version_groups = VersionGroupSummarySerializer( + many=True, + read_only=True, + source="versiongroup", + help_text="A list of version groups that were introduced in this generation.", + ) class Meta: model = Generation @@ -787,6 +1135,10 @@ class Meta: "types", "version_groups", ) + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + id=RESOURCE_ID_HELP, + name=RESOURCE_NAME_HELP, + ) ######################## @@ -795,8 +1147,12 @@ class Meta: class GenderPokemonSpeciesSerializer(serializers.ModelSerializer[PokemonSpecies]): - rate = serializers.IntegerField(source="gender_rate") - pokemon_species = PokemonSpeciesSummarySerializer(source="*") + rate = serializers.IntegerField( + source="gender_rate", help_text="The chance of this Pokémon being female, in eighths; or -1 for genderless." + ) + pokemon_species = PokemonSpeciesSummarySerializer( + source="*", help_text="A Pokémon species that can be the referenced gender." + ) class Meta: model = PokemonSpecies @@ -804,12 +1160,22 @@ class Meta: class GenderDetailSerializer(serializers.ModelSerializer[Gender]): - pokemon_species_details = serializers.SerializerMethodField("get_species") - required_for_evolution = serializers.SerializerMethodField("get_required") + pokemon_species_details = serializers.SerializerMethodField( + "get_species", + help_text="A list of Pokémon species that can be this gender and how likely it is that they will be.", + ) + required_for_evolution = serializers.SerializerMethodField( + "get_required", + help_text="A list of Pokémon species that required this gender in order for a Pokémon to evolve into them.", + ) class Meta: model = Gender fields = ("id", "name", "pokemon_species_details", "required_for_evolution") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + id=RESOURCE_ID_HELP, + name=RESOURCE_NAME_HELP, + ) @extend_schema_field(GenderPokemonSpeciesSerializer(many=True)) def get_species(self, obj: Gender) -> ReturnList[ReturnDict[str, Any]]: @@ -842,24 +1208,51 @@ class ExperienceSerializer(serializers.ModelSerializer[Experience]): class Meta: model = Experience fields = ("level", "experience") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + level="The level gained.", + experience="The amount of experience required to reach the referenced level.", + ) class GrowthRateDescriptionSerializer(serializers.ModelSerializer[GrowthRateDescription]): - language = LanguageSummarySerializer() + language = LanguageSummarySerializer(help_text=NAME_LANGUAGE_HELP) class Meta: model = GrowthRateDescription fields = ("description", "language") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + description=LOCALIZED_DESCRIPTION_HELP, + ) class GrowthRateDetailSerializer(serializers.ModelSerializer[GrowthRate]): - descriptions = GrowthRateDescriptionSerializer(many=True, read_only=True, source="growthratedescription") - levels = ExperienceSerializer(many=True, read_only=True, source="experience") - pokemon_species = PokemonSpeciesSummarySerializer(many=True, read_only=True, source="pokemonspecies") + descriptions = GrowthRateDescriptionSerializer( + many=True, + read_only=True, + source="growthratedescription", + help_text="The descriptions of this characteristic listed in different languages.", + ) + levels = ExperienceSerializer( + many=True, + read_only=True, + source="experience", + help_text="A list of levels and the amount of experienced needed to atain them based on this growth rate.", + ) + pokemon_species = PokemonSpeciesSummarySerializer( + many=True, + read_only=True, + source="pokemonspecies", + help_text="A list of Pokémon species that gain levels at this growth rate.", + ) class Meta: model = GrowthRate fields = ("id", "name", "formula", "descriptions", "levels", "pokemon_species") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + id=RESOURCE_ID_HELP, + name=RESOURCE_NAME_HELP, + formula="The formula used to calculate the rate at which the Pokémon species gains level.", + ) ########################## @@ -868,19 +1261,34 @@ class Meta: class LanguageNameSerializer(serializers.ModelSerializer[LanguageName]): - language = LanguageSummarySerializer(source="local_language") + language = LanguageSummarySerializer(source="local_language", help_text=NAME_LANGUAGE_HELP) class Meta: model = LanguageName fields = ("name", "language") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + name=LOCALIZED_NAME_HELP, + ) class LanguageDetailSerializer(serializers.ModelSerializer[Language]): - names = LanguageNameSerializer(many=True, read_only=True, source="languagename_language") + names = LanguageNameSerializer( + many=True, + read_only=True, + source="languagename_language", + help_text=LOCALIZED_NAMES_HELP, + ) class Meta: model = Language fields = ("id", "name", "official", "iso639", "iso3166", "names") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + id=RESOURCE_ID_HELP, + name=RESOURCE_NAME_HELP, + official="Whether or not the games are published in this language.", + iso639="The two-letter ISO 639-1 language code. Multiple PokéAPI language records may share this code.", + iso3166="The two-letter ISO 3166-1 alpha-2 code of the country or region associated with this language record. Multiple PokéAPI language records may share this code.", + ) ######################################## @@ -889,53 +1297,97 @@ class Meta: class EncounterConditionNameSerializer(serializers.ModelSerializer[EncounterConditionName]): - language = LanguageSummarySerializer() + language = LanguageSummarySerializer(help_text=NAME_LANGUAGE_HELP) class Meta: model = EncounterConditionName fields = ("name", "language") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + name=LOCALIZED_NAME_HELP, + ) class EncounterConditionDetailSerializer(serializers.ModelSerializer[EncounterCondition]): - names = EncounterConditionNameSerializer(many=True, read_only=True, source="encounterconditionname") - values = EncounterConditionValueSummarySerializer(many=True, read_only=True, source="encounterconditionvalue") + names = EncounterConditionNameSerializer( + many=True, + read_only=True, + source="encounterconditionname", + help_text=LOCALIZED_NAMES_HELP, + ) + values = EncounterConditionValueSummarySerializer( + many=True, + read_only=True, + source="encounterconditionvalue", + help_text="A list of possible values for this encounter condition.", + ) class Meta: model = EncounterCondition fields = ("id", "name", "values", "names") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + id=RESOURCE_ID_HELP, + name=RESOURCE_NAME_HELP, + ) class EncounterConditionValueNameSerializer(serializers.ModelSerializer[EncounterConditionValueName]): - language = LanguageSummarySerializer() + language = LanguageSummarySerializer(help_text=NAME_LANGUAGE_HELP) class Meta: model = EncounterConditionValueName fields = ("name", "language") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + name=LOCALIZED_NAME_HELP, + ) class EncounterConditionValueDetailSerializer(serializers.ModelSerializer[EncounterConditionValue]): - condition = EncounterConditionSummarySerializer(source="encounter_condition") - names = EncounterConditionValueNameSerializer(many=True, read_only=True, source="encounterconditionvaluename") + condition = EncounterConditionSummarySerializer( + source="encounter_condition", help_text="The condition this encounter condition value pertains to." + ) + names = EncounterConditionValueNameSerializer( + many=True, + read_only=True, + source="encounterconditionvaluename", + help_text=LOCALIZED_NAMES_HELP, + ) class Meta: model = EncounterConditionValue fields = ("id", "name", "condition", "names") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + id=RESOURCE_ID_HELP, + name=RESOURCE_NAME_HELP, + ) class EncounterMethodNameSerializer(serializers.ModelSerializer[EncounterMethodName]): - language = LanguageSummarySerializer() + language = LanguageSummarySerializer(help_text=NAME_LANGUAGE_HELP) class Meta: model = EncounterMethodName fields = ("name", "language") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + name=LOCALIZED_NAME_HELP, + ) class EncounterMethodDetailSerializer(serializers.ModelSerializer[EncounterMethod]): - names = EncounterMethodNameSerializer(many=True, read_only=True, source="encountermethodname") + names = EncounterMethodNameSerializer( + many=True, + read_only=True, + source="encountermethodname", + help_text=LOCALIZED_NAMES_HELP, + ) class Meta: model = EncounterMethod fields = ("id", "name", "order", "names") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + id=RESOURCE_ID_HELP, + name=RESOURCE_NAME_HELP, + order="A good value for sorting.", + ) class EncounterSlotSerializer(serializers.ModelSerializer[EncounterSlot]): @@ -956,14 +1408,26 @@ class Meta: "never_shiny", "is_alpha", ) + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + min_perfect_ivs="The minimum number of perfect IVs, or null if unspecified.", + always_shiny="Whether the encountered Pokémon is always shiny.", + never_shiny="Whether the encountered Pokémon can never be shiny.", + is_alpha="Whether the encountered Pokémon is an alpha Pokémon.", + ) class EncounterDetailSerializer(serializers.ModelSerializer[Encounter]): version = VersionSummarySerializer() location_area = LocationAreaSummarySerializer() pokemon = PokemonSummarySerializer() - condition_values = serializers.SerializerMethodField("get_encounter_conditions") - pokemon_details = serializers.SerializerMethodField("get_encounter_pokemon_details") + condition_values = serializers.SerializerMethodField( + "get_encounter_conditions", + help_text="A list of condition values that must be in effect for this encounter to occur.", + ) + pokemon_details = serializers.SerializerMethodField( + "get_encounter_pokemon_details", + help_text="Additional properties of the encountered Pokémon, or null if unspecified.", + ) class Meta: model = Encounter @@ -977,6 +1441,10 @@ class Meta: "condition_values", "pokemon_details", ) + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + min_level="The lowest level the Pokémon could be encountered at.", + max_level="The highest level the Pokémon could be encountered at.", + ) @extend_schema_field(EncounterConditionValueSummarySerializer(many=True)) def get_encounter_conditions(self, obj: Encounter) -> list[dict[str, Any]]: @@ -999,30 +1467,49 @@ def get_encounter_pokemon_details(self, obj: Encounter) -> ReturnDict[str, Any] class LocationAreaNameSerializer(serializers.ModelSerializer[LocationAreaName]): - language = LanguageSummarySerializer() + language = LanguageSummarySerializer(help_text=NAME_LANGUAGE_HELP) class Meta: model = LocationAreaName fields = ("name", "language") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + name=LOCALIZED_NAME_HELP, + ) class LocationAreaEncounterVersionDetailSerializer(serializers.Serializer[Any]): - rate = serializers.IntegerField() - version = VersionSummarySerializer() + rate = serializers.IntegerField(help_text="The chance of an encounter to occur.") + version = VersionSummarySerializer( + help_text="The version of the game in which the encounter can occur with the given chance." + ) class LocationAreaEncounterRateSerializer(serializers.Serializer[Any]): - encounter_method = EncounterMethodSummarySerializer() - version_details = LocationAreaEncounterVersionDetailSerializer(many=True) + encounter_method = EncounterMethodSummarySerializer( + help_text="The method in which Pokémon may be encountered in an area.." + ) + version_details = LocationAreaEncounterVersionDetailSerializer( + many=True, help_text="The chance of the encounter to occur on a version of the game." + ) class LocationAreaEncounterDetailSerializer(serializers.Serializer[Any]): - min_level = serializers.IntegerField() - max_level = serializers.IntegerField() - chance = serializers.IntegerField(source="encounter_slot.rarity", default=0) - method = EncounterMethodSummarySerializer(source="encounter_slot.encounter_method", default=None) - condition_values = serializers.SerializerMethodField("get_encounter_conditions") - pokemon_details = serializers.SerializerMethodField("get_encounter_pokemon_details") + min_level = serializers.IntegerField(help_text="The lowest level the Pokémon could be encountered at.") + max_level = serializers.IntegerField(help_text="The highest level the Pokémon could be encountered at.") + chance = serializers.IntegerField( + source="encounter_slot.rarity", default=0, help_text="Percent chance that this encounter will occur." + ) + method = EncounterMethodSummarySerializer( + source="encounter_slot.encounter_method", default=None, help_text="The method by which this encounter happens." + ) + condition_values = serializers.SerializerMethodField( + "get_encounter_conditions", + help_text="A list of condition values that must be in effect for this encounter to occur.", + ) + pokemon_details = serializers.SerializerMethodField( + "get_encounter_pokemon_details", + help_text="Additional properties of the encountered Pokémon, or null if unspecified.", + ) @extend_schema_field(EncounterConditionValueSummarySerializer(many=True)) def get_encounter_conditions(self, obj: Encounter) -> list[ReturnDict[str, Any]]: @@ -1046,21 +1533,37 @@ def get_encounter_pokemon_details(self, obj: Encounter) -> ReturnDict[str, Any] class LocationAreaPokemonEncounterVersionSerializer(serializers.Serializer[Any]): - version = VersionSummarySerializer() - max_chance = serializers.IntegerField() - encounter_details = LocationAreaEncounterDetailSerializer(many=True) + version = VersionSummarySerializer(help_text="The game version this encounter happens in.") + max_chance = serializers.IntegerField(help_text="The total percentage of all encounter potential.") + encounter_details = LocationAreaEncounterDetailSerializer( + many=True, help_text="A list of encounters and their specifics." + ) class LocationAreaPokemonEncounterSerializer(serializers.Serializer[Any]): - pokemon = PokemonSummarySerializer() - version_details = LocationAreaPokemonEncounterVersionSerializer(many=True) + pokemon = PokemonSummarySerializer(help_text="The Pokémon being encountered.") + version_details = LocationAreaPokemonEncounterVersionSerializer( + many=True, + help_text="A list of versions and encounters with Pokémon that might happen in the referenced location area.", + ) class LocationAreaDetailSerializer(serializers.ModelSerializer[LocationArea]): - location = LocationSummarySerializer() - encounter_method_rates = serializers.SerializerMethodField("get_method_rates") - pokemon_encounters = serializers.SerializerMethodField("get_encounters") - names = LocationAreaNameSerializer(many=True, read_only=True, source="locationareaname") + location = LocationSummarySerializer(help_text="The region this location area can be found in.") + encounter_method_rates = serializers.SerializerMethodField( + "get_method_rates", + help_text="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.", + ) + pokemon_encounters = serializers.SerializerMethodField( + "get_encounters", + help_text="A list of Pokémon that can be encountered in this area along with version specific details about the encounter.", + ) + names = LocationAreaNameSerializer( + many=True, + read_only=True, + source="locationareaname", + help_text=LOCALIZED_NAMES_HELP, + ) class Meta: model = LocationArea @@ -1073,6 +1576,11 @@ class Meta: "names", "pokemon_encounters", ) + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + id=RESOURCE_ID_HELP, + name=RESOURCE_NAME_HELP, + game_index=GAME_INDEX_HELP, + ) @extend_schema_field(LocationAreaEncounterRateSerializer(many=True)) def get_method_rates(self, obj: LocationAreaEncounterRate) -> ReturnList[ReturnDict[str, Any]]: @@ -1140,30 +1648,52 @@ def get_encounters(self, obj: LocationArea) -> ReturnList[ReturnDict[str, Any]]: class LocationGameIndexSerializer(serializers.ModelSerializer[LocationGameIndex]): - generation = GenerationSummarySerializer() + generation = GenerationSummarySerializer(help_text=GAME_INDEX_GENERATION_HELP) class Meta: model = LocationGameIndex fields = ("game_index", "generation") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + game_index=GAME_INDEX_HELP, + ) class LocationNameSerializer(serializers.ModelSerializer[LocationName]): - language = LanguageSummarySerializer() + language = LanguageSummarySerializer(help_text=NAME_LANGUAGE_HELP) class Meta: model = LocationName fields = ("name", "language") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + name=LOCALIZED_NAME_HELP, + ) class LocationDetailSerializer(serializers.ModelSerializer[Location]): - region = RegionSummarySerializer(allow_null=True) - names = LocationNameSerializer(many=True, read_only=True, source="locationname") - game_indices = LocationGameIndexSerializer(many=True, read_only=True, source="locationgameindex") - areas = LocationAreaSummarySerializer(many=True, read_only=True, source="locationarea") + region = RegionSummarySerializer(allow_null=True, help_text="The region this location can be found in.") + names = LocationNameSerializer( + many=True, + read_only=True, + source="locationname", + help_text=LOCALIZED_NAMES_HELP, + ) + game_indices = LocationGameIndexSerializer( + many=True, + read_only=True, + source="locationgameindex", + help_text="A list of game indices relevent to this location by generation.", + ) + areas = LocationAreaSummarySerializer( + many=True, read_only=True, source="locationarea", help_text="Areas that can be found within this location." + ) class Meta: model = Location fields = ("id", "name", "region", "names", "game_indices", "areas") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + id=RESOURCE_ID_HELP, + name=RESOURCE_NAME_HELP, + ) ######################### @@ -1172,17 +1702,21 @@ class Meta: class AbilityEffectTextSerializer(serializers.ModelSerializer[AbilityEffectText]): - language = LanguageSummarySerializer() + language = LanguageSummarySerializer(help_text=EFFECT_LANGUAGE_HELP) class Meta: model = AbilityEffectText fields = ("effect", "short_effect", "language") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + effect=LOCALIZED_EFFECT_HELP, + short_effect=LOCALIZED_SHORT_EFFECT_HELP, + ) class AbilityFlavorTextSerializer(serializers.ModelSerializer[AbilityFlavorText]): - flavor_text = serializers.CharField() - language = LanguageSummarySerializer() - version_group = VersionGroupSummarySerializer() + flavor_text = serializers.CharField(help_text="The localized name for an API resource in a specific language.") + language = LanguageSummarySerializer(help_text="The language this text resource is in.") + version_group = VersionGroupSummarySerializer(help_text="The version group that uses this flavor text.") class Meta: model = AbilityFlavorText @@ -1190,7 +1724,7 @@ class Meta: class AbilityChangeEffectTextSerializer(serializers.ModelSerializer[AbilityChangeEffectText]): - language = LanguageSummarySerializer() + language = LanguageSummarySerializer(help_text=EFFECT_LANGUAGE_HELP) class Meta: model = AbilityChangeEffectText @@ -1198,11 +1732,21 @@ class Meta: "effect", "language", ) + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + effect=LOCALIZED_EFFECT_HELP, + ) class AbilityChangeSerializer(serializers.ModelSerializer[AbilityChange]): - version_group = VersionGroupSummarySerializer() - effect_entries = AbilityChangeEffectTextSerializer(many=True, read_only=True, source="abilitychangeeffecttext") + version_group = VersionGroupSummarySerializer( + help_text="The version group in which the previous effect of this ability originated." + ) + effect_entries = AbilityChangeEffectTextSerializer( + many=True, + read_only=True, + source="abilitychangeeffecttext", + help_text="The previous effect of this ability listed in different languages.", + ) class Meta: model = AbilityChange @@ -1210,28 +1754,57 @@ class Meta: class AbilityNameSerializer(serializers.ModelSerializer[AbilityName]): - language = LanguageSummarySerializer() + language = LanguageSummarySerializer(help_text=NAME_LANGUAGE_HELP) class Meta: model = AbilityName fields = ("name", "language") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + name=LOCALIZED_NAME_HELP, + ) class AbilityPokemonDetailSerializer(serializers.ModelSerializer[PokemonAbility]): - pokemon = PokemonSummarySerializer() + pokemon = PokemonSummarySerializer(help_text="The Pokémon this ability could belong to.") class Meta: model = PokemonAbility fields = ("is_hidden", "slot", "pokemon") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + is_hidden="Whether or not this a hidden ability for the referenced Pokémon.", + 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 pokemon.", + ) class AbilityDetailSerializer(serializers.ModelSerializer[Ability]): - effect_entries = AbilityEffectTextSerializer(many=True, read_only=True, source="abilityeffecttext") - flavor_text_entries = AbilityFlavorTextSerializer(many=True, read_only=True, source="abilityflavortext") - names = AbilityNameSerializer(many=True, read_only=True, source="abilityname") - generation = GenerationSummarySerializer() - effect_changes = AbilityChangeSerializer(many=True, read_only=True, source="abilitychange") - pokemon = serializers.SerializerMethodField("get_ability_pokemon") + effect_entries = AbilityEffectTextSerializer( + many=True, + read_only=True, + source="abilityeffecttext", + help_text="The effect of this ability listed in different languages.", + ) + flavor_text_entries = AbilityFlavorTextSerializer( + many=True, + read_only=True, + source="abilityflavortext", + help_text="The flavor text of this ability listed in different languages.", + ) + names = AbilityNameSerializer( + many=True, + read_only=True, + source="abilityname", + help_text=LOCALIZED_NAMES_HELP, + ) + generation = GenerationSummarySerializer(help_text="The generation this ability originated in.") + effect_changes = AbilityChangeSerializer( + many=True, + read_only=True, + source="abilitychange", + help_text="The list of previous effects this ability has had across version groups.", + ) + pokemon = serializers.SerializerMethodField( + "get_ability_pokemon", help_text="A list of Pokémon that could potentially have this ability." + ) class Meta: model = Ability @@ -1246,6 +1819,11 @@ class Meta: "flavor_text_entries", "pokemon", ) + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + id=RESOURCE_ID_HELP, + name=RESOURCE_NAME_HELP, + is_main_series="Whether or not this ability originated in the main series of the video games.", + ) @extend_schema_field(AbilityPokemonDetailSerializer(many=True)) def get_ability_pokemon(self, obj: Ability) -> ReturnList[ReturnDict[str, Any]]: @@ -1262,38 +1840,66 @@ def get_ability_pokemon(self, obj: Ability) -> ReturnList[ReturnDict[str, Any]]: class StatNameSerializer(serializers.ModelSerializer[StatName]): - language = LanguageSummarySerializer() + language = LanguageSummarySerializer(help_text=NAME_LANGUAGE_HELP) class Meta: model = StatName fields = ("name", "language") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + name=LOCALIZED_NAME_HELP, + ) class MoveStatChangeSerializer(serializers.ModelSerializer[MoveMetaStatChange]): - move = MoveSummarySerializer() + move = MoveSummarySerializer(help_text="The move causing the change.") class Meta: model = MoveMetaStatChange fields = ("change", "move") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + change="The maximum amount of change to the referenced stat.", + ) class StatAffectingMovesSerializer(serializers.Serializer[Any]): - increase = MoveStatChangeSerializer(many=True) - decrease = MoveStatChangeSerializer(many=True) + increase = MoveStatChangeSerializer(many=True, help_text="A list of moves and how they change the referenced stat.") + decrease = MoveStatChangeSerializer(many=True, help_text="A list of moves and how they change the referenced stat.") class StatAffectingNaturesSerializer(serializers.Serializer[Any]): - increase = NatureSummarySerializer(many=True) - decrease = NatureSummarySerializer(many=True) + increase = NatureSummarySerializer( + many=True, help_text="A list of natures and how they change the referenced stat." + ) + decrease = NatureSummarySerializer( + many=True, help_text="A list of nature sand how they change the referenced stat." + ) class StatDetailSerializer(serializers.ModelSerializer[Stat]): - names = StatNameSerializer(many=True, read_only=True, source="statname") - move_damage_class = MoveDamageClassSummarySerializer() - characteristics = CharacteristicSummarySerializer(many=True, read_only=True, source="characteristic") - affecting_moves = serializers.SerializerMethodField("get_moves_that_affect") - affecting_natures = serializers.SerializerMethodField("get_natures_that_affect") - affecting_items = serializers.SerializerMethodField("get_items_that_affect") + names = StatNameSerializer( + many=True, + read_only=True, + source="statname", + help_text=LOCALIZED_NAMES_HELP, + ) + move_damage_class = MoveDamageClassSummarySerializer( + allow_null=True, help_text="The class of damage this stat is directly related to." + ) + characteristics = CharacteristicSummarySerializer( + many=True, + read_only=True, + source="characteristic", + help_text="A list of characteristics that are set on a Pokémon when its highest base stat is this stat.", + ) + affecting_moves = serializers.SerializerMethodField( + "get_moves_that_affect", help_text="A detail of moves which affect this stat positively or negatively." + ) + affecting_natures = serializers.SerializerMethodField( + "get_natures_that_affect", help_text="A detail of natures which affect this stat positively or negatively." + ) + affecting_items = serializers.SerializerMethodField( + "get_items_that_affect", help_text="Items that affect this stat, such as vitamins and battle items." + ) class Meta: model = Stat @@ -1309,6 +1915,12 @@ class Meta: "move_damage_class", "names", ) + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + id=RESOURCE_ID_HELP, + name=RESOURCE_NAME_HELP, + game_index="ID the games use for this stat.", + is_battle_only="Whether this stat only exists within a battle.", + ) @extend_schema_field(StatAffectingMovesSerializer) def get_moves_that_affect(self, obj: Stat) -> ReturnDict[str, Any]: @@ -1368,20 +1980,37 @@ def get_items_that_affect(self, obj: Stat) -> ReturnList[ReturnDict[str, Any]]: class ItemPocketNameSerializer(serializers.ModelSerializer[ItemPocketName]): - language = LanguageSummarySerializer() + language = LanguageSummarySerializer(help_text=NAME_LANGUAGE_HELP) class Meta: model = ItemPocketName fields = ("name", "language") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + name=LOCALIZED_NAME_HELP, + ) class ItemPocketDetailSerializer(serializers.ModelSerializer[ItemPocket]): - names = ItemPocketNameSerializer(many=True, read_only=True, source="itempocketname") - categories = ItemCategorySummarySerializer(many=True, read_only=True, source="itemcategory") + names = ItemPocketNameSerializer( + many=True, + read_only=True, + source="itempocketname", + help_text=LOCALIZED_NAMES_HELP, + ) + categories = ItemCategorySummarySerializer( + many=True, + read_only=True, + source="itemcategory", + help_text="A list of item categories that are relevant to this item pocket.", + ) class Meta: model = ItemPocket fields = ("id", "name", "categories", "categories", "names") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + id=RESOURCE_ID_HELP, + name=RESOURCE_NAME_HELP, + ) ############################### @@ -1390,21 +2019,37 @@ class Meta: class ItemCategoryNameSerializer(serializers.ModelSerializer[ItemCategoryName]): - language = LanguageSummarySerializer() + language = LanguageSummarySerializer(help_text=NAME_LANGUAGE_HELP) class Meta: model = ItemCategoryName fields = ("name", "language") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + name=LOCALIZED_NAME_HELP, + ) class ItemCategoryDetailSerializer(serializers.ModelSerializer[ItemCategory]): - names = ItemCategoryNameSerializer(many=True, read_only=True, source="itemcategoryname") - pocket = ItemPocketSummarySerializer(source="item_pocket") - items = ItemSummarySerializer(many=True, read_only=True, source="item") + names = ItemCategoryNameSerializer( + many=True, + read_only=True, + source="itemcategoryname", + help_text="The name of this item category listed in different languages.", + ) + pocket = ItemPocketSummarySerializer( + source="item_pocket", help_text="The pocket items in this category would be put in." + ) + items = ItemSummarySerializer( + many=True, read_only=True, source="item", help_text="A list of items that are a part of this category." + ) class Meta: model = ItemCategory fields = ("id", "name", "items", "names", "pocket") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + id=RESOURCE_ID_HELP, + name=RESOURCE_NAME_HELP, + ) ################################ @@ -1413,29 +2058,51 @@ class Meta: class ItemAttributeNameSerializer(serializers.ModelSerializer[ItemAttributeName]): - language = LanguageSummarySerializer() + language = LanguageSummarySerializer(help_text=NAME_LANGUAGE_HELP) class Meta: model = ItemAttributeName fields = ("name", "language") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + name=LOCALIZED_NAME_HELP, + ) class ItemAttributeDescriptionSerializer(serializers.ModelSerializer[ItemAttributeDescription]): - language = LanguageSummarySerializer() + language = LanguageSummarySerializer(help_text=NAME_LANGUAGE_HELP) class Meta: model = ItemAttributeDescription fields = ("description", "language") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + description=LOCALIZED_DESCRIPTION_HELP, + ) class ItemAttributeDetailSerializer(serializers.ModelSerializer[ItemAttribute]): - names = ItemAttributeNameSerializer(many=True, read_only=True, source="itemattributename") - descriptions = ItemAttributeDescriptionSerializer(many=True, read_only=True, source="itemattributedescription") - items = serializers.SerializerMethodField("get_attribute_items") + names = ItemAttributeNameSerializer( + many=True, + read_only=True, + source="itemattributename", + help_text="The name of this item attribute listed in different languages.", + ) + descriptions = ItemAttributeDescriptionSerializer( + many=True, + read_only=True, + source="itemattributedescription", + help_text="The description of this item attribute listed in different languages.", + ) + items = serializers.SerializerMethodField( + "get_attribute_items", help_text="A list of items that have this attribute." + ) class Meta: model = ItemAttribute fields = ("id", "name", "descriptions", "items", "names") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + id=RESOURCE_ID_HELP, + name=RESOURCE_NAME_HELP, + ) @extend_schema_field(ItemSummarySerializer(many=True)) def get_attribute_items(self, obj: ItemAttribute) -> ReturnList[ReturnDict[str, Any]]: @@ -1451,19 +2118,31 @@ def get_attribute_items(self, obj: ItemAttribute) -> ReturnList[ReturnDict[str, class CurrencyNameSerializer(serializers.ModelSerializer[CurrencyName]): - language = LanguageSummarySerializer() + language = LanguageSummarySerializer(help_text=NAME_LANGUAGE_HELP) class Meta: model = CurrencyName fields = ("name", "language") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + name=LOCALIZED_NAME_HELP, + ) class CurrencyDetailSerializer(serializers.ModelSerializer[Currency]): - names = CurrencyNameSerializer(many=True, read_only=True, source="currencyname") + names = CurrencyNameSerializer( + many=True, + read_only=True, + source="currencyname", + help_text=LOCALIZED_NAMES_HELP, + ) class Meta: model = Currency fields = ("id", "name", "names") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + id=RESOURCE_ID_HELP, + name=RESOURCE_NAME_HELP, + ) ################################### @@ -1472,20 +2151,34 @@ class Meta: class ItemFlingEffectEffectTextSerializer(serializers.ModelSerializer[ItemFlingEffectEffectText]): - language = LanguageSummarySerializer() + language = LanguageSummarySerializer(help_text=EFFECT_LANGUAGE_HELP) class Meta: model = ItemFlingEffectEffectText fields = ("effect", "language") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + effect=LOCALIZED_EFFECT_HELP, + ) class ItemFlingEffectDetailSerializer(serializers.ModelSerializer[ItemFlingEffect]): - effect_entries = ItemFlingEffectEffectTextSerializer(many=True, read_only=True, source="itemflingeffecteffecttext") - items = ItemSummarySerializer(many=True, read_only=True, source="item") + effect_entries = ItemFlingEffectEffectTextSerializer( + many=True, + read_only=True, + source="itemflingeffecteffecttext", + help_text="The result of this fling effect listed in different languages.", + ) + items = ItemSummarySerializer( + many=True, read_only=True, source="item", help_text="A list of items that have this fling effect." + ) class Meta: model = ItemFlingEffect fields = ("id", "name", "effect_entries", "items") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + id=RESOURCE_ID_HELP, + name=RESOURCE_NAME_HELP, + ) ####################### @@ -1494,9 +2187,9 @@ class Meta: class ItemFlavorTextSerializer(serializers.ModelSerializer[ItemFlavorText]): - text = serializers.CharField(source="flavor_text") - language = LanguageSummarySerializer() - version_group = VersionGroupSummarySerializer() + text = serializers.CharField(source="flavor_text", help_text=LOCALIZED_FLAVOR_TEXT_HELP) + language = LanguageSummarySerializer(help_text=NAME_LANGUAGE_HELP) + version_group = VersionGroupSummarySerializer(help_text="The version group which uses this flavor text.") class Meta: model = ItemFlavorText @@ -1504,24 +2197,31 @@ class Meta: class ItemEffectTextSerializer(serializers.ModelSerializer[ItemEffectText]): - language = LanguageSummarySerializer() + language = LanguageSummarySerializer(help_text=EFFECT_LANGUAGE_HELP) class Meta: model = ItemEffectText fields = ("effect", "short_effect", "language") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + effect=LOCALIZED_EFFECT_HELP, + short_effect=LOCALIZED_SHORT_EFFECT_HELP, + ) class ItemGameIndexSerializer(serializers.ModelSerializer[ItemGameIndex]): - generation = GenerationSummarySerializer() + generation = GenerationSummarySerializer(help_text=GAME_INDEX_GENERATION_HELP) class Meta: model = ItemGameIndex fields = ("game_index", "generation") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + game_index=GAME_INDEX_HELP, + ) class ItemPriceSerializer(serializers.ModelSerializer[ItemPrice]): - currency = CurrencySummarySerializer() - version_group = VersionGroupSummarySerializer() + currency = CurrencySummarySerializer(help_text="The currency used for this price.") + version_group = VersionGroupSummarySerializer(help_text="The version group to which this price applies.") class Meta: model = ItemPrice @@ -1531,33 +2231,49 @@ class Meta: "currency", "version_group", ) + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + purchase_price="The purchase price in this currency and version group, or null if unavailable.", + sell_price="The sell price in this currency and version group, or null if unavailable.", + ) class ItemNameSerializer(serializers.ModelSerializer[ItemName]): - language = LanguageSummarySerializer() + language = LanguageSummarySerializer(help_text=NAME_LANGUAGE_HELP) class Meta: model = ItemName fields = ("name", "language") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + name=LOCALIZED_NAME_HELP, + ) class ItemSpritesSerializer(serializers.Serializer[Any]): - default = serializers.CharField(allow_null=True) + default = serializers.CharField(allow_null=True, help_text="The default depiction of this item.") class PokemonHeldItemVersionSerializer(serializers.Serializer[Any]): - rarity = serializers.IntegerField() - version = VersionSummarySerializer() + rarity = serializers.IntegerField(help_text="How often the item is held.") + version = VersionSummarySerializer(help_text="The version in which the item is held.") class PokemonHeldItemSerializer(serializers.Serializer[Any]): - pokemon = PokemonSummarySerializer() - version_details = PokemonHeldItemVersionSerializer(many=True) + pokemon = PokemonSummarySerializer(help_text="The Pokémon that holds this item.") + version_details = PokemonHeldItemVersionSerializer( + many=True, help_text="The details for the version that this item is held in by the Pokémon." + ) + + +class PokemonHeldItemSummarySerializer(serializers.Serializer[Any]): + item = ItemSummarySerializer(help_text="The item the referenced Pokémon holds.") + version_details = PokemonHeldItemVersionSerializer( + many=True, help_text="The details of the different versions in which the item is held." + ) class ItemMachineSerializer(serializers.ModelSerializer[Machine]): - machine = MachineSummarySerializer(source="*") - version_group = VersionGroupSummarySerializer() + machine = MachineSummarySerializer(source="*", help_text="The machine that teaches a move from an item.") + version_group = VersionGroupSummarySerializer(help_text="The version group of this specific machine.") class Meta: model = Machine @@ -1565,18 +2281,54 @@ class Meta: class ItemDetailSerializer(serializers.ModelSerializer[Item]): - names = ItemNameSerializer(many=True, read_only=True, source="itemname") - game_indices = ItemGameIndexSerializer(many=True, read_only=True, source="itemgameindex") - prices = ItemPriceSerializer(many=True, read_only=True, source="itemprice") - effect_entries = ItemEffectTextSerializer(many=True, read_only=True, source="itemeffecttext") - flavor_text_entries = ItemFlavorTextSerializer(many=True, read_only=True, source="itemflavortext") - category = ItemCategorySummarySerializer(source="item_category") - attributes = serializers.SerializerMethodField("get_item_attributes") - fling_effect = ItemFlingEffectSummarySerializer(source="item_fling_effect") - held_by_pokemon = serializers.SerializerMethodField("get_held_by_pokemon") - baby_trigger_for = serializers.SerializerMethodField("get_baby_trigger_for") - sprites = serializers.SerializerMethodField("get_item_sprites") - machines = serializers.SerializerMethodField("get_item_machines") + names = ItemNameSerializer( + many=True, read_only=True, source="itemname", help_text="The name of this item listed in different languages." + ) + game_indices = ItemGameIndexSerializer( + many=True, + read_only=True, + source="itemgameindex", + help_text="A list of game indices relevent to this item by generation.", + ) + prices = ItemPriceSerializer( + many=True, + read_only=True, + source="itemprice", + help_text="Purchase and sell prices by currency and version group. Prices may be null when the item cannot be bought or sold.", + ) + effect_entries = ItemEffectTextSerializer( + many=True, + read_only=True, + source="itemeffecttext", + help_text="The effect of this ability listed in different languages.", + ) + flavor_text_entries = ItemFlavorTextSerializer( + many=True, + read_only=True, + source="itemflavortext", + help_text="The flavor text of this ability listed in different languages.", + ) + category = ItemCategorySummarySerializer( + source="item_category", help_text="The category of items this item falls into." + ) + attributes = serializers.SerializerMethodField( + "get_item_attributes", help_text="A list of attributes this item has." + ) + fling_effect = ItemFlingEffectSummarySerializer( + source="item_fling_effect", allow_null=True, help_text="The effect of the move Fling when used with this item." + ) + held_by_pokemon = serializers.SerializerMethodField( + "get_held_by_pokemon", help_text="A list of Pokémon that might be found in the wild holding this item." + ) + baby_trigger_for = serializers.SerializerMethodField( + "get_baby_trigger_for", help_text="An evolution chain this item requires to produce a bay during mating." + ) + sprites = serializers.SerializerMethodField( + "get_item_sprites", help_text="A set of sprites used to depict this item in the game." + ) + machines = serializers.SerializerMethodField( + "get_item_machines", help_text="A list of the machines related to this item." + ) class Meta: model = Item @@ -1597,6 +2349,11 @@ class Meta: "baby_trigger_for", "machines", ) + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + id=RESOURCE_ID_HELP, + name=RESOURCE_NAME_HELP, + fling_power="The power of the move Fling when used with this item.", + ) @extend_schema_field(ItemMachineSerializer(many=True)) def get_item_machines(self, obj: Item) -> list[ReturnDict[str, Any]]: @@ -1653,7 +2410,7 @@ def get_baby_trigger_for(self, obj: Item) -> ReturnDict[str, Any] | None: class NatureBattleStylePreferenceSerializer(serializers.ModelSerializer[NatureBattleStylePreference]): - move_battle_style = MoveBattleStyleSummarySerializer() + move_battle_style = MoveBattleStyleSummarySerializer(help_text="The move battle style.") class Meta: model = NatureBattleStylePreference @@ -1662,34 +2419,61 @@ class Meta: "high_hp_preference", "move_battle_style", ) + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + low_hp_preference="Chance of using the move, in percent, if HP is under one half.", + high_hp_preference="Chance of using the move, in percent, if HP is over one half.", + ) class NatureNameSerializer(serializers.ModelSerializer[NatureName]): - language = LanguageSummarySerializer() + language = LanguageSummarySerializer(help_text=NAME_LANGUAGE_HELP) class Meta: model = NatureName fields = ("name", "language") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + name=LOCALIZED_NAME_HELP, + ) class NaturePokeathlonStatSerializer(serializers.ModelSerializer[NaturePokeathlonStat]): - pokeathlon_stat = PokeathlonStatSummarySerializer() + pokeathlon_stat = PokeathlonStatSummarySerializer(help_text="The stat being affected.") class Meta: model = NaturePokeathlonStat fields = ("max_change", "pokeathlon_stat") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + max_change="The amount of change.", + ) class NatureDetailSerializer(serializers.ModelSerializer[Nature]): - names = NatureNameSerializer(many=True, read_only=True, source="naturename") - decreased_stat = StatSummarySerializer() - increased_stat = StatSummarySerializer() - likes_flavor = BerryFlavorSummarySerializer() - hates_flavor = BerryFlavorSummarySerializer() - berries = BerrySummarySerializer(many=True, read_only=True, source="berry") - pokeathlon_stat_changes = serializers.SerializerMethodField("get_pokeathlon_stats") - move_battle_style_preferences = NatureBattleStylePreferenceSerializer( - many=True, read_only=True, source="naturebattlestylepreference" + names = NatureNameSerializer( + many=True, + read_only=True, + source="naturename", + help_text=LOCALIZED_NAMES_HELP, + ) + decreased_stat = StatSummarySerializer( + allow_null=True, help_text="The stat decreased by 10% in Pokémon with this nature." + ) + increased_stat = StatSummarySerializer( + allow_null=True, help_text="The stat increased by 10% in Pokémon with this nature." + ) + likes_flavor = BerryFlavorSummarySerializer( + allow_null=True, help_text="The flavor liked by Pokémon with this nature." + ) + hates_flavor = BerryFlavorSummarySerializer( + allow_null=True, help_text="The flavor hated by Pokémon with this nature." + ) + pokeathlon_stat_changes = serializers.SerializerMethodField( + "get_pokeathlon_stats", help_text="A list of Pokéathlon stats this nature effects and how much it effects them." + ) + move_battle_style_preferences = NatureBattleStylePreferenceSerializer( + many=True, + read_only=True, + source="naturebattlestylepreference", + help_text="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.", ) class Meta: @@ -1701,11 +2485,14 @@ class Meta: "increased_stat", "likes_flavor", "hates_flavor", - "berries", "pokeathlon_stat_changes", "move_battle_style_preferences", "names", ) + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + id=RESOURCE_ID_HELP, + name=RESOURCE_NAME_HELP, + ) @extend_schema_field(NaturePokeathlonStatSerializer(many=True)) def get_pokeathlon_stats(self, obj: Nature) -> ReturnList[ReturnDict[str, Any]]: @@ -1722,46 +2509,77 @@ def get_pokeathlon_stats(self, obj: Nature) -> ReturnList[ReturnDict[str, Any]]: class BerryFirmnessNameSerializer(serializers.ModelSerializer[BerryFirmnessName]): - language = LanguageSummarySerializer() + language = LanguageSummarySerializer(help_text=NAME_LANGUAGE_HELP) class Meta: model = BerryFirmnessName fields = ("name", "language") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + name=LOCALIZED_NAME_HELP, + ) class BerryFirmnessDetailSerializer(serializers.ModelSerializer[BerryFirmness]): - names = BerryFirmnessNameSerializer(many=True, read_only=True, source="berryfirmnessname") - berries = BerrySummarySerializer(many=True, read_only=True, source="berry") + names = BerryFirmnessNameSerializer( + many=True, + read_only=True, + source="berryfirmnessname", + help_text=LOCALIZED_NAMES_HELP, + ) + berries = BerrySummarySerializer( + many=True, read_only=True, source="berry", help_text="A list of the berries with this firmness." + ) class Meta: model = BerryFirmness fields = ("id", "name", "berries", "names") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + id=RESOURCE_ID_HELP, + name=RESOURCE_NAME_HELP, + ) class BerryFlavorNameSerializer(serializers.ModelSerializer[BerryFlavorName]): - language = LanguageSummarySerializer() + language = LanguageSummarySerializer(help_text=NAME_LANGUAGE_HELP) class Meta: model = BerryFlavorName fields = ("name", "language") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + name=LOCALIZED_NAME_HELP, + ) class BerryFlavorBerryMapSerializer(serializers.ModelSerializer[BerryFlavorMap]): - berry = BerrySummarySerializer() + berry = BerrySummarySerializer(help_text="The berry with the referenced flavor.") class Meta: model = BerryFlavorMap fields = ("potency", "berry") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + potency=BERRY_FLAVOR_POTENCY_HELP, + ) class BerryFlavorDetailSerializer(serializers.ModelSerializer[BerryFlavor]): - names = BerryFlavorNameSerializer(many=True, read_only=True, source="berryflavorname") - contest_type = ContestTypeSummarySerializer() - berries = serializers.SerializerMethodField("get_berries_with_flavor") + names = BerryFlavorNameSerializer( + many=True, + read_only=True, + source="berryflavorname", + help_text=LOCALIZED_NAMES_HELP, + ) + contest_type = ContestTypeSummarySerializer(help_text="The contest type that correlates with this berry flavor.") + berries = serializers.SerializerMethodField( + "get_berries_with_flavor", help_text="A list of the berries with this flavor." + ) class Meta: model = BerryFlavor fields = ("id", "name", "berries", "contest_type", "names") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + id=RESOURCE_ID_HELP, + name=RESOURCE_NAME_HELP, + ) @extend_schema_field(BerryFlavorBerryMapSerializer(many=True)) def get_berries_with_flavor(self, obj: BerryFlavor) -> ReturnList[ReturnDict[str, Any]]: @@ -1777,18 +2595,32 @@ def get_berries_with_flavor(self, obj: BerryFlavor) -> ReturnList[ReturnDict[str class BerryFlavorMapSerializer(serializers.ModelSerializer[BerryFlavorMap]): - flavor = BerryFlavorSummarySerializer(source="berry_flavor") + flavor = BerryFlavorSummarySerializer(source="berry_flavor", help_text="The referenced berry flavor.") class Meta: model = BerryFlavorMap fields = ("potency", "flavor") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + potency=BERRY_FLAVOR_POTENCY_HELP, + ) class BerryDetailSerializer(serializers.ModelSerializer[Berry]): - item = ItemSummarySerializer() - natural_gift_type = TypeSummarySerializer() - firmness = BerryFirmnessSummarySerializer(source="berry_firmness") - flavors = serializers.SerializerMethodField("get_berry_flavors") + item = ItemSummarySerializer( + help_text="Berries are actually items. This is a reference to the item specific data for this berry." + ) + natural_gift_type = TypeSummarySerializer( + allow_null=True, help_text='The type inherited by "Natural Gift" when used with this Berry.' + ) + firmness = BerryFirmnessSummarySerializer( + source="berry_firmness", + allow_null=True, + help_text="The firmness of this berry, used in making Pokéblocks or Poffins.", + ) + flavors = serializers.SerializerMethodField( + "get_berry_flavors", + help_text="A list of references to each flavor a berry can have and the potency of each of those flavors in regard to this berry.", + ) class Meta: model = Berry @@ -1806,6 +2638,16 @@ class Meta: "item", "natural_gift_type", ) + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + id=RESOURCE_ID_HELP, + name=RESOURCE_NAME_HELP, + 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.", + max_harvest="The maximum number of these berries that can grow on one tree in Generation IV.", + natural_gift_power='The power of the move "Natural Gift" when used with this Berry.', + size="The size of this Berry, in millimeters.", + smoothness="The smoothness of this Berry, used in making Pokéblocks or Poffins.", + soil_dryness="The speed at which this Berry dries out the soil as it grows. A higher rate means the soil dries more quickly.", + ) @extend_schema_field(BerryFlavorMapSerializer(many=True)) def get_berry_flavors(self, obj: Berry) -> ReturnList[ReturnDict[str, Any]]: @@ -1822,20 +2664,34 @@ def get_berry_flavors(self, obj: Berry) -> ReturnList[ReturnDict[str, Any]]: class EggGroupNameSerializer(serializers.ModelSerializer[EggGroupName]): - language = LanguageSummarySerializer() + language = LanguageSummarySerializer(help_text=NAME_LANGUAGE_HELP) class Meta: model = EggGroupName fields = ("name", "language") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + name=LOCALIZED_NAME_HELP, + ) class EggGroupDetailSerializer(serializers.ModelSerializer[EggGroup]): - names = EggGroupNameSerializer(many=True, read_only=True, source="egggroupname") - pokemon_species = serializers.SerializerMethodField("get_species") + names = EggGroupNameSerializer( + many=True, + read_only=True, + source="egggroupname", + help_text=LOCALIZED_NAMES_HELP, + ) + pokemon_species = serializers.SerializerMethodField( + "get_species", help_text="A list of all Pokémon species that are members of this egg group." + ) class Meta: model = EggGroup fields = ("id", "name", "names", "pokemon_species") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + id=RESOURCE_ID_HELP, + name=RESOURCE_NAME_HELP, + ) @extend_schema_field(PokemonSpeciesSummarySerializer(many=True)) def get_species(self, obj: EggGroup) -> ReturnList[ReturnDict[str, Any]]: @@ -1860,47 +2716,71 @@ class Meta: class TypeGameIndexSerializer(serializers.ModelSerializer[TypeGameIndex]): - generation = GenerationSummarySerializer() + generation = GenerationSummarySerializer(help_text=GAME_INDEX_GENERATION_HELP) class Meta: model = TypeGameIndex fields = ("game_index", "generation") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + game_index=GAME_INDEX_HELP, + ) class TypeNameSerializer(serializers.ModelSerializer[TypeName]): - language = LanguageSummarySerializer() + language = LanguageSummarySerializer(help_text=NAME_LANGUAGE_HELP) class Meta: model = TypeName fields = ("name", "language") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + name=LOCALIZED_NAME_HELP, + ) -class TypeSpriteSerializer(serializers.ModelSerializer[TypeSprites]): - class Meta: - model = TypeSprites - fields = ("sprites",) +class TypeGameSpriteSerializer(serializers.Serializer[Any]): + name_icon = serializers.CharField( + allow_null=True, + required=False, + help_text="The URL of the icon displaying the type name in this game, or null if unavailable.", + ) + symbol_icon = serializers.CharField( + allow_null=True, + required=False, + help_text="The URL of the type symbol icon in this game, or null if unavailable.", + ) class TypeRelationshipsSerializer(serializers.Serializer[Any]): - no_damage_to = TypeSummarySerializer(many=True) - half_damage_to = TypeSummarySerializer(many=True) - double_damage_to = TypeSummarySerializer(many=True) - no_damage_from = TypeSummarySerializer(many=True) - half_damage_from = TypeSummarySerializer(many=True) - double_damage_from = TypeSummarySerializer(many=True) + no_damage_to = TypeSummarySerializer(many=True, help_text="A list of types this type has no effect on.") + half_damage_to = TypeSummarySerializer(many=True, help_text="A list of types this type is not very effect against.") + double_damage_to = TypeSummarySerializer(many=True, help_text="A list of types this type is very effect against.") + no_damage_from = TypeSummarySerializer(many=True, help_text="A list of types that have no effect on this type.") + half_damage_from = TypeSummarySerializer( + many=True, help_text="A list of types that are not very effective against this type." + ) + double_damage_from = TypeSummarySerializer( + many=True, help_text="A list of types that are very effective against this type." + ) class TypePastRelationshipsSerializer(serializers.Serializer[Any]): - generation = GenerationSummarySerializer() - damage_relations = TypeRelationshipsSerializer() + generation = GenerationSummarySerializer( + help_text="The last generation in which the referenced type had the listed damage relations" + ) + damage_relations = TypeRelationshipsSerializer( + help_text="The damage relations the referenced type had up to and including the listed generation" + ) class TypePokemonSerializer(serializers.ModelSerializer[PokemonType]): - pokemon = PokemonSummarySerializer() + pokemon = PokemonSummarySerializer(help_text="The Pokémon that has the referenced type.") class Meta: model = PokemonType fields = ("slot", "pokemon") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + slot=POKEMON_TYPE_SLOT_HELP, + ) class TypeDetailSerializer(serializers.ModelSerializer[Type]): @@ -1908,15 +2788,39 @@ class TypeDetailSerializer(serializers.ModelSerializer[Type]): Serializer for the Type resource """ - generation = GenerationSummarySerializer() - names = TypeNameSerializer(many=True, read_only=True, source="typename") - game_indices = TypeGameIndexSerializer(many=True, read_only=True, source="typegameindex") - move_damage_class = MoveDamageClassSummarySerializer() - damage_relations = serializers.SerializerMethodField("get_type_relationships") - past_damage_relations = serializers.SerializerMethodField("get_type_past_relationships") - pokemon = serializers.SerializerMethodField("get_type_pokemon") - moves = MoveSummarySerializer(many=True, read_only=True, source="move") - sprites = serializers.SerializerMethodField("get_type_sprites") + generation = GenerationSummarySerializer(help_text="The generation this type was introduced in.") + names = TypeNameSerializer( + many=True, + read_only=True, + source="typename", + help_text=LOCALIZED_NAMES_HELP, + ) + game_indices = TypeGameIndexSerializer( + many=True, + read_only=True, + source="typegameindex", + help_text="A list of game indices relevent to this item by generation.", + ) + move_damage_class = MoveDamageClassSummarySerializer( + allow_null=True, help_text="The class of damage inflicted by this type." + ) + damage_relations = serializers.SerializerMethodField( + "get_type_relationships", help_text="A detail of how effective this type is toward others and vice versa." + ) + past_damage_relations = serializers.SerializerMethodField( + "get_type_past_relationships", + help_text="A list of details of how effective this type was toward others and vice versa in previous generations", + ) + pokemon = serializers.SerializerMethodField( + "get_type_pokemon", help_text="A list of details of Pokémon that have this type." + ) + moves = MoveSummarySerializer( + many=True, read_only=True, source="move", help_text="A list of moves that have this type." + ) + sprites = serializers.SerializerMethodField( + "get_type_sprites", + help_text="Type icons grouped by generation and game, with name_icon and symbol_icon URLs. Unavailable icons are null.", + ) FACTOR_PREFIX_MAP: ClassVar[dict[int, str]] = {200: "double", 50: "half", 0: "no"} RELATION_KEYS = ( @@ -1943,8 +2847,12 @@ class Meta: "moves", "sprites", ) + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + id=RESOURCE_ID_HELP, + name=RESOURCE_NAME_HELP, + ) - @extend_schema_field(TypeSpriteSerializer) + @extend_schema_field(serializers.DictField(child=serializers.DictField(child=TypeGameSpriteSerializer()))) def get_type_sprites(self, obj: Type) -> dict[str, str | None]: sprites_object = TypeSprites.objects.filter(type=obj).first() return sprites_object.sprites if sprites_object else {} @@ -2064,13 +2972,16 @@ def get_type_pokemon(self, obj: Type) -> ReturnList[ReturnDict[str, Any]]: class MachineDetailSerializer(serializers.ModelSerializer[Machine]): - item = ItemSummarySerializer() - version_group = VersionGroupSummarySerializer() - move = MoveSummarySerializer() + item = ItemSummarySerializer(help_text="The TM or HM item that corresponds to this machine.") + version_group = VersionGroupSummarySerializer(help_text="The version group that this machine applies to.") + move = MoveSummarySerializer(help_text="The move that is taught by this machine.") class Meta: model = Machine fields = ("id", "item", "version_group", "move") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + id=RESOURCE_ID_HELP, + ) ################################### @@ -2079,19 +2990,31 @@ class Meta: class MoveBattleStyleNameSerializer(serializers.ModelSerializer[MoveBattleStyleName]): - language = LanguageSummarySerializer() + language = LanguageSummarySerializer(help_text=NAME_LANGUAGE_HELP) class Meta: model = MoveBattleStyleName fields = ("name", "language") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + name=LOCALIZED_NAME_HELP, + ) class MoveBattleStyleDetailSerializer(serializers.ModelSerializer[MoveBattleStyle]): - names = MoveBattleStyleNameSerializer(many=True, read_only=True, source="movebattlestylename") + names = MoveBattleStyleNameSerializer( + many=True, + read_only=True, + source="movebattlestylename", + help_text=LOCALIZED_NAMES_HELP, + ) class Meta: model = MoveBattleStyle fields = ("id", "name", "names") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + id=RESOURCE_ID_HELP, + name=RESOURCE_NAME_HELP, + ) ################################### @@ -2100,25 +3023,43 @@ class Meta: class MoveDamageClassNameSerializer(serializers.ModelSerializer[MoveDamageClassName]): - language = LanguageSummarySerializer() + language = LanguageSummarySerializer(help_text=NAME_LANGUAGE_HELP) class Meta: model = MoveDamageClassName fields = ("name", "language") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + name=LOCALIZED_NAME_HELP, + ) class MoveDamageClassDescriptionSerializer(serializers.ModelSerializer[MoveDamageClassDescription]): - language = LanguageSummarySerializer() + language = LanguageSummarySerializer(help_text=NAME_LANGUAGE_HELP) class Meta: model = MoveDamageClassDescription fields = ("description", "language") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + description=LOCALIZED_DESCRIPTION_HELP, + ) class MoveDamageClassDetailSerializer(serializers.ModelSerializer[MoveDamageClass]): - names = MoveDamageClassNameSerializer(many=True, read_only=True, source="movedamageclassname") - descriptions = MoveDamageClassDescriptionSerializer(many=True, read_only=True, source="movedamageclassdescription") - moves = MoveSummarySerializer(many=True, read_only=True, source="move") + names = MoveDamageClassNameSerializer( + many=True, + read_only=True, + source="movedamageclassname", + help_text=LOCALIZED_NAMES_HELP, + ) + descriptions = MoveDamageClassDescriptionSerializer( + many=True, + read_only=True, + source="movedamageclassdescription", + help_text=LOCALIZED_DESCRIPTIONS_HELP, + ) + moves = MoveSummarySerializer( + many=True, read_only=True, source="move", help_text="A list of moves that fall into this damage class." + ) class Meta: model = MoveDamageClass @@ -2129,6 +3070,10 @@ class Meta: "moves", "names", ) + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + id=RESOURCE_ID_HELP, + name=RESOURCE_NAME_HELP, + ) ########################### @@ -2137,20 +3082,32 @@ class Meta: class MoveMetaAilmentNameSerializer(serializers.ModelSerializer[MoveMetaAilmentName]): - language = LanguageSummarySerializer() + language = LanguageSummarySerializer(help_text=NAME_LANGUAGE_HELP) class Meta: model = MoveMetaAilmentName fields = ("name", "language") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + name=LOCALIZED_NAME_HELP, + ) class MoveMetaAilmentDetailSerializer(serializers.ModelSerializer[MoveMetaAilment]): - names = MoveMetaAilmentNameSerializer(many=True, read_only=True, source="movemetaailmentname") - moves = serializers.SerializerMethodField("get_ailment_moves") + names = MoveMetaAilmentNameSerializer( + many=True, + read_only=True, + source="movemetaailmentname", + help_text=LOCALIZED_NAMES_HELP, + ) + moves = serializers.SerializerMethodField("get_ailment_moves", help_text="A list of moves that cause this ailment.") class Meta: model = MoveMetaAilment fields = ("id", "name", "moves", "names") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + id=RESOURCE_ID_HELP, + name=RESOURCE_NAME_HELP, + ) @extend_schema_field(MoveSummarySerializer(many=True)) def get_ailment_moves(self, obj: MoveMetaAilment) -> ReturnList[ReturnDict[str, Any]]: @@ -2162,22 +3119,34 @@ def get_ailment_moves(self, obj: MoveMetaAilment) -> ReturnList[ReturnDict[str, class MoveMetaCategoryDescriptionSerializer(serializers.ModelSerializer[MoveMetaCategoryDescription]): - language = LanguageSummarySerializer() + language = LanguageSummarySerializer(help_text=NAME_LANGUAGE_HELP) class Meta: model = MoveMetaCategoryDescription fields = ("description", "language") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + description=LOCALIZED_DESCRIPTION_HELP, + ) class MoveMetaCategoryDetailSerializer(serializers.ModelSerializer[MoveMetaCategory]): descriptions = MoveMetaCategoryDescriptionSerializer( - many=True, read_only=True, source="movemetacategorydescription" + many=True, + read_only=True, + source="movemetacategorydescription", + help_text=LOCALIZED_DESCRIPTIONS_HELP, + ) + moves = serializers.SerializerMethodField( + "get_category_moves", help_text="A list of moves that fall into this category." ) - moves = serializers.SerializerMethodField("get_category_moves") class Meta: model = MoveMetaCategory fields = ("id", "name", "descriptions", "moves") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + id=RESOURCE_ID_HELP, + name=RESOURCE_NAME_HELP, + ) @extend_schema_field(MoveSummarySerializer(many=True)) def get_category_moves(self, obj: MoveMetaCategory) -> ReturnList[ReturnDict[str, Any]]: @@ -2189,8 +3158,12 @@ def get_category_moves(self, obj: MoveMetaCategory) -> ReturnList[ReturnDict[str class MoveMetaSerializer(serializers.ModelSerializer[MoveMeta]): - ailment = MoveMetaAilmentSummarySerializer(source="move_meta_ailment") - category = MoveMetaCategorySummarySerializer(source="move_meta_category") + ailment = MoveMetaAilmentSummarySerializer( + source="move_meta_ailment", help_text="The status ailment this move inflicts on its target." + ) + category = MoveMetaCategorySummarySerializer( + source="move_meta_category", help_text="The category of move this move falls under, e.g. damage or ailment." + ) class Meta: model = MoveMeta @@ -2208,6 +3181,18 @@ class Meta: "flinch_chance", "stat_chance", ) + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + min_hits="The minimum number of times this move hits. Null if it always only hits once.", + max_hits="The maximum number of times this move hits. Null if it always only hits once.", + min_turns="The minimum number of turns this move continues to take effect. Null if it always only lasts one turn.", + max_turns="The maximum number of turns this move continues to take effect. Null if it always only lasts one turn.", + drain="HP drain (if positive) or Recoil damage (if negative), in percent of damage done.", + healing="The amount of hp gained by the attacking Pokemon, in percent of it's maximum HP.", + crit_rate="Critical hit rate bonus.", + ailment_chance="The likelihood this attack will cause an ailment.", + flinch_chance="The likelihood this attack will cause the target Pokémon to flinch.", + stat_chance="The likelihood this attack will cause a stat change in the target Pokémon.", + ) ############################# @@ -2216,29 +3201,51 @@ class Meta: class MoveTargetNameSerializer(serializers.ModelSerializer[MoveTargetName]): - language = LanguageSummarySerializer() + language = LanguageSummarySerializer(help_text=NAME_LANGUAGE_HELP) class Meta: model = MoveTargetName fields = ("name", "language") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + name=LOCALIZED_NAME_HELP, + ) class MoveTargetDescriptionSerializer(serializers.ModelSerializer[MoveTargetDescription]): - language = LanguageSummarySerializer() + language = LanguageSummarySerializer(help_text=NAME_LANGUAGE_HELP) class Meta: model = MoveTargetDescription fields = ("description", "language") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + description=LOCALIZED_DESCRIPTION_HELP, + ) class MoveTargetDetailSerializer(serializers.ModelSerializer[MoveTarget]): - names = MoveTargetNameSerializer(many=True, read_only=True, source="movetargetname") - descriptions = MoveTargetDescriptionSerializer(many=True, read_only=True, source="movetargetdescription") - moves = MoveSummarySerializer(many=True, read_only=True, source="move") + names = MoveTargetNameSerializer( + many=True, + read_only=True, + source="movetargetname", + help_text=LOCALIZED_NAMES_HELP, + ) + descriptions = MoveTargetDescriptionSerializer( + many=True, + read_only=True, + source="movetargetdescription", + help_text=LOCALIZED_DESCRIPTIONS_HELP, + ) + moves = MoveSummarySerializer( + many=True, read_only=True, source="move", help_text="A list of moves that that are directed at this target." + ) class Meta: model = MoveTarget fields = ("id", "name", "descriptions", "moves", "names") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + id=RESOURCE_ID_HELP, + name=RESOURCE_NAME_HELP, + ) ###################### @@ -2247,26 +3254,41 @@ class Meta: class MoveNameSerializer(serializers.ModelSerializer[MoveName]): - language = LanguageSummarySerializer() + language = LanguageSummarySerializer(help_text=NAME_LANGUAGE_HELP) class Meta: model = MoveName fields = ("name", "language") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + name=LOCALIZED_NAME_HELP, + ) class MoveEffectEffectTextSerializer(serializers.ModelSerializer[MoveEffectEffectText]): - language = LanguageSummarySerializer() + language = LanguageSummarySerializer(help_text=EFFECT_LANGUAGE_HELP) class Meta: model = MoveEffectEffectText fields = ("effect", "short_effect", "language") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + effect=LOCALIZED_EFFECT_HELP, + short_effect=LOCALIZED_SHORT_EFFECT_HELP, + ) class MoveChangeSerializer(serializers.ModelSerializer[MoveChange]): - version_group = VersionGroupSummarySerializer() - type = TypeSummarySerializer() - effect_entries = serializers.SerializerMethodField("get_effects") - effect_chance = serializers.IntegerField(source="move_effect_chance") + version_group = VersionGroupSummarySerializer( + help_text="The version group in which these move stat values were in effect." + ) + type = TypeSummarySerializer(allow_null=True, help_text="The elemental type of this move.") + effect_entries = serializers.SerializerMethodField( + "get_effects", help_text="The effect of this move listed in different languages." + ) + effect_chance = serializers.IntegerField( + source="move_effect_chance", + allow_null=True, + help_text="The percent value of how likely it is this moves effect will take effect.", + ) class Meta: model = MoveChange @@ -2279,6 +3301,11 @@ class Meta: "type", "version_group", ) + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + accuracy=MOVE_ACCURACY_HELP, + power="The base power before the listed version group, or null if power did not change.", + pp=MOVE_PP_HELP, + ) @extend_schema_field(MoveEffectEffectTextSerializer(many=True)) def get_effects(self, obj: MoveChange) -> ReturnList[ReturnDict[str, Any]]: @@ -2290,17 +3317,25 @@ def get_effects(self, obj: MoveChange) -> ReturnList[ReturnDict[str, Any]]: class MoveEffectChangeEffectTextSerializer(serializers.ModelSerializer[MoveEffectChangeEffectText]): - language = LanguageSummarySerializer() + language = LanguageSummarySerializer(help_text=EFFECT_LANGUAGE_HELP) class Meta: model = MoveEffectChangeEffectText fields = ("effect", "language") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + effect=LOCALIZED_EFFECT_HELP, + ) class MoveEffectChangeSerializer(serializers.ModelSerializer[MoveEffectChange]): - version_group = VersionGroupSummarySerializer() + version_group = VersionGroupSummarySerializer( + help_text="The version group in which the previous effect of this ability originated." + ) effect_entries = MoveEffectChangeEffectTextSerializer( - many=True, read_only=True, source="moveeffectchangeeffecttext" + many=True, + read_only=True, + source="moveeffectchangeeffecttext", + help_text="The previous effect of this ability listed in different languages.", ) class Meta: @@ -2309,9 +3344,11 @@ class Meta: class MoveFlavorTextSerializer(serializers.ModelSerializer[MoveFlavorText]): - flavor_text = serializers.CharField() - language = LanguageSummarySerializer() - version_group = VersionGroupSummarySerializer() + flavor_text = serializers.CharField( + help_text="The localized flavor text for an api resource in a specific language." + ) + language = LanguageSummarySerializer(help_text=NAME_LANGUAGE_HELP) + version_group = VersionGroupSummarySerializer(help_text="The version group that uses this flavor text.") class Meta: model = MoveFlavorText @@ -2319,42 +3356,89 @@ class Meta: class MoveComboUsageSerializer(serializers.Serializer[Any]): - use_before = MoveSummarySerializer(many=True, allow_null=True) - use_after = MoveSummarySerializer(many=True, allow_null=True) + use_before = MoveSummarySerializer(many=True, allow_null=True, help_text="A list of moves to use before this move.") + use_after = MoveSummarySerializer(many=True, allow_null=True, help_text="A list of moves to use after this move.") class MoveCombosSerializer(serializers.Serializer[Any]): - normal = MoveComboUsageSerializer() - super = MoveComboUsageSerializer() + normal = MoveComboUsageSerializer( + help_text="A detail of moves this move can be used before or after, granting additional appeal points in contests." + ) + super = MoveComboUsageSerializer( + help_text="A detail of moves this move can be used before or after, granting additional appeal points in super contests." + ) class MoveMetaStatChangeSerializer(serializers.ModelSerializer[MoveMetaStatChange]): - stat = StatSummarySerializer() + stat = StatSummarySerializer(help_text="The stat being affected.") class Meta: model = MoveMetaStatChange fields = ("change", "stat") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + change="The amount of change.", + ) class MoveDetailSerializer(serializers.ModelSerializer[Move]): - generation = GenerationSummarySerializer() - type = TypeSummarySerializer() - target = MoveTargetSummarySerializer(source="move_target") - contest_type = ContestTypeSummarySerializer() - contest_effect = ContestEffectSummarySerializer() - damage_class = MoveDamageClassSummarySerializer(source="move_damage_class") - meta = MoveMetaSerializer(read_only=True, source="movemeta") - names = MoveNameSerializer(many=True, read_only=True, source="movename") - effect_entries = serializers.SerializerMethodField("get_effect_text") - effect_chance = serializers.IntegerField(source="move_effect_chance") - contest_combos = serializers.SerializerMethodField("get_combos") - stat_changes = serializers.SerializerMethodField("get_move_stat_change") - super_contest_effect = SuperContestEffectSummarySerializer() - past_values = MoveChangeSerializer(many=True, read_only=True, source="movechange") - effect_changes = serializers.SerializerMethodField("get_effect_change_text") - machines = serializers.SerializerMethodField("get_move_machines") - flavor_text_entries = MoveFlavorTextSerializer(many=True, read_only=True, source="moveflavortext") - learned_by_pokemon = serializers.SerializerMethodField() + generation = GenerationSummarySerializer(help_text="The generation in which this move was introduced.") + type = TypeSummarySerializer(help_text="The elemental type of this move.") + target = MoveTargetSummarySerializer( + source="move_target", help_text="The type of target that will receive the effects of the attack." + ) + contest_type = ContestTypeSummarySerializer( + allow_null=True, help_text="The type of appeal this move gives a Pokémon when used in a contest." + ) + contest_effect = ContestEffectSummarySerializer( + allow_null=True, help_text="The effect the move has when used in a contest." + ) + damage_class = MoveDamageClassSummarySerializer( + source="move_damage_class", help_text="The type of damage the move inflicts on the target, e.g. physical." + ) + meta = MoveMetaSerializer(read_only=True, source="movemeta", allow_null=True, help_text="Metadata about this move") + names = MoveNameSerializer( + many=True, + read_only=True, + source="movename", + help_text=LOCALIZED_NAMES_HELP, + ) + effect_entries = serializers.SerializerMethodField( + "get_effect_text", help_text="The effect of this move listed in different languages." + ) + effect_chance = serializers.IntegerField( + source="move_effect_chance", + allow_null=True, + help_text="The percent value of how likely it is this moves effect will happen.", + ) + contest_combos = serializers.SerializerMethodField( + "get_combos", help_text="A detail of normal and super contest combos that require this move." + ) + stat_changes = serializers.SerializerMethodField( + "get_move_stat_change", help_text="A list of stats this moves effects and how much it effects them." + ) + super_contest_effect = SuperContestEffectSummarySerializer( + allow_null=True, help_text="The effect the move has when used in a super contest." + ) + past_values = MoveChangeSerializer( + many=True, + read_only=True, + source="movechange", + help_text="A list of move resource value changes across version groups of the game.", + ) + effect_changes = serializers.SerializerMethodField( + "get_effect_change_text", + help_text="The list of previous effects this move has had across version groups of the games.", + ) + machines = serializers.SerializerMethodField( + "get_move_machines", help_text="A list of the machines that teach this move." + ) + flavor_text_entries = MoveFlavorTextSerializer( + many=True, + read_only=True, + source="moveflavortext", + help_text="The flavor text of this move listed in different languages.", + ) + learned_by_pokemon = serializers.SerializerMethodField(help_text="List of Pokemon that can learn the move") class Meta: model = Move @@ -2384,6 +3468,14 @@ class Meta: "flavor_text_entries", "learned_by_pokemon", ) + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + id=RESOURCE_ID_HELP, + name=RESOURCE_NAME_HELP, + accuracy=MOVE_ACCURACY_HELP, + pp=MOVE_PP_HELP, + 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.", + power="The base power of this move, or null if it has no fixed base power.", + ) @extend_schema_field(PokemonSummarySerializer(many=True)) def get_learned_by_pokemon(self, obj: Move) -> ReturnList[ReturnDict[str, Any]]: @@ -2477,28 +3569,46 @@ def get_move_stat_change(self, obj: Move) -> ReturnList[ReturnDict[str, Any]]: class PalParkAreaNameSerializer(serializers.HyperlinkedModelSerializer[PalParkAreaName]): - language = LanguageSummarySerializer() + language = LanguageSummarySerializer(help_text=NAME_LANGUAGE_HELP) class Meta: model = PalParkAreaName fields = ("name", "language") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + name=LOCALIZED_NAME_HELP, + ) class PalParkEncounterSerializer(serializers.ModelSerializer[PalPark]): - pokemon_species = PokemonSpeciesSummarySerializer() + pokemon_species = PokemonSpeciesSummarySerializer(help_text="The Pokémon species being encountered.") class Meta: model = PalPark fields = ("base_score", "rate", "pokemon_species") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + base_score="The base score given to the player when this Pokémon is caught during a pal park run.", + rate="The base rate for encountering this Pokémon in this pal park area.", + ) class PalParkAreaDetailSerializer(serializers.ModelSerializer[PalParkArea]): - names = PalParkAreaNameSerializer(many=True, read_only=True, source="palparkareaname") - pokemon_encounters = serializers.SerializerMethodField("get_encounters") + names = PalParkAreaNameSerializer( + many=True, + read_only=True, + source="palparkareaname", + help_text=LOCALIZED_NAMES_HELP, + ) + pokemon_encounters = serializers.SerializerMethodField( + "get_encounters", help_text="A list of Pokémon encountered in thi pal park area along with details." + ) class Meta: model = PalParkArea fields = ("id", "name", "names", "pokemon_encounters") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + id=RESOURCE_ID_HELP, + name=RESOURCE_NAME_HELP, + ) @extend_schema_field(PalParkEncounterSerializer(many=True)) def get_encounters(self, obj: PalParkArea) -> ReturnList[ReturnDict[str, Any]]: @@ -2516,20 +3626,37 @@ def get_encounters(self, obj: PalParkArea) -> ReturnList[ReturnDict[str, Any]]: class PokemonColorNameSerializer(serializers.HyperlinkedModelSerializer[PokemonColorName]): - language = LanguageSummarySerializer() + language = LanguageSummarySerializer(help_text=NAME_LANGUAGE_HELP) class Meta: model = PokemonColorName fields = ("name", "language") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + name=LOCALIZED_NAME_HELP, + ) class PokemonColorDetailSerializer(serializers.ModelSerializer[PokemonColor]): - names = PokemonColorNameSerializer(many=True, read_only=True, source="pokemoncolorname") - pokemon_species = PokemonSpeciesSummarySerializer(many=True, read_only=True, source="pokemonspecies") + names = PokemonColorNameSerializer( + many=True, + read_only=True, + source="pokemoncolorname", + help_text=LOCALIZED_NAMES_HELP, + ) + pokemon_species = PokemonSpeciesSummarySerializer( + many=True, + read_only=True, + source="pokemonspecies", + help_text="A list of the Pokémon species that have this color.", + ) class Meta: model = PokemonColor fields = ("id", "name", "names", "pokemon_species") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + id=RESOURCE_ID_HELP, + name=RESOURCE_NAME_HELP, + ) ############################## @@ -2537,10 +3664,136 @@ class Meta: ############################## -class PokemonFormSpritesSerializer(serializers.ModelSerializer[PokemonFormSprites]): - class Meta: - model = PokemonFormSprites - fields = ("sprites",) +class PokemonSpritesOtherDreamWorldSerializer(serializers.Serializer[Any]): + front_default = serializers.CharField( + allow_null=True, + help_text="The URL of the default Pokémon Dream World front image, or null if unavailable.", + ) + front_female = serializers.CharField( + allow_null=True, + help_text="The URL of the female Pokémon Dream World front image, or null if unavailable.", + ) + + +class PokemonSpritesOtherHomeSerializer(serializers.Serializer[Any]): + front_default = serializers.CharField( + allow_null=True, + help_text="The URL of the default Pokémon HOME front image, or null if unavailable.", + ) + front_female = serializers.CharField( + allow_null=True, + help_text="The URL of the female Pokémon HOME front image, or null if unavailable.", + ) + front_shiny = serializers.CharField( + allow_null=True, + help_text="The URL of the shiny Pokémon HOME front image, or null if unavailable.", + ) + front_shiny_female = serializers.CharField( + allow_null=True, + help_text="The URL of the shiny female Pokémon HOME front image, or null if unavailable.", + ) + + +class PokemonSpritesOtherOfficialArtworkSerializer(serializers.Serializer[Any]): + front_default = serializers.CharField( + allow_null=True, + help_text="The URL of the default front official artwork, or null if unavailable.", + ) + front_shiny = serializers.CharField( + allow_null=True, + help_text="The URL of the shiny front official artwork, or null if unavailable.", + ) + versions = serializers.DictField( + child=serializers.DictField(child=serializers.JSONField()), + required=False, + help_text="Additional official artwork grouped by version. Available keys vary by resource.", + ) + + +class PokemonSpritesOtherShowdownSerializer(serializers.Serializer[Any]): + front_default = serializers.CharField( + allow_null=True, + help_text="The URL of the default Pokémon Showdown front image, or null if unavailable.", + ) + front_female = serializers.CharField( + allow_null=True, + help_text="The URL of the female Pokémon Showdown front image, or null if unavailable.", + ) + front_shiny = serializers.CharField( + allow_null=True, + help_text="The URL of the shiny Pokémon Showdown front image, or null if unavailable.", + ) + front_shiny_female = serializers.CharField( + allow_null=True, + help_text="The URL of the shiny female Pokémon Showdown front image, or null if unavailable.", + ) + back_default = serializers.CharField( + allow_null=True, + help_text="The URL of the default Pokémon Showdown back image, or null if unavailable.", + ) + back_female = serializers.CharField( + allow_null=True, + help_text="The URL of the female Pokémon Showdown back image, or null if unavailable.", + ) + back_shiny = serializers.CharField( + allow_null=True, + help_text="The URL of the shiny Pokémon Showdown back image, or null if unavailable.", + ) + back_shiny_female = serializers.CharField( + allow_null=True, + help_text="The URL of the shiny female Pokémon Showdown back image, or null if unavailable.", + ) + + +class PokemonSpritesOtherSerializer(serializers.Serializer[Any]): + dream_world = PokemonSpritesOtherDreamWorldSerializer(required=False, help_text="Pokémon Dream World artwork URLs.") + home = PokemonSpritesOtherHomeSerializer(required=False, help_text="Pokémon HOME sprite URLs.") + showdown = PokemonSpritesOtherShowdownSerializer(required=False, help_text="Pokémon Showdown sprite URLs.") + + +PokemonSpritesOtherSerializer._declared_fields["official-artwork"] = PokemonSpritesOtherOfficialArtworkSerializer( + required=False, help_text="Official Pokémon artwork URLs, including shiny artwork and version-specific variants." +) + + +class PokemonSpritesSerializer(serializers.Serializer[Any]): + front_default = serializers.CharField( + allow_null=True, help_text="The default depiction of this Pokémon from the front in battle." + ) + front_shiny = serializers.CharField( + allow_null=True, help_text="The shiny depiction of this Pokémon from the front in battle." + ) + front_female = serializers.CharField( + allow_null=True, help_text="The female depiction of this Pokémon from the front in battle." + ) + front_shiny_female = serializers.CharField( + allow_null=True, help_text="The shiny female depiction of this Pokémon from the front in battle." + ) + back_default = serializers.CharField( + allow_null=True, help_text="The default depiction of this Pokémon from the back in battle." + ) + back_shiny = serializers.CharField( + allow_null=True, help_text="The shiny depiction of this Pokémon from the back in battle." + ) + back_female = serializers.CharField( + allow_null=True, help_text="The female depiction of this Pokémon from the back in battle." + ) + back_shiny_female = serializers.CharField( + allow_null=True, help_text="The shiny female depiction of this Pokémon from the back in battle." + ) + other = PokemonSpritesOtherSerializer( + required=False, + help_text="Additional sprites grouped by source, such as official artwork, HOME, and Showdown. Available keys vary by resource.", + ) + versions = serializers.DictField( + child=serializers.DictField(child=serializers.JSONField()), + required=False, + help_text="Sprites grouped by generation and game. Available keys vary by resource.", + ) + + +class PokemonFormSpritesSerializer(PokemonSpritesSerializer): + pass class PokemonFormConditionSerializer(serializers.ModelSerializer[PokemonFormCondition]): @@ -2556,54 +3809,81 @@ class Meta: class PokemonFormNameSerializer(serializers.ModelSerializer[PokemonFormName]): - language = LanguageSummarySerializer() + language = LanguageSummarySerializer(help_text=NAME_LANGUAGE_HELP) class Meta: model = PokemonFormName fields = ("name", "language") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + name=LOCALIZED_NAME_HELP, + ) class PokemonFormTypeSerializer(serializers.ModelSerializer[PokemonFormType]): - type = TypeSummarySerializer() + type = TypeSummarySerializer(help_text="The type the referenced Form has.") class Meta: model = PokemonFormType fields = ("slot", "type") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + slot=POKEMON_TYPE_SLOT_HELP, + ) class PokemonTypeSerializer(serializers.ModelSerializer[PokemonType]): - type = TypeSummarySerializer() + type = TypeSummarySerializer(help_text="The type the referenced Pokémon has.") class Meta: model = PokemonType fields = ("slot", "type") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + slot=POKEMON_TYPE_SLOT_HELP, + ) class PokemonFormTriggerConditionSerializer(serializers.Serializer[Any]): - trigger = serializers.CharField() - base_form = PokemonFormSummarySerializer() + trigger = serializers.CharField(help_text="The trigger for this form change.") + name = serializers.CharField( + required=False, + help_text="The name of the required item, ability, or move. Only present for a resource-based trigger.", + ) + url = serializers.URLField( + required=False, + help_text="The URL of the required item, ability, or move. Only present for a resource-based trigger.", + ) + base_form = PokemonFormSummarySerializer( + required=False, help_text="The required base form. Only present when the trigger specifies one." + ) class PokemonShapeNameSerializer(serializers.ModelSerializer[PokemonShapeName]): - language = LanguageSummarySerializer() + language = LanguageSummarySerializer(help_text=NAME_LANGUAGE_HELP) class Meta: model = PokemonShapeName fields = ("name", "language") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + name=LOCALIZED_NAME_HELP, + ) class PokemonShapeAwesomeNameSerializer(serializers.ModelSerializer[PokemonShapeName]): - language = LanguageSummarySerializer() + language = LanguageSummarySerializer(help_text='The language this "scientific" name is in.') class Meta: model = PokemonShapeName fields = ("awesome_name", "language") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + awesome_name='The localized "scientific" name for an API resource in a specific language.', + ) class PokemonFormFlavorTextSerializer(serializers.ModelSerializer[PokemonFormFlavorText]): - flavor_text = serializers.CharField() - language = LanguageSummarySerializer() - version = VersionSummarySerializer() + flavor_text = serializers.CharField( + help_text="The localized flavor text for an API resource in a specific language. Note that this text is left unprocessed as it is found in game files. This means that it contains special characters that one might want to replace with their visible decodable version. Please check out this issue to find out more. " + ) + language = LanguageSummarySerializer(help_text=NAME_LANGUAGE_HELP) + version = VersionSummarySerializer(help_text="The game version this flavor text is extracted from.") class Meta: model = PokemonFormFlavorText @@ -2611,14 +3891,32 @@ class Meta: class PokemonFormDetailSerializer(serializers.ModelSerializer[PokemonForm]): - pokemon = PokemonSummarySerializer() - version_group = VersionGroupSummarySerializer() - sprites = serializers.SerializerMethodField("get_pokemon_form_sprites") - form_names = serializers.SerializerMethodField("get_pokemon_form_names") - names = serializers.SerializerMethodField("get_pokemon_form_pokemon_names") - types = serializers.SerializerMethodField("get_pokemon_form_types") - trigger_conditions = serializers.SerializerMethodField("get_pokemon_form_triggers_conditions") - flavor_text_entries = PokemonFormFlavorTextSerializer(many=True, read_only=True, source="pokemonformflavortext") + pokemon = PokemonSummarySerializer(help_text="The Pokémon that can take on this form.") + version_group = VersionGroupSummarySerializer(help_text="The version group this Pokémon form was introduced in.") + sprites = serializers.SerializerMethodField( + "get_pokemon_form_sprites", help_text="A set of sprites used to depict this Pokémon form in the game." + ) + form_names = serializers.SerializerMethodField( + "get_pokemon_form_names", + help_text="The form specific form name of this Pokémon form, or empty if the form does not have a specific name.", + ) + names = serializers.SerializerMethodField( + "get_pokemon_form_pokemon_names", + help_text="The form specific full name of this Pokémon form, or empty if the form does not have a specific name.", + ) + types = serializers.SerializerMethodField( + "get_pokemon_form_types", help_text="A list of details showing types this Pokémon form has." + ) + trigger_conditions = serializers.SerializerMethodField( + "get_pokemon_form_triggers_conditions", + help_text="The conditions that trigger this form. Resource names and URLs are included when the trigger requires a resource.", + ) + flavor_text_entries = PokemonFormFlavorTextSerializer( + many=True, + read_only=True, + source="pokemonformflavortext", + help_text="The flavor text of this form listed in different languages and versions.", + ) class Meta: model = PokemonForm @@ -2640,6 +3938,16 @@ class Meta: "trigger_conditions", "flavor_text_entries", ) + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + id=RESOURCE_ID_HELP, + name=RESOURCE_NAME_HELP, + 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.", + form_order="The order in which forms should be sorted within a species' forms.", + is_default="True for exactly one form used as the default for each Pokémon.", + is_battle_only="Whether or not this form can only happen during battle.", + is_mega="Whether or not this form requires mega evolution.", + form_name="The name of this form.", + ) @extend_schema_field(PokemonFormNameSerializer(many=True)) def get_pokemon_form_names(self, obj: PokemonForm) -> ReturnList[ReturnDict[str, Any]]: @@ -2716,20 +4024,37 @@ def get_pokemon_form_triggers_conditions(self, obj: PokemonForm) -> list[dict[st class PokemonHabitatNameSerializer(serializers.HyperlinkedModelSerializer[PokemonHabitatName]): - language = LanguageSummarySerializer() + language = LanguageSummarySerializer(help_text=NAME_LANGUAGE_HELP) class Meta: model = PokemonHabitatName fields = ("name", "language") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + name=LOCALIZED_NAME_HELP, + ) class PokemonHabitatDetailSerializer(serializers.ModelSerializer[PokemonHabitat]): - names = PokemonHabitatNameSerializer(many=True, read_only=True, source="pokemonhabitatname") - pokemon_species = PokemonSpeciesSummarySerializer(many=True, read_only=True, source="pokemonspecies") + names = PokemonHabitatNameSerializer( + many=True, + read_only=True, + source="pokemonhabitatname", + help_text=LOCALIZED_NAMES_HELP, + ) + pokemon_species = PokemonSpeciesSummarySerializer( + many=True, + read_only=True, + source="pokemonspecies", + help_text="A list of the Pokémon species that can be found in this habitat.", + ) class Meta: model = PokemonHabitat fields = ("id", "name", "names", "pokemon_species") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + id=RESOURCE_ID_HELP, + name=RESOURCE_NAME_HELP, + ) ############################## @@ -2738,29 +4063,52 @@ class Meta: class MoveLearnMethodNameSerializer(serializers.HyperlinkedModelSerializer[MoveLearnMethodName]): - language = LanguageSummarySerializer() + language = LanguageSummarySerializer(help_text=NAME_LANGUAGE_HELP) class Meta: model = MoveLearnMethodName fields = ("name", "language") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + name=LOCALIZED_NAME_HELP, + ) class MoveLearnMethodDescriptionSerializer(serializers.HyperlinkedModelSerializer[MoveLearnMethodDescription]): - language = LanguageSummarySerializer() + language = LanguageSummarySerializer(help_text=NAME_LANGUAGE_HELP) class Meta: model = MoveLearnMethodDescription fields = ("description", "language") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + description=LOCALIZED_DESCRIPTION_HELP, + ) class MoveLearnMethodDetailSerializer(serializers.ModelSerializer[MoveLearnMethod]): - names = MoveLearnMethodNameSerializer(many=True, read_only=True, source="movelearnmethodname") - descriptions = MoveLearnMethodDescriptionSerializer(many=True, read_only=True, source="movelearnmethoddescription") - version_groups = serializers.SerializerMethodField("get_method_version_groups") + names = MoveLearnMethodNameSerializer( + many=True, + read_only=True, + source="movelearnmethodname", + help_text=LOCALIZED_NAMES_HELP, + ) + descriptions = MoveLearnMethodDescriptionSerializer( + many=True, + read_only=True, + source="movelearnmethoddescription", + help_text=LOCALIZED_DESCRIPTIONS_HELP, + ) + version_groups = serializers.SerializerMethodField( + "get_method_version_groups", + help_text="A list of version groups where moves can be learned through this method.", + ) class Meta: model = MoveLearnMethod fields = ("id", "name", "names", "descriptions", "version_groups") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + id=RESOURCE_ID_HELP, + name=RESOURCE_NAME_HELP, + ) @extend_schema_field(VersionGroupSummarySerializer(many=True)) def get_method_version_groups(self, obj: MoveLearnMethod) -> ReturnList[ReturnDict[str, Any]]: @@ -2777,13 +4125,25 @@ def get_method_version_groups(self, obj: MoveLearnMethod) -> ReturnList[ReturnDi class PokemonShapeDetailSerializer(serializers.ModelSerializer[PokemonShape]): - names = serializers.SerializerMethodField("get_shape_names") - awesome_names = serializers.SerializerMethodField("get_shape_awesome_names") - pokemon_species = PokemonSpeciesSummarySerializer(many=True, read_only=True, source="pokemonspecies") + names = serializers.SerializerMethodField("get_shape_names", help_text=LOCALIZED_NAMES_HELP) + awesome_names = serializers.SerializerMethodField( + "get_shape_awesome_names", + help_text='The "scientific" name of this Pokémon shape listed in different languages.', + ) + pokemon_species = PokemonSpeciesSummarySerializer( + many=True, + read_only=True, + source="pokemonspecies", + help_text="A list of the Pokémon species that have this shape.", + ) class Meta: model = PokemonShape fields = ("id", "name", "awesome_names", "names", "pokemon_species") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + id=RESOURCE_ID_HELP, + name=RESOURCE_NAME_HELP, + ) @extend_schema_field(PokemonShapeNameSerializer(many=True)) def get_shape_names(self, obj: PokemonShape) -> ReturnList[ReturnDict[str, Any]]: @@ -2818,133 +4178,218 @@ def get_shape_awesome_names(self, obj: PokemonShape) -> ReturnList[ReturnDict[st class PokemonGameIndexSerializer(serializers.ModelSerializer[PokemonGameIndex]): - version = VersionSummarySerializer() + version = VersionSummarySerializer(help_text="The version relevent to this game index.") class Meta: model = PokemonGameIndex fields = ("game_index", "version") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + game_index=GAME_INDEX_HELP, + ) class PokemonAbilitySerializer(serializers.ModelSerializer[PokemonAbility]): - ability = AbilitySummarySerializer() + ability = AbilitySummarySerializer(help_text="The ability the Pokémon may have.") class Meta: model = PokemonAbility fields = ("is_hidden", "slot", "ability") - - -class PokemonSpritesSerializer(serializers.Serializer[Any]): - front_default = serializers.CharField(allow_null=True) + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + is_hidden=POKEMON_ABILITY_HIDDEN_HELP, + slot=POKEMON_ABILITY_SLOT_HELP, + ) class PokemonCriesSerializer(serializers.Serializer[Any]): - latest = serializers.CharField(allow_null=True) - legacy = serializers.CharField(allow_null=True) + latest = serializers.CharField(allow_null=True, help_text="The latest depiction of this Pokémon's cry.") + legacy = serializers.CharField(allow_null=True, help_text="The legacy depiction of this Pokémon's cry.") class PokemonMoveVersionGroupSerializer(serializers.Serializer[Any]): - level_learned_at = serializers.IntegerField() - move_learn_method = MoveLearnMethodSummarySerializer() - version_group = VersionGroupSummarySerializer() - order = serializers.IntegerField(required=False) + level_learned_at = serializers.IntegerField(help_text="The minimum level to learn the move.") + move_learn_method = MoveLearnMethodSummarySerializer(help_text="The method by which the move is learned.") + version_group = VersionGroupSummarySerializer(help_text="The version group in which the move is learned.") + order = serializers.IntegerField( + allow_null=True, + required=False, + help_text="Order by which the pokemon will learn the move. A newly learnt move will replace the move with lowest order.", + ) class PokemonMoveSerializer(serializers.Serializer[Any]): - move = MoveSummarySerializer() - version_group_details = PokemonMoveVersionGroupSerializer(many=True) + move = MoveSummarySerializer(help_text="The move the Pokémon can learn.") + version_group_details = PokemonMoveVersionGroupSerializer( + many=True, help_text="The details of the version in which the Pokémon can learn the move." + ) class PokemonAbilityPastSerializer(serializers.ModelSerializer[PokemonAbilityPast]): - ability = AbilitySummarySerializer() + ability = AbilitySummarySerializer(allow_null=True, help_text="The ability the Pokémon may have.") class Meta: model = PokemonAbilityPast fields = ("is_hidden", "slot", "ability") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + is_hidden=POKEMON_ABILITY_HIDDEN_HELP, + slot=POKEMON_ABILITY_SLOT_HELP, + ) class PokemonPastAbilitySerializer(serializers.Serializer[Any]): - abilities = PokemonAbilityPastSerializer(many=True) - generation = GenerationSummarySerializer() + abilities = PokemonAbilityPastSerializer( + many=True, + help_text="The abilities the referenced pokémon had up to and including the listed generation. If null, the slot was previously empty.", + ) + generation = GenerationSummarySerializer( + help_text="The last generation in which the referenced pokémon had the listed abilities." + ) class PokemonStatSerializer(serializers.ModelSerializer[PokemonStat]): - stat = StatSummarySerializer() + stat = StatSummarySerializer(help_text="The stat the Pokémon has.") class Meta: model = PokemonStat fields = ("base_stat", "effort", "stat") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + base_stat=POKEMON_BASE_STAT_HELP, + effort=POKEMON_EFFORT_HELP, + ) class PokemonPastStatSerializer(serializers.Serializer[Any]): - generation = GenerationSummarySerializer() - stats = PokemonStatSerializer(many=True) + generation = GenerationSummarySerializer( + help_text="The last generation in which the referenced pokémon had the listed stats." + ) + stats = PokemonStatSerializer( + many=True, help_text="The stat the Pokémon had up to and including the listed generation." + ) class PokemonPastTypeSerializer(serializers.Serializer[Any]): - generation = GenerationSummarySerializer() - types = TypePokemonSerializer(many=True) + generation = GenerationSummarySerializer( + help_text="The last generation in which the referenced pokémon had the listed types." + ) + types = PokemonTypeSerializer( + many=True, help_text="The types the referenced pokémon had up to and including the listed generation." + ) class PokemonSpeciesNameSerializer(serializers.ModelSerializer[PokemonSpeciesName]): - language = LanguageSummarySerializer() + language = LanguageSummarySerializer(help_text=NAME_LANGUAGE_HELP) class Meta: model = PokemonSpeciesName fields = ("name", "language") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + name=LOCALIZED_NAME_HELP, + ) class PokemonSpeciesGenusSerializer(serializers.ModelSerializer[PokemonSpeciesName]): - language = LanguageSummarySerializer() + language = LanguageSummarySerializer(help_text="The language this genus is in.") class Meta: model = PokemonSpeciesName fields = ("genus", "language") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + genus="The localized genus for the referenced Pokémon species", + ) class PokemonSpeciesVarietySerializer(serializers.Serializer[Any]): - is_default = serializers.BooleanField() - pokemon = PokemonSummarySerializer() + is_default = serializers.BooleanField(help_text="Whether this variety is the default variety.") + pokemon = PokemonSummarySerializer(help_text="The Pokémon variety.") class PokemonSpeciesPalParkEncounterSerializer(serializers.ModelSerializer[PalPark]): - area = PalParkAreaSummarySerializer(source="pal_park_area") + area = PalParkAreaSummarySerializer( + source="pal_park_area", help_text="The pal park area where this encounter happens." + ) class Meta: model = PalPark fields = ("base_score", "rate", "area") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + base_score="The base score given to the player when the referenced Pokémon is caught during a pal park run.", + rate="The base rate for encountering the referenced Pokémon in this pal park area.", + ) class PokemonStatPastSerializer(serializers.ModelSerializer[PokemonStatPast]): - stat = StatSummarySerializer() + stat = StatSummarySerializer(help_text="The stat the Pokémon has.") class Meta: model = PokemonStatPast fields = ("base_stat", "effort", "stat") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + base_stat=POKEMON_BASE_STAT_HELP, + effort=POKEMON_EFFORT_HELP, + ) class PokemonTypePastSerializer(serializers.ModelSerializer[PokemonTypePast]): - type = TypeSummarySerializer() + type = TypeSummarySerializer(help_text="The type the referenced Pokémon has.") class Meta: model = PokemonTypePast fields = ("slot", "type") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + slot=POKEMON_TYPE_SLOT_HELP, + ) class PokemonDetailSerializer(serializers.ModelSerializer[Pokemon]): - abilities = serializers.SerializerMethodField("get_pokemon_abilities") - past_abilities = serializers.SerializerMethodField("get_past_pokemon_abilities") - game_indices = PokemonGameIndexSerializer(many=True, read_only=True, source="pokemongameindex") - moves = serializers.SerializerMethodField("get_pokemon_moves") - species = PokemonSpeciesSummarySerializer(source="pokemon_species") - stats = PokemonStatSerializer(many=True, read_only=True, source="pokemonstat") - past_stats = serializers.SerializerMethodField("get_past_pokemon_stats") - types = serializers.SerializerMethodField("get_pokemon_types") - past_types = serializers.SerializerMethodField("get_past_pokemon_types") - forms = PokemonFormSummarySerializer(many=True, read_only=True, source="pokemonform") - held_items = serializers.SerializerMethodField("get_pokemon_held_items") - location_area_encounters = serializers.SerializerMethodField("get_encounters") - sprites = serializers.SerializerMethodField("get_pokemon_sprites") - cries = serializers.SerializerMethodField("get_pokemon_cries") + abilities = serializers.SerializerMethodField( + "get_pokemon_abilities", help_text="A list of abilities this Pokémon could potentially have." + ) + past_abilities = serializers.SerializerMethodField( + "get_past_pokemon_abilities", + help_text="A list of details showing abilities this pokémon had in previous generations", + ) + game_indices = PokemonGameIndexSerializer( + many=True, + read_only=True, + source="pokemongameindex", + help_text="A list of game indices relevent to Pokémon item by generation.", + ) + moves = serializers.SerializerMethodField( + "get_pokemon_moves", + help_text="A list of moves along with learn methods and level details pertaining to specific version groups.", + ) + species = PokemonSpeciesSummarySerializer( + source="pokemon_species", help_text="The species this Pokémon belongs to." + ) + stats = PokemonStatSerializer( + many=True, read_only=True, source="pokemonstat", help_text="A list of base stat values for this Pokémon." + ) + past_stats = serializers.SerializerMethodField( + "get_past_pokemon_stats", help_text="A list of details showing stats this pokémon had in previous generations" + ) + types = serializers.SerializerMethodField( + "get_pokemon_types", help_text="A list of details showing types this Pokémon has." + ) + past_types = serializers.SerializerMethodField( + "get_past_pokemon_types", help_text="A list of details showing types this pokémon had in previous generations" + ) + forms = PokemonFormSummarySerializer( + many=True, read_only=True, source="pokemonform", help_text="A list of forms this Pokémon can take on." + ) + held_items = serializers.SerializerMethodField( + "get_pokemon_held_items", help_text="A list of items this Pokémon may be holding when encountered." + ) + location_area_encounters = serializers.SerializerMethodField( + "get_encounters", + help_text="A link to a list of location areas, as well as encounter details pertaining to specific versions.", + ) + sprites = serializers.SerializerMethodField( + "get_pokemon_sprites", + help_text="A set of sprites used to depict this Pokémon in the game. A visual representation of the various sprites can be found at PokeAPI/sprites", + ) + cries = serializers.SerializerMethodField( + "get_pokemon_cries", + help_text="A set of cries used to depict this Pokémon in the game. A visual representation of the various cries can be found at PokeAPI/cries", + ) class Meta: model = Pokemon @@ -2971,6 +4416,15 @@ class Meta: "types", "past_types", ) + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + id=RESOURCE_ID_HELP, + name=RESOURCE_NAME_HELP, + base_experience="The base experience gained for defeating this Pokémon.", + height="The height of this Pokémon in decimetres.", + is_default="Set for exactly one Pokémon used as the default for each species.", + order="Order for sorting. Almost national order, except families are grouped together.", + weight="The weight of this Pokémon in hectograms.", + ) _FEMALE_FALLBACKS: ClassVar[dict[str, str]] = { "front_female": "front_default", @@ -3046,7 +4500,7 @@ def get_pokemon_moves(self, obj: Pokemon) -> list[dict[str, Any]]: return list(moves_grouped.values()) - @extend_schema_field(PokemonHeldItemSerializer(many=True)) + @extend_schema_field(PokemonHeldItemSummarySerializer(many=True)) def get_pokemon_held_items(self, obj: Pokemon) -> list[dict[str, Any]]: pokemon_items = ( PokemonItem.objects.filter(pokemon=obj, item__isnull=False) @@ -3191,20 +4645,34 @@ def get_encounters(self, obj: Pokemon) -> str: class EvolutionTriggerNameSerializer(serializers.HyperlinkedModelSerializer[EvolutionTriggerName]): - language = LanguageSummarySerializer() + language = LanguageSummarySerializer(help_text=NAME_LANGUAGE_HELP) class Meta: model = EvolutionTriggerName fields = ("name", "language") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + name=LOCALIZED_NAME_HELP, + ) class EvolutionTriggerDetailSerializer(serializers.HyperlinkedModelSerializer[EvolutionTrigger]): - names = EvolutionTriggerNameSerializer(many=True, read_only=True, source="evolutiontriggername") - pokemon_species = serializers.SerializerMethodField("get_species") + names = EvolutionTriggerNameSerializer( + many=True, + read_only=True, + source="evolutiontriggername", + help_text=LOCALIZED_NAMES_HELP, + ) + pokemon_species = serializers.SerializerMethodField( + "get_species", help_text="A list of pokemon species that result from this evolution trigger." + ) class Meta: model = EvolutionTrigger fields = ("id", "name", "names", "pokemon_species") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + id=RESOURCE_ID_HELP, + name=RESOURCE_NAME_HELP, + ) @extend_schema_field(PokemonSpeciesSummarySerializer(many=True)) def get_species(self, obj: EvolutionTrigger) -> ReturnList[ReturnDict[str, Any]]: @@ -3216,45 +4684,71 @@ def get_species(self, obj: EvolutionTrigger) -> ReturnList[ReturnDict[str, Any]] class EvolutionVariableNameSerializer(serializers.ModelSerializer[EvolutionVariableName]): - language = LanguageSummarySerializer() + language = LanguageSummarySerializer(help_text=NAME_LANGUAGE_HELP) class Meta: model = EvolutionVariableName fields = ("name", "language") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + name=LOCALIZED_NAME_HELP, + ) class EvolutionVariableDescriptionSerializer(serializers.ModelSerializer[EvolutionVariableDescription]): - language = LanguageSummarySerializer() + language = LanguageSummarySerializer(help_text=NAME_LANGUAGE_HELP) class Meta: model = EvolutionVariableDescription fields = ("description", "language") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + description=LOCALIZED_DESCRIPTION_HELP, + ) class EvolutionVariableDetailSerializer(serializers.HyperlinkedModelSerializer[EvolutionVariable]): - version_group = VersionGroupSummarySerializer() - names = EvolutionVariableNameSerializer(many=True, read_only=True, source="evolutionvariablename") + version_group = VersionGroupSummarySerializer(help_text="The version group in which this variable was introduced.") + names = EvolutionVariableNameSerializer( + many=True, + read_only=True, + source="evolutionvariablename", + help_text=LOCALIZED_NAMES_HELP, + ) descriptions = EvolutionVariableDescriptionSerializer( - many=True, read_only=True, source="evolutionvariabledescription" + many=True, + read_only=True, + source="evolutionvariabledescription", + help_text=LOCALIZED_DESCRIPTIONS_HELP, ) class Meta: model = EvolutionVariable fields = ("id", "name", "symbol", "data_type", "source", "version_group", "names", "descriptions") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + id=RESOURCE_ID_HELP, + name=RESOURCE_NAME_HELP, + symbol="The symbol used for this variable in evolution condition expressions.", + data_type="The data type of this variable.", + source="The source of the variable value.", + ) class PokemonSpeciesDescriptionSerializer(serializers.ModelSerializer[PokemonSpeciesDescription]): - language = LanguageSummarySerializer() + language = LanguageSummarySerializer(help_text=NAME_LANGUAGE_HELP) class Meta: model = PokemonSpeciesDescription fields = ("description", "language") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + description=LOCALIZED_DESCRIPTION_HELP, + ) class PokemonSpeciesFlavorTextSerializer(serializers.ModelSerializer[PokemonSpeciesFlavorText]): - flavor_text = serializers.CharField() - language = LanguageSummarySerializer() - version = VersionSummarySerializer() + flavor_text = serializers.CharField( + help_text="The localized flavor text for an API resource in a specific language. Note that this text is left unprocessed as it is found in game files. This means that it contains special characters that one might want to replace with their visible decodable version. Please check out this issue to find out more. " + ) + language = LanguageSummarySerializer(help_text=NAME_LANGUAGE_HELP) + version = VersionSummarySerializer(help_text="The game version this flavor text is extracted from.") class Meta: model = PokemonSpeciesFlavorText @@ -3272,25 +4766,54 @@ class Meta: class PokemonSpeciesDetailSerializer(serializers.ModelSerializer[PokemonSpecies]): - names = serializers.SerializerMethodField("get_pokemon_names") + names = serializers.SerializerMethodField("get_pokemon_names", help_text=LOCALIZED_NAMES_HELP) form_descriptions = PokemonSpeciesDescriptionSerializer( - many=True, read_only=True, source="pokemonspeciesdescription" + many=True, + read_only=True, + source="pokemonspeciesdescription", + help_text="Descriptions of different forms Pokémon take on within the Pokémon species.", + ) + pokedex_numbers = PokemonDexEntrySerializer( + many=True, + read_only=True, + source="pokemondexnumber", + help_text="A list of Pokedexes and the indexes reserved within them for this Pokémon species.", + ) + egg_groups = serializers.SerializerMethodField( + "get_pokemon_egg_groups", help_text="A list of egg groups this Pokémon species is a member of." ) - pokedex_numbers = PokemonDexEntrySerializer(many=True, read_only=True, source="pokemondexnumber") - egg_groups = serializers.SerializerMethodField("get_pokemon_egg_groups") flavor_text_entries = PokemonSpeciesFlavorTextSerializer( - many=True, read_only=True, source="pokemonspeciesflavortext" + many=True, + read_only=True, + source="pokemonspeciesflavortext", + help_text="A list of flavor text entries for this Pokémon species.", + ) + genera = serializers.SerializerMethodField( + "get_pokemon_genera", help_text="The genus of this Pokémon species listed in multiple languages." + ) + generation = GenerationSummarySerializer(help_text="The generation this Pokémon species was introduced in.") + growth_rate = GrowthRateSummarySerializer(help_text="The rate at which this Pokémon species gains levels.") + color = PokemonColorSummarySerializer( + source="pokemon_color", help_text="The color of this Pokémon for Pokédex search." + ) + habitat = PokemonHabitatSummarySerializer( + source="pokemon_habitat", allow_null=True, help_text="The habitat this Pokémon species can be encountered in." + ) + shape = PokemonShapeSummarySerializer( + source="pokemon_shape", help_text="The shape of this Pokémon for Pokédex search." + ) + evolves_from_species = PokemonSpeciesSummarySerializer( + allow_null=True, help_text="The Pokémon species that evolves into this Pokemon_species." + ) + varieties = serializers.SerializerMethodField( + "get_pokemon_varieties", help_text="A list of the Pokémon that exist within this Pokémon species." + ) + evolution_chain = EvolutionChainSummarySerializer( + help_text="The evolution chain this Pokémon species is a member of." + ) + pal_park_encounters = serializers.SerializerMethodField( + "get_encounters", help_text="A list of encounters that can be had with this Pokémon species in pal park." ) - genera = serializers.SerializerMethodField("get_pokemon_genera") - generation = GenerationSummarySerializer() - growth_rate = GrowthRateSummarySerializer() - color = PokemonColorSummarySerializer(source="pokemon_color") - habitat = PokemonHabitatSummarySerializer(source="pokemon_habitat") - shape = PokemonShapeSummarySerializer(source="pokemon_shape") - evolves_from_species = PokemonSpeciesSummarySerializer() - varieties = serializers.SerializerMethodField("get_pokemon_varieties") - evolution_chain = EvolutionChainSummarySerializer() - pal_park_encounters = serializers.SerializerMethodField("get_encounters") class Meta: model = PokemonSpecies @@ -3323,6 +4846,20 @@ class Meta: "genera", "varieties", ) + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + id=RESOURCE_ID_HELP, + name=RESOURCE_NAME_HELP, + order="The order in which species should be sorted. Based on National Dex order, except families are grouped together and sorted by stage.", + gender_rate="The chance of this Pokémon being female, in eighths; or -1 for genderless.", + capture_rate="The base capture rate; up to 255. The higher the number, the easier the catch.", + base_happiness="The happiness when caught by a normal Pokéball; up to 255. The higher the number, the happier the Pokémon.", + is_baby="Whether or not this is a baby Pokémon.", + is_legendary="Whether or not this is a legendary Pokémon.", + is_mythical="Whether or not this is a mythical Pokémon.", + hatch_counter="Initial hatch counter: one must walk Y × (hatch_counter + 1) steps before this Pokémon's egg hatches, unless utilizing bonuses like Flame Body's. Y varies per generation. In Generations II, III, and VII, Egg cycles are 256 steps long. In Generation IV, Egg cycles are 255 steps long. In Pokémon Brilliant Diamond and Shining Pearl, Egg cycles are also 255 steps long, but are shorter on special dates. In Generations V and VI, Egg cycles are 257 steps long. In Pokémon Sword and Shield, and in Pokémon Scarlet and Violet, Egg cycles are 128 steps long.", # noqa: RUF001 + has_gender_differences="Whether or not this Pokémon has visual gender differences.", + forms_switchable="Whether or not this Pokémon has multiple forms and can switch between them.", + ) @extend_schema_field(PokemonSpeciesNameSerializer(many=True)) def get_pokemon_names(self, obj: PokemonSpecies) -> ReturnList[ReturnDict[str, Any]]: @@ -3377,22 +4914,61 @@ def get_encounters(self, obj: PokemonSpecies) -> ReturnList[ReturnDict[str, Any] class PokemonEvolutionSerializer(serializers.ModelSerializer[PokemonEvolution]): - version_group = VersionGroupSummarySerializer() - item = ItemSummarySerializer(source="evolution_item") - held_item = ItemSummarySerializer() - known_move = MoveSummarySerializer() - known_move_type = TypeSummarySerializer() - party_species = PokemonSpeciesSummarySerializer() - party_type = TypeSummarySerializer() - trade_species = PokemonSpeciesSummarySerializer() - location = LocationSummarySerializer() - trigger = EvolutionTriggerSummarySerializer(source="evolution_trigger") - region = RegionSummarySerializer() - required_pokemon_form = PokemonFormSummarySerializer() - evolved_pokemon_form = PokemonFormSummarySerializer() - used_move = MoveSummarySerializer() - allowed_natures = serializers.SerializerMethodField("get_allowed_natures") - condition_expression = serializers.SerializerMethodField("get_condition_expression") + version_group = VersionGroupSummarySerializer( + help_text="The version group in which these evolution requirements apply." + ) + item = ItemSummarySerializer( + source="evolution_item", + allow_null=True, + help_text="The item required to cause evolution this into Pokémon species.", + ) + held_item = ItemSummarySerializer( + allow_null=True, + help_text="The item the evolving Pokémon species must be holding during the evolution trigger event to evolve into this Pokémon species.", + ) + known_move = MoveSummarySerializer( + allow_null=True, + help_text="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.", + ) + known_move_type = TypeSummarySerializer( + allow_null=True, + help_text="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.", + ) + party_species = PokemonSpeciesSummarySerializer( + allow_null=True, + help_text="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.", + ) + party_type = TypeSummarySerializer( + allow_null=True, + help_text="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.", + ) + trade_species = PokemonSpeciesSummarySerializer( + allow_null=True, help_text="Pokémon species for which this one must be traded." + ) + location = LocationSummarySerializer(allow_null=True, help_text="The location the evolution must be triggered at.") + trigger = EvolutionTriggerSummarySerializer( + source="evolution_trigger", help_text="The type of event that triggers evolution into this Pokémon species." + ) + region = RegionSummarySerializer( + allow_null=True, help_text="The required region in which this evolution can occur." + ) + required_pokemon_form = PokemonFormSummarySerializer( + allow_null=True, help_text="The Pokémon form required before evolving, or null if unrestricted." + ) + evolved_pokemon_form = PokemonFormSummarySerializer( + allow_null=True, help_text="The Pokémon form produced by this evolution, or null if unspecified." + ) + used_move = MoveSummarySerializer( + allow_null=True, + help_text="The move that must be used by the evolving Pokémon species during the evolution trigger event in order to evolve into this Pokémon species.", + ) + allowed_natures = serializers.SerializerMethodField( + "get_allowed_natures", help_text="The natures that allow this evolution, or null if unrestricted." + ) + condition_expression = serializers.SerializerMethodField( + "get_condition_expression", + help_text="An additional evolution condition expressed in reverse Polish notation, or null if none.", + ) class Meta: model = PokemonEvolution @@ -3429,6 +5005,23 @@ class Meta: "allowed_natures", "condition_expression", ) + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + is_default="Whether the evolution is considered as the expected evolution in a main series game. Each unique Pokémon variety of a line capable of evolution should have exactly one 'default' evolution. For example, the Meowth species has three default evolutions as there are three distinct varieties it can evolve into: Persian, Alolan Persian, and Perrserker.", + gender="The id of the gender of the evolving Pokémon species must be in order to evolve into this Pokémon species.", + min_level="The minimum required level of the evolving Pokémon species to evolve into this Pokémon species.", + min_happiness="The minimum required level of happiness the evolving Pokémon species to evolve into this Pokémon species.", + min_beauty="The minimum required level of beauty the evolving Pokémon species to evolve into this Pokémon species.", + min_affection="The minimum required level of affection the evolving Pokémon species to evolve into this Pokémon species.", + near_special_rock="Whether or not you need to be near a Moss Rock or Icy Rock to evolve into this Pokémon species.", + needs_multiplayer="Whether or not multiplayer link play is needed to evolve into this Pokémon species (e.g. Union Circle).", + needs_overworld_rain="Whether or not it must be raining in the overworld to cause evolution this Pokémon species.", + 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.", + time_of_day="The required time of day. Day or night.", + turn_upside_down="Whether or not the 3DS needs to be turned upside-down as this Pokémon levels up.", + min_move_count="The minimum number of times a move must be used in order to evolve into this Pokémon species.", + min_steps="The minimum number of steps that must be taken in order to evolve into this Pokémon species.", + min_damage_taken="The minimum amount of damage taken during the evolution trigger event in order to evolve into this Pokémon species.", + ) @cached_property def _serialized_natures(self) -> list[tuple[int, dict[str, Any]]]: @@ -3442,7 +5035,7 @@ def _serialized_evolution_variables(self) -> list[tuple[str, dict[str, Any]]]: data = EvolutionVariableSummarySerializer(variables, many=True, context=self.context).data return [(variable.symbol, item) for variable, item in zip(variables, data, strict=True)] - @extend_schema_field(NatureSummarySerializer(many=True)) + @extend_schema_field(NatureSummarySerializer(many=True, allow_null=True)) def get_allowed_natures(self, obj: PokemonEvolution) -> list[dict[str, Any]] | None: if obj.nature_bitmask is None: return None @@ -3464,15 +5057,29 @@ def get_condition_expression(self, obj: PokemonEvolution) -> dict[str, Any] | No class EvolutionChainLinkSerializer(serializers.Serializer[Any]): - is_baby = serializers.BooleanField() - species = PokemonSpeciesSummarySerializer() - evolution_details = PokemonEvolutionSerializer(many=True) - evolves_to = serializers.ListField(child=serializers.DictField()) + is_baby = serializers.BooleanField( + help_text="Whether or not this link is for a baby Pokémon. This would only ever be true on the base link." + ) + species = PokemonSpeciesSummarySerializer(help_text="The Pokémon species at this point in the evolution chain.") + evolution_details = PokemonEvolutionSerializer( + many=True, help_text="All details regarding the specific details of the referenced Pokémon species evolution." + ) + evolves_to = serializers.SerializerMethodField(help_text="A List of chain objects.") + + @extend_schema_field(lazy_serializer("pokemon_v2.serializers.EvolutionChainLinkSerializer")(many=True)) # pyright: ignore[reportArgumentType] + def get_evolves_to(self, obj: dict[str, Any]) -> list[dict[str, Any]]: + return obj["evolves_to"] class EvolutionChainDetailSerializer(serializers.ModelSerializer[EvolutionChain]): - baby_trigger_item = ItemSummarySerializer() - chain = serializers.SerializerMethodField("build_chain") + baby_trigger_item = ItemSummarySerializer( + allow_null=True, + help_text="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.", + ) + chain = serializers.SerializerMethodField( + "build_chain", + help_text="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.", + ) POKEMON_EVOLUTION_FK_FIELDS: ClassVar[list[str]] = [ field.name @@ -3483,6 +5090,9 @@ class EvolutionChainDetailSerializer(serializers.ModelSerializer[EvolutionChain] class Meta: model = EvolutionChain fields = ("id", "baby_trigger_item", "chain") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + id=RESOURCE_ID_HELP, + ) @extend_schema_field(EvolutionChainLinkSerializer) def build_chain(self, obj: EvolutionChain) -> dict[str, Any]: @@ -3574,33 +5184,55 @@ def build_chain_link_entry( class PokeathlonStatNameSerializer(serializers.HyperlinkedModelSerializer[PokeathlonStatName]): - language = LanguageSummarySerializer() + language = LanguageSummarySerializer(help_text=NAME_LANGUAGE_HELP) class Meta: model = PokeathlonStatName fields = ("name", "language") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + name=LOCALIZED_NAME_HELP, + ) class PokeathlonStatAffectingNatureSerializer(serializers.ModelSerializer[NaturePokeathlonStat]): - nature = NatureSummarySerializer() + nature = NatureSummarySerializer(help_text="The nature causing the change.") class Meta: model = NaturePokeathlonStat fields = ("max_change", "nature") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + max_change="The maximum amount of change to the referenced Pokéathlon stat.", + ) class PokeathlonStatAffectingNaturesSerializer(serializers.Serializer[Any]): - increase = PokeathlonStatAffectingNatureSerializer(many=True) - decrease = PokeathlonStatAffectingNatureSerializer(many=True) + increase = PokeathlonStatAffectingNatureSerializer( + many=True, help_text="A list of natures and how they change the referenced Pokéathlon stat." + ) + decrease = PokeathlonStatAffectingNatureSerializer( + many=True, help_text="A list of natures and how they change the referenced Pokéathlon stat." + ) class PokeathlonStatDetailSerializer(serializers.HyperlinkedModelSerializer[PokeathlonStat]): - names = PokeathlonStatNameSerializer(many=True, read_only=True, source="pokeathlonstatname") - affecting_natures = serializers.SerializerMethodField("get_natures_that_affect") + names = PokeathlonStatNameSerializer( + many=True, + read_only=True, + source="pokeathlonstatname", + help_text=LOCALIZED_NAMES_HELP, + ) + affecting_natures = serializers.SerializerMethodField( + "get_natures_that_affect", + help_text="A detail of natures which affect this Pokéathlon stat positively or negatively.", + ) class Meta: model = PokeathlonStat fields = ("id", "name", "affecting_natures", "names") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + id=RESOURCE_ID_HELP, + name=RESOURCE_NAME_HELP, + ) @extend_schema_field(PokeathlonStatAffectingNaturesSerializer) def get_natures_that_affect(self, obj: PokeathlonStat) -> dict[str, ReturnList[ReturnDict[str, Any]]]: @@ -3625,24 +5257,32 @@ def get_natures_that_affect(self, obj: PokeathlonStat) -> dict[str, ReturnList[R class PokedexNameSerializer(serializers.HyperlinkedModelSerializer[PokedexName]): - language = LanguageSummarySerializer() + language = LanguageSummarySerializer(help_text=NAME_LANGUAGE_HELP) class Meta: model = PokedexName fields = ("name", "language") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + name=LOCALIZED_NAME_HELP, + ) class PokedexDescriptionSerializer(serializers.HyperlinkedModelSerializer[PokedexDescription]): - language = LanguageSummarySerializer() + language = LanguageSummarySerializer(help_text=NAME_LANGUAGE_HELP) class Meta: model = PokedexDescription fields = ("description", "language") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + description=LOCALIZED_DESCRIPTION_HELP, + ) class PokemonDexNumberSerializer(serializers.ModelSerializer[PokemonDexNumber]): - entry_number = serializers.IntegerField(source="pokedex_number") - pokemon_species = PokemonSpeciesSummarySerializer() + entry_number = serializers.IntegerField( + source="pokedex_number", help_text="The index of this Pokémon species entry within the Pokédex." + ) + pokemon_species = PokemonSpeciesSummarySerializer(help_text="The Pokémon species being encountered.") class Meta: model = PokemonDexNumber @@ -3650,11 +5290,25 @@ class Meta: class PokedexDetailSerializer(serializers.ModelSerializer[Pokedex]): - region = RegionSummarySerializer() - names = PokedexNameSerializer(many=True, read_only=True, source="pokedexname") - descriptions = PokedexDescriptionSerializer(many=True, read_only=True, source="pokedexdescription") - pokemon_entries = serializers.SerializerMethodField("get_pokedex_entries") - version_groups = serializers.SerializerMethodField("get_pokedex_version_groups") + region = RegionSummarySerializer(allow_null=True, help_text="The region this Pokédex catalogues Pokémon for.") + names = PokedexNameSerializer( + many=True, + read_only=True, + source="pokedexname", + help_text=LOCALIZED_NAMES_HELP, + ) + descriptions = PokedexDescriptionSerializer( + many=True, + read_only=True, + source="pokedexdescription", + help_text=LOCALIZED_DESCRIPTIONS_HELP, + ) + pokemon_entries = serializers.SerializerMethodField( + "get_pokedex_entries", help_text="A list of Pokémon catalogued in this Pokédex and their indexes." + ) + version_groups = serializers.SerializerMethodField( + "get_pokedex_version_groups", help_text="A list of version groups this Pokédex is relevant to." + ) class Meta: model = Pokedex @@ -3668,6 +5322,11 @@ class Meta: "region", "version_groups", ) + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + id=RESOURCE_ID_HELP, + name=RESOURCE_NAME_HELP, + is_main_series="Whether or not this Pokédex originated in the main series of the video games.", + ) @extend_schema_field(PokemonDexNumberSerializer(many=True)) def get_pokedex_entries(self, obj: Pokedex) -> ReturnList[ReturnDict[str, Any]]: @@ -3696,11 +5355,14 @@ def get_pokedex_version_groups(self, obj: Pokedex) -> ReturnList[ReturnDict[str, class VersionNameSerializer(serializers.ModelSerializer[VersionName]): - language = LanguageSummarySerializer() + language = LanguageSummarySerializer(help_text=NAME_LANGUAGE_HELP) class Meta: model = VersionName fields = ("name", "language") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + name=LOCALIZED_NAME_HELP, + ) class VersionDetailSerializer(serializers.ModelSerializer[Version]): @@ -3710,20 +5372,37 @@ class VersionDetailSerializer(serializers.ModelSerializer[Version]): not sure how to add anything other than a hyperlink """ - names = VersionNameSerializer(many=True, read_only=True, source="versionname") - version_group = VersionGroupSummarySerializer() + names = VersionNameSerializer( + many=True, + read_only=True, + source="versionname", + help_text=LOCALIZED_NAMES_HELP, + ) + version_group = VersionGroupSummarySerializer(help_text="The version group this version belongs to.") class Meta: model = Version fields = ("id", "name", "names", "version_group") + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + id=RESOURCE_ID_HELP, + name=RESOURCE_NAME_HELP, + ) class VersionGroupDetailSerializer(serializers.ModelSerializer[VersionGroup]): - generation = GenerationSummarySerializer() - versions = VersionSummarySerializer(many=True, read_only=True, source="version") - regions = serializers.SerializerMethodField("get_version_group_regions") - move_learn_methods = serializers.SerializerMethodField("get_learn_methods") - pokedexes = serializers.SerializerMethodField("get_version_groups_pokedexes") + generation = GenerationSummarySerializer(help_text="The generation this version was introduced in.") + versions = VersionSummarySerializer( + many=True, read_only=True, source="version", help_text="The versions this version group owns." + ) + regions = serializers.SerializerMethodField( + "get_version_group_regions", help_text="A list of regions that can be visited in this version group." + ) + move_learn_methods = serializers.SerializerMethodField( + "get_learn_methods", help_text="A list of methods in which Pokémon can learn moves in this version group." + ) + pokedexes = serializers.SerializerMethodField( + "get_version_groups_pokedexes", help_text="A list of Pokédexes introduces in this version group." + ) class Meta: model = VersionGroup @@ -3737,6 +5416,11 @@ class Meta: "regions", "versions", ) + extra_kwargs: ClassVar[dict[str, dict[str, str]]] = format_help_text( + id=RESOURCE_ID_HELP, + name=RESOURCE_NAME_HELP, + order="Order for sorting. Almost by date of release, except similar versions are grouped together.", + ) @extend_schema_field(RegionSummarySerializer(many=True)) def get_version_group_regions(self, obj: VersionGroup) -> ReturnList[ReturnDict[str, Any]]: