mdrachuk / serious

Dataclass Model Toolkit
https://serious.readthedocs.io
MIT License
7 stars 1 forks source link

Support Union type #47

Closed mdrachuk closed 1 year ago

mdrachuk commented 1 year ago

A JSON with format below will be created for Union types:

@dataclass
class Everything:
    everywhere: Union[str, int, float]

Everything(everywhere="test!")
# {"everywhere": {"__type__": "str", "__value__": "test!"}}