Skip to content

Idea: detailed version-specific type annotations for Schema #91

Open
@Zac-HD

Description

@Zac-HD

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.

For example, this would allow for static detection of exclusiveMaximum as either bool or int | float depending on the schema draft version.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions