{"record":{"id":"e2b993ad711240bf","repo":"makeplane/plane","slug":"non-scalar-list-item","errorCode":"non_scalar_list_item","errorMessage":"List value for '{key}' must contain only scalar items","messagePattern":"List value for '(.+?)' must contain only scalar items","errorType":"validation","errorClass":"DRFValidationError","httpStatus":400,"severity":"error","filePath":"apps/api/plane/utils/filters/filter_backend.py","lineNumber":441,"sourceCode":"                raise DRFValidationError(\n                    {\n                        \"message\": \"Logical operators cannot appear in a leaf filter object\",\n                        \"code\": \"operator_in_leaf\",\n                    }\n                )\n\n            # Lists/Tuples must contain only scalar values\n            if isinstance(value, (list, tuple)):\n                if len(value) == 0:\n                    raise DRFValidationError(\n                        {\n                            \"message\": f\"List value for '{key}' must not be empty\",\n                            \"code\": \"empty_list_value\",\n                        }\n                    )\n                for item in value:\n                    if not self._is_scalar(item):\n                        raise DRFValidationError(\n                            {\n                                \"message\": f\"List value for '{key}' must contain only scalar items\",\n                                \"code\": \"non_scalar_list_item\",\n                            }\n                        )\n                continue\n\n            # Scalars and None are allowed\n            if not self._is_scalar(value):\n                raise DRFValidationError(\n                    {\n                        \"message\": (f\"Value for '{key}' must be a scalar, null, or list/tuple of scalars\"),\n                        \"code\": \"invalid_value_type\",\n                    }\n                )\n\n    def _is_scalar(self, value):\n        return value is None or isinstance(value, (str, int, float, bool))","sourceCodeStart":423,"sourceCodeEnd":459,"githubUrl":"https://github.com/makeplane/plane/blob/1c8a60f858d8472aa56e29994ec1c7926da2c6ce/apps/api/plane/utils/filters/filter_backend.py#L423-L459","documentation":"Raised by _validate_leaf when a list/tuple value contains an item that is not a scalar. _is_scalar accepts None, str, int, float, bool; nested lists, dicts, or other objects inside a list value would not survive serialization into the QueryDict that feeds the filterset.","triggerScenarios":"GET .../?filters={\"state__in\":[{\"name\":\"open\"}]} (list of objects); GET .../?filters={\"tags__in\":[['urgent']]} (nested array); GET .../?filters={\"id__in\":[123,\"abc\",[456]]}.","commonSituations":"Passing a list of ORM objects or dicts from a serializer; client that does not unwrap nested arrays; sending composite values where the filterset expects scalars.","solutions":["Flatten list values to scalars: {\"state__in\":[\"open\",\"closed\"]}.","If the source is a list of objects, map to the scalar field first: objs.map(o => o.id).","Validate each item with typeof checks before serializing."],"exampleFix":"// before\n?filters={\"id__in\":[{\"id\":1},{\"id\":2}]}\n// after\n?filters={\"id__in\":[1,2]}","handlingStrategy":"type-guard","validationCode":"def assert_list_items_scalar(leaf):\n    for k, v in leaf.items():\n        if isinstance(v, (list, tuple)):\n            for item in v:\n                if not (item is None or isinstance(item, (str, int, float, bool))):\n                    raise ValueError(f\"list value for '{k}' contains non-scalar item: {item!r}\")","typeGuard":"function isScalar(v) {\n  return v === null || typeof v === 'string' || typeof v === 'number' || typeof v === 'boolean';\n}\nfunction listValuesAreScalar(leaf) {\n  return Object.entries(leaf).every(([k, v]) => !Array.isArray(v) || v.every(isScalar));\n}","tryCatchPattern":null,"preventionTips":["Map lists of objects to the scalar field before sending: objs.map(o => o.id).","Flatten nested arrays in list values."],"tags":["filters","schema","validation","api"],"backgroundTag":null,"analyzedSha":"1c8a60f858d8472aa56e29994ec1c7926da2c6ce","analyzedAt":"2026-08-12T14:44:31.636Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}