From 7ebe1614ce0d30e43e34e7543550a6a7420b508f Mon Sep 17 00:00:00 2001 From: Julian Berman Date: Tue, 29 Nov 2022 11:42:21 -0500 Subject: [PATCH] Try fixing more Sphinx refs which fail only on Ubuntu... --- docs/validate.rst | 2 +- jsonschema/protocols.py | 3 ++- jsonschema/validators.py | 6 +++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/docs/validate.rst b/docs/validate.rst index 3d04a9a54..c3b51dd84 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 ` function. .. autofunction:: validate :noindex: diff --git a/jsonschema/protocols.py b/jsonschema/protocols.py index 2a8f00dda..5f52166fa 100644 --- a/jsonschema/protocols.py +++ b/jsonschema/protocols.py @@ -29,6 +29,7 @@ # 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 6ceb75f1f..a13224405 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