Skip to content

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

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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