{"record":{"id":"7bffd49bd4c94c76","repo":"microsoft/autogen","slug":"unsupported-item-type-item-type-name-in-union","errorCode":null,"errorMessage":"Unsupported item type `{item_type_name}` in union array","messagePattern":"Unsupported item type `(.+?)` in union array","errorType":"exception","errorClass":"UnsupportedKeywordError","httpStatus":null,"severity":"error","filePath":"python/packages/autogen-core/src/autogen_core/utils/_json_to_pydantic.py","lineNumber":199,"sourceCode":"                types.append(self.get_ref(s[\"$ref\"].split(\"/\")[-1]))\n            elif \"enum\" in s:\n                types.append(Literal[tuple(s[\"enum\"])] if len(s[\"enum\"]) > 0 else Any)\n            else:\n                json_type = s.get(\"type\")\n                if json_type not in TYPE_MAPPING:\n                    raise UnsupportedKeywordError(f\"Unsupported or missing type `{json_type}` in union\")\n\n                # Handle array types with items specification\n                if json_type == \"array\" and \"items\" in s:\n                    item_schema = s[\"items\"]\n                    if \"$ref\" in item_schema:\n                        item_type = self.get_ref(item_schema[\"$ref\"].split(\"/\")[-1])\n                    else:\n                        item_type_name = item_schema.get(\"type\")\n                        if item_type_name is None:\n                            item_type = str\n                        elif item_type_name not in TYPE_MAPPING:\n                            raise UnsupportedKeywordError(f\"Unsupported item type `{item_type_name}` in union array\")\n                        else:\n                            item_type = TYPE_MAPPING[item_type_name]\n\n                    constraints = {}\n                    if \"minItems\" in s:\n                        constraints[\"min_length\"] = s[\"minItems\"]\n                    if \"maxItems\" in s:\n                        constraints[\"max_length\"] = s[\"maxItems\"]\n\n                    array_type = conlist(item_type, **constraints) if constraints else List[item_type]  # type: ignore[valid-type]\n                    types.append(array_type)\n                else:\n                    types.append(TYPE_MAPPING[json_type])\n        return types\n\n    def _extract_field_type(self, key: str, value: Dict[str, Any], model_name: str, root_schema: Dict[str, Any]) -> Any:\n        json_type = value.get(\"type\")\n        if json_type not in TYPE_MAPPING:","sourceCodeStart":181,"sourceCodeEnd":217,"githubUrl":"https://github.com/microsoft/autogen/blob/027ecf0a379bcc1d09956d46d12d44a3ad9cee14/python/packages/autogen-core/src/autogen_core/utils/_json_to_pydantic.py#L181-L217","documentation":"Error \"Unsupported item type `{item_type_name}` in union array\" thrown in microsoft/autogen.","triggerScenarios":"Thrown at python/packages/autogen-core/src/autogen_core/utils/_json_to_pydantic.py:199 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Give the array a supported item type"],"exampleFix":"Set items to a supported type in the union array schema","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"027ecf0a379bcc1d09956d46d12d44a3ad9cee14","analyzedAt":"2026-08-15T03:38:00.719Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}