{"record":{"id":"a35e4bba22193904","repo":"deepset-ai/haystack","slug":"component-name-of-type-type-component-nam-a35e4b","errorCode":null,"errorMessage":"Component '{name}' of type '{type(component).__name__}' has an unsupported value of type '{type(v).__name__}' in the serialized data under key '{k}'.","messagePattern":"Component '(.+?)' of type '(.+?)' has an unsupported value of type '(.+?)' in the serialized data under key '(.+?)'\\.","errorType":"exception","errorClass":"SerializationError","httpStatus":null,"severity":"error","filePath":"haystack/core/serialization.py","lineNumber":117,"sourceCode":"            if not is_allowed_type(v):\n                raise SerializationError(\n                    f\"Component '{name}' of type '{type(component).__name__}' has an unsupported value \"\n                    f\"of type '{type(v).__name__}' in the serialized data.\"\n                )\n            if isinstance(v, (list, set, tuple)):\n                check_iterable(v)\n            elif isinstance(v, dict):\n                check_dict(v)\n\n    def check_dict(d: dict[str, Any]) -> None:\n        if any(not isinstance(k, str) for k in d):\n            raise SerializationError(\n                f\"Component '{name}' of type '{type(component).__name__}' has a non-string key in the serialized data.\"\n            )\n\n        for k, v in d.items():\n            if not is_allowed_type(v):\n                raise SerializationError(\n                    f\"Component '{name}' of type '{type(component).__name__}' has an unsupported value \"\n                    f\"of type '{type(v).__name__}' in the serialized data under key '{k}'.\"\n                )\n            if isinstance(v, (list, set, tuple)):\n                check_iterable(v)\n            elif isinstance(v, dict):\n                check_dict(v)\n\n    check_dict(data)\n\n\ndef generate_qualified_class_name(cls: type[object]) -> str:\n    \"\"\"\n    Generates a qualified class name for a class.\n\n    :param cls:\n        The class whose qualified name is to be generated.\n    :returns:","sourceCodeStart":99,"sourceCodeEnd":135,"githubUrl":"https://github.com/deepset-ai/haystack/blob/e318778c9bf60a1963e3b5f451359655dd696c30/haystack/core/serialization.py#L99-L135","documentation":"Like error 330 but raised from check_dict: a value found under a specific dict key is not a JSON-serializable type. The message names the offending key so you can locate the bad field quickly. It enforces that component serialization output is fully JSON-safe.","triggerScenarios":"pipeline.dumps()/to_dict() where an init parameter under key 'k' holds an unsupported object (custom class instance, datetime, bytes, numpy value, set-of-custom-objects).","commonSituations":"Custom components with unconverted init parameters; a nested dict parameter containing arbitrary Python objects; third-party component upgrades introducing new parameter types.","solutions":["Open the component's to_dict() and convert the value under the reported key to a primitive or a typed dict with 'type'.","Add matching from_dict() logic to reconstruct the original object.","Convert the object to a supported type before passing it to the component.","If the value comes from a third-party component, report/upgrade the component."],"exampleFix":"// before\n{\"init_parameters\": {\"filters\": {\"created\": some_datetime}}}\n\n// after\n{\"init_parameters\": {\"filters\": {\"created\": some_datetime.isoformat()}}}","handlingStrategy":"validation","validationCode":"import json\ndef ensure_json_safe(component_dict) -> bool:\n    try:\n        json.dumps(component_dict)\n        return True\n    except (TypeError, ValueError):\n        return False","typeGuard":"def is_primitive(v) -> bool:\n    return v is None or isinstance(v, (str, int, float, bool)) or (isinstance(v, (list, dict, set, tuple)) )","tryCatchPattern":"from haystack.core.errors import SerializationError\ntry:\n    yaml_str = pipeline.dumps()\nexcept SerializationError as e:\n    # message names the offending key 'k'; fix that field in the component's to_dict\n    print(e)","preventionTips":["Sanity-check to_dict output with json.dumps in unit tests","Convert datetime/UUID/bytes to strings at serialization boundaries","Keep custom object serialization in dedicated to_dict/from_dict pairs with a 'type' discriminator"],"tags":["serialization","python","haystack"],"backgroundTag":"unsupported-serialization-type","analyzedSha":"e318778c9bf60a1963e3b5f451359655dd696c30","analyzedAt":"2026-08-30T11:45:20.711Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}