pydantic-xml icon indicating copy to clipboard operation
pydantic-xml copied to clipboard

[Question] Why i cant't use type Dict\dict without specifying keys and values type for xml model field typing

Open Molandrious opened this issue 7 months ago • 1 comments

e.x.

class SomeModel(BaseXmlModel):
    dict_content: Dict

    @field_validator('dict_content', mode="before")
    def _check_dict_content(
        cls,
        value: Any,
    ) -> Any:
        try:
            return orjson.loads(value)
        except orjson.JSONDecodeError as exc:
            capture_exception(exc)
            pass
        return {}

if worked on version 1.0.0 but after i updated code to pydantic v2 and pydantic_xml 2.11.0 it breaks

Molandrious avatar Jul 15 '24 10:07 Molandrious