Skip to content

Deserialize Generics/Collections in Union Types

Compare
Choose a tag to compare
@malcolmgreaves malcolmgreaves released this 20 Jan 06:27
· 14 commits to main since this release
5d0f77d

Bugfix: support for properly deserializing Union types that contain generics (e.g. collection types such as List, Dict, etc.). In general, the following will work now:

deserialize(Union[A[B], C[D]], x)

For @dataclass(frozen=True) class A(Generic[B]) and @dataclass(frozen=True) class C(Generic[D]).