{"record":{"id":"c3430b7544f64452","repo":"makeplane/plane","slug":"invalid-value-type","errorCode":"invalid_value_type","errorMessage":"Value for '{key}' must be a scalar, null, or list/tuple of scalars","messagePattern":"Value for '(.+?)' must be a scalar, null, or list/tuple of scalars","errorType":"validation","errorClass":"DRFValidationError","httpStatus":400,"severity":"error","filePath":"apps/api/plane/utils/filters/filter_backend.py","lineNumber":451,"sourceCode":"                    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))\n","sourceCodeStart":433,"sourceCodeEnd":460,"githubUrl":"https://github.com/makeplane/plane/blob/1c8a60f858d8472aa56e29994ec1c7926da2c6ce/apps/api/plane/utils/filters/filter_backend.py#L433-L460","documentation":"Raised by _validate_leaf when a leaf field's value is not a scalar, not None, and not a list/tuple. The backend only allows None, str/int/float/bool, or lists of scalars; passing a bare dict, a set, or any other object as a field value is rejected because it cannot be coerced into the QueryDict string form the filterset expects.","triggerScenarios":"GET .../?filters={\"state\":{\"name\":\"open\"}} (dict as value); GET .../?filters={\"priority\":{}} ; programmatic input that forwards a Django model instance or set object as a value.","commonSituations":"Client reuses an object representation where a scalar ID/name is expected; Python callers passing a set instead of a list; nested filter fragment mistaken for a value.","solutions":["Replace dict/object values with the relevant scalar: {\"state\":\"open\"} or {\"state_id\":3}.","If you need sub-field matching, declare it as a relationship filter on the filterset and use the appropriate lookup suffix.","Convert Python sets to lists before serializing."],"exampleFix":"// before\n?filters={\"state\":{\"name\":\"open\"}}\n// after\n?filters={\"state\":\"open\"}","handlingStrategy":"type-guard","validationCode":"def assert_leaf_values_scalar(leaf):\n    for k, v in leaf.items():\n        if isinstance(v, (list, tuple)):\n            continue\n        if not (v is None or isinstance(v, (str, int, float, bool))):\n            raise ValueError(f\"value for '{k}' must be scalar or null, got {type(v).__name__}\")","typeGuard":"function isScalarOrNull(v) {\n  return v === null || typeof v === 'string' || typeof v === 'number' || typeof v === 'boolean';\n}\nfunction leafValuesAreScalar(leaf) {\n  return Object.entries(leaf).every(([k, v]) => Array.isArray(v) || isScalarOrNull(v));\n}","tryCatchPattern":null,"preventionTips":["Send scalar IDs/names, not object representations, as field values.","Convert Python sets to lists before serializing."],"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"}