diff options
-rw-r--r-- | docs/validate.rst | 2 | ||||
-rw-r--r-- | jsonschema/protocols.py | 3 | ||||
-rw-r--r-- | jsonschema/validators.py | 6 |
3 files changed, 6 insertions, 5 deletions
diff --git a/docs/validate.rst b/docs/validate.rst index 3d04a9a..c3b51dd 100644 --- a/docs/validate.rst +++ b/docs/validate.rst @@ -16,7 +16,7 @@ The Basics ---------- The simplest way to validate an instance under a given schema is to use the -:func:`validate` function. +`validate <jsonschema.validators.validate>` function. .. autofunction:: validate :noindex: diff --git a/jsonschema/protocols.py b/jsonschema/protocols.py index 2a8f00d..5f52166 100644 --- a/jsonschema/protocols.py +++ b/jsonschema/protocols.py @@ -29,6 +29,7 @@ else: # but use `jsonschema` for any types which will otherwise not be resolvable if TYPE_CHECKING: import jsonschema + import jsonschema.validators from jsonschema.exceptions import ValidationError @@ -107,7 +108,7 @@ class Validator(Protocol): def __init__( self, schema: Mapping | bool, - resolver: jsonschema.RefResolver | None = None, + resolver: jsonschema.validators.RefResolver | None = None, format_checker: jsonschema.FormatChecker | None = None, ) -> None: ... diff --git a/jsonschema/validators.py b/jsonschema/validators.py index 6ceb75f..a132244 100644 --- a/jsonschema/validators.py +++ b/jsonschema/validators.py @@ -1060,9 +1060,9 @@ def validate(instance, schema, cls=None, *args, **kwargs): ... ValidationError: [2, 3, 4] is too long - :func:`validate` will first verify that the provided schema is - itself valid, since not doing so can lead to less obvious error - messages and fail in less obvious or consistent ways. + :func:`~jsonschema.validators.validate` will first verify that the + provided schema is itself valid, since not doing so can lead to less + obvious error messages and fail in less obvious or consistent ways. If you know you have a valid schema already, especially if you intend to validate multiple instances with |