s-knibbs / dataclasses-jsonschema

JSON schema generation from dataclasses
MIT License
166 stars 38 forks source link

Support PEP 604 types #153

Closed s-knibbs closed 3 years ago

s-knibbs commented 3 years ago

Mypy 0.800 now supports PEP 604. To make use of this here for python < 3.10, we'd need to re-implement get_type_hints from the typing module and use an ast transformation to turn this:

str | int | None

into this:

typing.Union[str, int, NoneType]