This package provides static type annotations (stubs) for the `jsonschema` library, enabling tools like `mypy` to perform static analysis on code that uses `jsonschema`. It's part of the typeshed project, a community effort to add types to popular Python packages. The current version, `4.26.0.20260408`, typically tracks the `jsonschema` library's version, with a datestamp for stub updates.
pip install types-jsonschemaNo compatibility data collected yet for this library.
Demonstrates basic `jsonschema` validation. When `types-jsonschema` is installed, static type checkers like `mypy` can analyze calls to `jsonschema` functions, providing type hints for arguments and return values, and catching potential type-related errors in your use of `jsonschema` at design time.
Install the runtime library: `pip install jsonschema`.
Continue importing symbols directly from `jsonschema`. Ensure your type checker is configured to use installed stub packages.
Always ensure your `types-jsonschema` stub version is compatible with your `jsonschema` runtime version to avoid unexpected type errors or missing type hints.
Always update `types-jsonschema` when upgrading to a new major version of `jsonschema` to ensure type hint accuracy and compatibility.
Install the type stub package: `pip install types-jsonschema`
Import from the `jsonschema` library instead: `from jsonschema import validate`
Install the `types-jsonschema` package (`pip install types-jsonschema`) and ensure it's compatible with your `jsonschema` version.
Ensure the argument's type matches the expected type in the stub; this might involve subclassing `jsonschema.protocols.Validator` for custom validators or providing correctly typed arguments.