{"record":{"id":"b6db1f52d5ddd6bd","repo":"microsoft/autogen","slug":"unsupported-or-missing-type-json-type-in-union","errorCode":null,"errorMessage":"Unsupported or missing type `{json_type}` in union","messagePattern":"Unsupported or missing type `(.+?)` in union","errorType":"exception","errorClass":"UnsupportedKeywordError","httpStatus":null,"severity":"error","filePath":"python/packages/autogen-core/src/autogen_core/utils/_json_to_pydantic.py","lineNumber":187,"sourceCode":"            for k, v in schema.items():\n                if k not in {\"allOf\", \"properties\", \"required\"}:\n                    merged[k] = v\n            merged[\"required\"] = list(set(merged[\"required\"]))\n            schema = merged\n\n        return self._json_schema_to_model(schema, model_name, root_schema)\n\n    def _resolve_union_types(self, schemas: List[Dict[str, Any]]) -> List[Any]:\n        types: List[Any] = []\n        for s in schemas:\n            if \"$ref\" in s:\n                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\"]","sourceCodeStart":169,"sourceCodeEnd":205,"githubUrl":"https://github.com/microsoft/autogen/blob/027ecf0a379bcc1d09956d46d12d44a3ad9cee14/python/packages/autogen-core/src/autogen_core/utils/_json_to_pydantic.py#L169-L205","documentation":"Error \"Unsupported or missing type `{json_type}` in union\" thrown in microsoft/autogen.","triggerScenarios":"Thrown at python/packages/autogen-core/src/autogen_core/utils/_json_to_pydantic.py:187 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use only supported JSON types inside unions"],"exampleFix":"Replace the unsupported union member with a supported type","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-15T17:31:12.345Z"}