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

Is there a way to deserialize discriminated union?

Open hellozyemlya opened this issue 1 year ago • 1 comments

I have model A and model B, discriminated by type field. In pydantic I can use TypeAdapter(A | B).validate_json() to parse A or B. But how I can do the same with pydantic-xml?

hellozyemlya avatar Feb 07 '25 09:02 hellozyemlya

@hellozyemlya Hi

No, there is no such functionality in pydantic-xml.

dapper91 avatar Feb 09 '25 15:02 dapper91