microsoft/autogen · error · UnsupportedKeywordError
Unsupported or missing item type `{item_type_name}` for arra
Error message
Unsupported or missing item type `{item_type_name}` for array field `{key}` in `{model_name}` What it means
Error "Unsupported or missing item type `{item_type_name}` for array field `{key}` in `{model_name}`" thrown in microsoft/autogen.
Source
Thrown at python/packages/autogen-core/src/autogen_core/utils/_json_to_pydantic.py:277
elif json_type == "array":
if "minItems" in value:
constraints["min_length"] = value["minItems"]
if "maxItems" in value:
constraints["max_length"] = value["maxItems"]
item_schema = value.get("items", {"type": "string"})
if "$ref" in item_schema:
item_type = self.get_ref(item_schema["$ref"].split("/")[-1])
elif item_schema.get("type") == "object" and "properties" in item_schema:
# Handle array items that are objects with properties - create a nested model
# Use hash-based naming to keep names short and unique
item_model_name = self._get_item_model_name(key, model_name)
item_type = self._json_schema_to_model(item_schema, item_model_name, root_schema)
else:
item_type_name = item_schema.get("type")
if item_type_name is None:
item_type = str
elif item_type_name not in TYPE_MAPPING:
raise UnsupportedKeywordError(
f"Unsupported or missing item type `{item_type_name}` for array field `{key}` in `{model_name}`"
)
else:
item_type = TYPE_MAPPING[item_type_name]
base_type = conlist(item_type, **constraints) if constraints else List[item_type] # type: ignore[valid-type]
if "format" in value:
format_type = FORMAT_MAPPING.get(value["format"])
if format_type is None:
raise FormatNotSupportedError(f"Unknown format `{value['format']}` for `{key}` in `{model_name}`")
if not isinstance(format_type, type):
return format_type
if not issubclass(format_type, str):
return format_type
return format_type
return base_typeView on GitHub (pinned to 027ecf0a37)
Solutions
- Define a supported items type
Example fix
Set 'items': {'type': 'string'} (or other supported type) When it happens
Trigger: Thrown at python/packages/autogen-core/src/autogen_core/utils/_json_to_pydantic.py:277 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of microsoft/autogen@027ecf0a37 (2026-08-15).
Data as JSON: /api/errors/c77146d10b98bce6.
Report an issue: GitHub.