{"record":{"id":"db3fca0a2558e2d8","repo":"OpenBB-finance/OpenBB","slug":"multiple-items-not-allowed","errorCode":null,"errorMessage":"multiple items not allowed","messagePattern":"multiple items not allowed","errorType":"exception","errorClass":"OpenBBError","httpStatus":null,"severity":"error","filePath":"openbb_platform/core/openbb_core/app/utils.py","lineNumber":192,"sourceCode":"    with open(file) as settings_file:\n        contents = settings_file.read()\n\n    try:\n        settings = json.loads(contents)[\"preferences\"]\n    except KeyError:\n        settings = None\n    cache_dir = (\n        settings[\"cache_directory\"]\n        if settings and \"cache_directory\" in settings\n        else Preferences().cache_directory\n    )\n    return cache_dir\n\n\ndef check_single_item(value: str | None, message: str | None = None) -> str | None:\n    \"\"\"Check that string contains a single item.\"\"\"\n    if value and isinstance(value, str) and (\",\" in value or \";\" in value):\n        raise OpenBBError(message if message else \"multiple items not allowed\")\n    return value\n","sourceCodeStart":174,"sourceCodeEnd":194,"githubUrl":"https://github.com/OpenBB-finance/OpenBB/blob/3e071fcc2cd9f891cac6040ae60296dba76dab46/openbb_platform/core/openbb_core/app/utils.py#L174-L194","documentation":"OpenBBError from check_single_item, a parameter sanitizer used by commands that accept exactly one symbol/item (in contrast to batch endpoints). It rejects any string containing a comma or semicolon - the delimiters OpenBB uses for multi-item lists - so 'AAPL,MSFT' cannot silently pass where one item is required.","triggerScenarios":"Calling single-symbol endpoints with a list-style string, e.g. obb.equity.profile(symbol='AAPL,MSFT') or obb.fixedincome.rate.snapshot(symbol=';'.join(tickers)); some router commands apply this check via their params model to enforce one-at-a-time semantics.","commonSituations":"Copy-pasting a watchlist into a single-symbol field; assuming all endpoints are batch-capable like equity.price.historical(symbol=['AAPL','MSFT']); semicolon-separated CSV input from spreadsheets.","solutions":["Pass a single item with no delimiters: symbol='AAPL'","If batch is supported, use a real list: symbol=['AAPL','MSFT'] - check the command signature","Loop over your tickers and call the single-symbol endpoint per ticker"],"exampleFix":"# before\nres = obb.equity.profile(symbol='AAPL,MSFT')\n\n# after\nres = [obb.equity.profile(symbol=t) for t in ('AAPL', 'MSFT')]","handlingStrategy":"validation","validationCode":"def is_single_item(value: str) -> bool:\n    return isinstance(value, str) and ',' not in value and ';' not in value","typeGuard":"def is_single_symbol(s) -> bool:\n    return isinstance(s, str) and ',' not in s and ';' not in s and len(s) > 0","tryCatchPattern":"from openbb_core.app.model.abstract.error import OpenBBError\n\nsymbols = ['AAPL', 'MSFT']\nresults = []\nfor s in symbols:\n    try:\n        results.append(obb.equity.profile(symbol=s))\n    except OpenBBError as e:\n        if 'multiple items' in str(e):\n            results.extend(obb.equity.profile(symbol=x) for x in s.split(','))\n        else:\n            raise","preventionTips":["Split watchlists before passing to single-symbol endpoints","Use list arguments only on commands whose signature declares list types","Reject comma/semicolon input at your own API boundary"],"tags":["openbb","input-validation","symbols","single-item"],"backgroundTag":null,"analyzedSha":"3e071fcc2cd9f891cac6040ae60296dba76dab46","analyzedAt":"2026-08-14T23:40:48.960Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}