docs/examples/subclass_union.md
raw| 1 | # Class as union of its subclasses |
| 2 | |
| 3 | *Inspired by [https://github.com/samuelcolvin/pydantic/issues/2036](https://github.com/samuelcolvin/pydantic/issues/2036)* |
| 4 | |
| 5 | A class can easily be deserialized as a union of its subclasses using deserializers. Indeed, when more than one deserializer is registered, it results in a union. |
| 6 | |
| 7 | ```python |
| 8 | {!examples/subclass_union.py!} |
| 9 | ``` |