microsoft/autogen · error · UnsupportedKeywordError

Unsupported or missing type `{json_type}` for field `{key}`

Error message

Unsupported or missing type `{json_type}` for field `{key}` in `{model_name}`

What it means

Error "Unsupported or missing type `{json_type}` for field `{key}` in `{model_name}`" thrown in microsoft/autogen.

Source

Thrown at python/packages/autogen-core/src/autogen_core/utils/_json_to_pydantic.py:218

                        else:
                            item_type = TYPE_MAPPING[item_type_name]

                    constraints = {}
                    if "minItems" in s:
                        constraints["min_length"] = s["minItems"]
                    if "maxItems" in s:
                        constraints["max_length"] = s["maxItems"]

                    array_type = conlist(item_type, **constraints) if constraints else List[item_type]  # type: ignore[valid-type]
                    types.append(array_type)
                else:
                    types.append(TYPE_MAPPING[json_type])
        return types

    def _extract_field_type(self, key: str, value: Dict[str, Any], model_name: str, root_schema: Dict[str, Any]) -> Any:
        json_type = value.get("type")
        if json_type not in TYPE_MAPPING:
            raise UnsupportedKeywordError(
                f"Unsupported or missing type `{json_type}` for field `{key}` in `{model_name}`"
            )

        base_type = TYPE_MAPPING[json_type]
        constraints: Dict[str, Any] = {}

        if json_type == "string":
            if "minLength" in value:
                constraints["min_length"] = value["minLength"]
            if "maxLength" in value:
                constraints["max_length"] = value["maxLength"]
            if "pattern" in value:
                constraints["pattern"] = value["pattern"]
            if constraints:
                base_type = constr(**constraints)

        elif json_type == "integer":
            if "minimum" in value:

View on GitHub (pinned to 027ecf0a37)

Solutions

  1. Specify a supported type for the field

Example fix

Add a valid 'type' for the field in the schema

When it happens

Trigger: Thrown at python/packages/autogen-core/src/autogen_core/utils/_json_to_pydantic.py:218 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/64183342ca866c0a. Report an issue: GitHub.