{"record":{"id":"b834c4281542d88e","repo":"OpenBB-finance/OpenBB","slug":"required-field-missing-symbol","errorCode":null,"errorMessage":"Required field missing -> symbol","messagePattern":"Required field missing -> symbol","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"openbb_platform/providers/fmp/openbb_fmp/models/company_news.py","lineNumber":38,"sourceCode":"    __json_schema_extra__ = {\"symbol\": {\"multiple_items_allowed\": True}}\n\n    page: int = Field(\n        default=0,\n        le=100,\n        ge=0,\n        description=\"Page number of the results. Use in combination with limit.\",\n    )\n    press_release: bool | None = Field(\n        default=None,\n        description=\"When true, will return only press releases for the given symbol(s).\",\n    )\n\n    @field_validator(\"symbol\", mode=\"before\", check_fields=False)\n    @classmethod\n    def _symbol_mandatory(cls, v):\n        \"\"\"Symbol mandatory validator.\"\"\"\n        if not v:\n            raise ValueError(\"Required field missing -> symbol\")\n        return v\n\n\nclass FMPCompanyNewsData(CompanyNewsData):\n    \"\"\"FMP Company News Data.\"\"\"\n\n    __alias_dict__ = {\n        \"symbols\": \"symbol\",\n        \"date\": \"publishedDate\",\n        \"author\": \"publisher\",\n        \"images\": \"image\",\n        \"source\": \"site\",\n        \"excerpt\": \"text\",\n    }\n\n    source: str = Field(description=\"Name of the news site.\")\n\n","sourceCodeStart":20,"sourceCodeEnd":56,"githubUrl":"https://github.com/OpenBB-finance/OpenBB/blob/3e071fcc2cd9f891cac6040ae60296dba76dab46/openbb_platform/providers/fmp/openbb_fmp/models/company_news.py#L20-L56","documentation":"FMP company news QueryParams has a mode='before' validator on `symbol` that raises ValueError('Required field missing -> symbol') when the value is falsy. Unlike the shared NewsQueryParams where symbol may be optional, FMP's endpoint requires at least one ticker. Fires at model construction, before any request.","triggerScenarios":"Instantiating FMPCompanyNewsQueryParams() with no symbol; passing symbol='' or None; passing a list/iterable that evaluates falsy (empty list).","commonSituations":"Generic news code paths that omit symbol to fetch 'all news' — FMP does not support that; templated calls where the symbol variable is unset; passing an empty watchlist.","solutions":["Always supply at least one ticker (comma-separated string for multiple)","Guard callers: skip the FMP news call when your symbol source is empty","Use a provider that supports symbol-less news if you need market-wide headlines"],"exampleFix":"# before\nq = FMPCompanyNewsQueryParams()  # ValueError: Required field missing -> symbol\n\n# after\nq = FMPCompanyNewsQueryParams(symbol=\"AAPL\")\n# multiple: FMPCompanyNewsQueryParams(symbol=\"AAPL,MSFT\")","handlingStrategy":"validation","validationCode":"if not symbol or not symbol.strip():\n    raise ValueError(\"FMP company news requires at least one ticker\")","typeGuard":"def has_news_symbol(v) -> bool:\n    return bool(v) and bool(str(v).strip())","tryCatchPattern":null,"preventionTips":["Skip the FMP news call entirely when your symbol source is empty","Remember FMP news is per-symbol; use another provider for market-wide headlines","Catch the construction-time ValueError as an input bug"],"tags":["openbb","fmp","validation","required-field","news"],"backgroundTag":null,"analyzedSha":"3e071fcc2cd9f891cac6040ae60296dba76dab46","analyzedAt":"2026-08-14T23:40:48.960Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}