{"record":{"id":"705cb2ee5ddad435","repo":"deepset-ai/haystack","slug":"input-paths-for-wrapper-input-name-must-be-a-l","errorCode":null,"errorMessage":"Input paths for '{wrapper_input_name}' must be a list of strings.","messagePattern":"Input paths for '(.+?)' must be a list of strings\\.","errorType":"exception","errorClass":"InvalidMappingTypeError","httpStatus":null,"severity":"error","filePath":"haystack/core/super_component/super_component.py","lineNumber":200,"sourceCode":"    def _validate_input_mapping(\n        self, pipeline_inputs: dict[str, dict[str, Any]], input_mapping: dict[str, list[str]]\n    ) -> None:\n        \"\"\"\n        Validates the input mapping to ensure that specified components and sockets exist in the pipeline.\n\n        :param pipeline_inputs: A dictionary containing pipeline input specifications.\n        :param input_mapping: A dictionary mapping wrapper input names to pipeline socket paths.\n        :raises InvalidMappingTypeError:\n            If the input mapping is of invalid type or contains invalid types.\n        :raises InvalidMappingValueError:\n            If the input mapping contains nonexistent components or sockets.\n        \"\"\"\n        if not isinstance(input_mapping, dict):\n            raise InvalidMappingTypeError(\"input_mapping must be a dictionary\")\n\n        for wrapper_input_name, pipeline_input_paths in input_mapping.items():\n            if not isinstance(pipeline_input_paths, list):\n                raise InvalidMappingTypeError(f\"Input paths for '{wrapper_input_name}' must be a list of strings.\")\n            for path in pipeline_input_paths:\n                comp_name, socket_name = self._split_component_path(path)\n                if comp_name not in pipeline_inputs:\n                    raise InvalidMappingValueError(\n                        f\"Component '{comp_name}' not found in pipeline inputs.\\n\"\n                        f\"Available components: {list(pipeline_inputs.keys())}\"\n                    )\n                if socket_name not in pipeline_inputs[comp_name]:\n                    raise InvalidMappingValueError(\n                        f\"Input socket '{socket_name}' not found in component '{comp_name}'.\\n\"\n                        f\"Available inputs for '{comp_name}': {list(pipeline_inputs[comp_name].keys())}\"\n                    )\n\n    def _resolve_input_types_from_mapping(\n        self, pipeline_inputs: dict[str, dict[str, Any]], input_mapping: dict[str, list[str]]\n    ) -> dict[str, dict[str, Any]]:\n        \"\"\"\n        Resolves and validates input types based on the provided input mapping.","sourceCodeStart":182,"sourceCodeEnd":218,"githubUrl":"https://github.com/deepset-ai/haystack/blob/e318778c9bf60a1963e3b5f451359655dd696c30/haystack/core/super_component/super_component.py#L182-L218","documentation":"Each value of input_mapping must be a list of 'component.socket' strings. A value of another type (string, dict, tuple) raises InvalidMappingTypeError.","triggerScenarios":"input_mapping = {\"text\": \"embedder.text\"} (string instead of list) or {\"text\": (\"embedder.text\",)}.","commonSituations":"Forgetting the list brackets around a single path; mapping values copied from output_mapping-style dicts; config where one path is not wrapped in a list.","solutions":["Always use a list for values, even for a single path: {\"text\": [\"embedder.text\"]}"],"exampleFix":"// before\ninput_mapping = {\"text\": \"embedder.text\"}\n// after\ninput_mapping = {\"text\": [\"embedder.text\"]}","handlingStrategy":"validation","validationCode":"def normalize_input_mapping(mapping: dict) -> dict:\n    return {k: (v if isinstance(v, list) else [v]) for k, v in mapping.items()}","typeGuard":"def values_are_lists(mapping: dict) -> bool:\n    return all(isinstance(v, list) and all(isinstance(p, str) for p in v) for v in mapping.values())","tryCatchPattern":"from haystack.core.errors import InvalidMappingTypeError\ntry:\n    super_comp = SuperComponent(pipeline=pipe, input_mapping=input_mapping)\nexcept InvalidMappingTypeError as e:\n    if \"must be a list of strings\" in str(e):\n        input_mapping = normalize_input_mapping(input_mapping)\n        super_comp = SuperComponent(pipeline=pipe, input_mapping=input_mapping)\n    else:\n        raise","preventionTips":["Wrap single paths in a list: [\"comp.socket\"]","Use the normalize helper above when accepting user-supplied mappings","Document mapping shape in config schemas"],"tags":["super-component","input-mapping","type-validation"],"backgroundTag":"invalid-mapping-type","analyzedSha":"e318778c9bf60a1963e3b5f451359655dd696c30","analyzedAt":"2026-08-30T11:45:20.711Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}