{"record":{"id":"a254c49d5277c129","repo":"OpenBB-finance/OpenBB","slug":"required-parameter-for-imf-provider-not-supplied","errorCode":null,"errorMessage":"Required parameter for IMF provider not supplied.","messagePattern":"Required parameter for IMF provider not supplied\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"openbb_platform/providers/imf/openbb_imf/models/direction_of_trade.py","lineNumber":60,"sourceCode":"            \"x-widget_config\": {\"value\": \"world\", \"style\": {\"popupWidth\": 600}},\n        },\n    }\n\n    limit: int | None = Field(\n        default=None,\n        description=\"Limit the number of results returned, the most recent data points first.\",\n    )\n\n    @field_validator(\"country\", \"counterpart\", mode=\"before\")\n    @classmethod\n    def _validate_country_fields(cls, v):\n        \"\"\"Validate country and counterpart fields.\n\n        Accepts both ISO3 codes (e.g., 'USA') and snake_case country names\n        (e.g., 'united_states'). Converts names to ISO3 codes.\n        \"\"\"\n        if not v:\n            raise ValueError(\"Required parameter for IMF provider not supplied.\")\n\n        if isinstance(v, str) and v.lower() in [\"all\", \"*\"]:\n            return \"*\"\n\n        # Split by comma if string\n        values = (\n            v.split(\",\")\n            if isinstance(v, str) and \",\" in v\n            else [v] if isinstance(v, str) else v\n        )\n\n        result: list[str] = []\n        for item in values:\n            item_stripped = item.strip()\n            if item_stripped.lower() in [\"all\", \"*\"]:\n                if len(values) > 1:\n                    raise ValueError(\n                        \"'all' cannot be used with other country codes in a list.\"","sourceCodeStart":42,"sourceCodeEnd":78,"githubUrl":"https://github.com/OpenBB-finance/OpenBB/blob/3e071fcc2cd9f891cac6040ae60296dba76dab46/openbb_platform/providers/imf/openbb_imf/models/direction_of_trade.py#L42-L78","documentation":"Error \"Required parameter for IMF provider not supplied.\" thrown in OpenBB-finance/OpenBB.","triggerScenarios":"Thrown at openbb_platform/providers/imf/openbb_imf/models/direction_of_trade.py:60 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Supply the required parameters (country, counterpart, frequency) for the IMF direction of trade endpoint.","Consult the endpoint documentation for required fields."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"3e071fcc2cd9f891cac6040ae60296dba76dab46","analyzedAt":"2026-08-14T23:40:48.960Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}