We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Schema
I recently saw python/typing#182 (comment) proposing a nice trick for type-checking JSON data, and it occured to me that this could be extended to define version-specific Schema types using TypedDict. See also python-jsonschema/jsonschema#766 and python-jsonschema/jsonschema#778 - if we get a working implementation, this would probably be suitable for upstreaming.
TypedDict
For example, this would allow for static detection of exclusiveMaximum as either bool or int | float depending on the schema draft version.
exclusiveMaximum
bool
int | float
The text was updated successfully, but these errors were encountered:
Mypy 0.990 has native support for recursive types, so this is now possible without hacks.
Sorry, something went wrong.
No branches or pull requests
I recently saw python/typing#182 (comment) proposing a nice trick for type-checking JSON data, and it occured to me that this could be extended to define version-specific
Schema
types usingTypedDict
. See also python-jsonschema/jsonschema#766 and python-jsonschema/jsonschema#778 - if we get a working implementation, this would probably be suitable for upstreaming.For example, this would allow for static detection of
exclusiveMaximum
as eitherbool
orint | float
depending on the schema draft version.The text was updated successfully, but these errors were encountered: