{"record":{"id":"3a792d4e47840b89","repo":"OpenBB-finance/OpenBB","slug":"invalid-chokepoint-name-v-expected-one-of-l","errorCode":null,"errorMessage":"Invalid chokepoint name: {v} -> Expected one of {list(CHOKEPOINTS_NAME_TO_ID)} - or chokepointN, where N is a number between 1 and 24","messagePattern":"Invalid chokepoint name: (.+?) -> Expected one of (.+?) - or chokepointN, where N is a number between 1 and 24","errorType":"validation","errorClass":"OpenBBError","httpStatus":null,"severity":"error","filePath":"openbb_platform/providers/imf/openbb_imf/models/maritime_chokepoint_volume.py","lineNumber":75,"sourceCode":"                    if chokepoint not in list(\n                        CHOKEPOINTS_NAME_TO_ID\n                    ) and chokepoint not in list(CHOKEPOINTS_NAME_TO_ID.values()):\n                        raise OpenBBError(\n                            ValueError(\n                                f\"Invalid chokepoint name: {chokepoint} -> \"\n                                f\"Expected one of {list(CHOKEPOINTS_NAME_TO_ID)}\"\n                                \" - or chokepointN, where N is a number between 1 and 24\"\n                            )\n                        )\n\n                return \",\".join(chokepoints) if chokepoints else None\n\n            if (\n                v\n                and v not in CHOKEPOINTS_NAME_TO_ID\n                and v not in list(CHOKEPOINTS_NAME_TO_ID.values())\n            ):\n                raise OpenBBError(\n                    ValueError(\n                        f\"Invalid chokepoint name: {v} -> \"\n                        f\"Expected one of {list(CHOKEPOINTS_NAME_TO_ID)}\"\n                        \" - or chokepointN, where N is a number between 1 and 24\"\n                    )\n                )\n\n            return (\n                v\n                if v in CHOKEPOINTS_NAME_TO_ID\n                or v in list(CHOKEPOINTS_NAME_TO_ID.values())\n                else None\n            )\n\n        if isinstance(v, list):\n            chokepoints = []\n            for d in v:\n                if d in CHOKEPOINTS_NAME_TO_ID:","sourceCodeStart":57,"sourceCodeEnd":93,"githubUrl":"https://github.com/OpenBB-finance/OpenBB/blob/3e071fcc2cd9f891cac6040ae60296dba76dab46/openbb_platform/providers/imf/openbb_imf/models/maritime_chokepoint_volume.py#L57-L93","documentation":"The single-value branch of the same `chokepoint` field validator: the string contains no comma but is neither a CHOKEPOINTS_NAME_TO_ID key nor one of its values, so it is rejected before any network call. Message mirrors the comma variant — valid names list plus the chokepointN id escape hatch.","triggerScenarios":"Passing one misspelled or aliased chokepoint name, e.g. `chokepoint='panama'` (lowercase) or `'Malacca strait'`, where exact key 'Malacca Strait' is required; ids are matched case-sensitively too.","commonSituations":"Quick single-chokepoint lookups typed from memory; casing/punctuation drift from the official names; passing a port name instead of a chokepoint name.","solutions":["Copy the exact chokepoint name from the validator's listed options, or pass its chokepointN id.","Match casing and punctuation exactly (the comparison is case-sensitive).","If unsure of the id, call maritime_chokepoint_info once to see canonical names."],"exampleFix":"# before\nmaritime_chokepoint_volume(chokepoint='panama')\n\n# after\nmaritime_chokepoint_volume(chokepoint='Panama Canal')","handlingStrategy":"validation","validationCode":"from openbb_imf.models.maritime_chokepoint_volume import CHOKEPOINTS_NAME_TO_ID\nif chokepoint not in CHOKEPOINTS_NAME_TO_ID and chokepoint not in CHOKEPOINTS_NAME_TO_ID.values():\n    raise ValueError(f'unknown chokepoint: {chokepoint}')","typeGuard":"def is_valid_chokepoint(s: str) -> bool:\n    return s in CHOKEPOINTS_NAME_TO_ID or s in CHOKEPOINTS_NAME_TO_ID.values()","tryCatchPattern":null,"preventionTips":["Use exact casing from the official names","Offer users a dropdown sourced from the mapping, not free text"],"tags":["imf","portwatch","validation","chokepoint","query-params"],"backgroundTag":null,"analyzedSha":"3e071fcc2cd9f891cac6040ae60296dba76dab46","analyzedAt":"2026-08-14T23:40:48.960Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}