summaryrefslogtreecommitdiff
path: root/jsonschema
diff options
context:
space:
mode:
Diffstat (limited to 'jsonschema')
-rw-r--r--jsonschema/protocols.py9
-rw-r--r--jsonschema/validators.py2
2 files changed, 5 insertions, 6 deletions
diff --git a/jsonschema/protocols.py b/jsonschema/protocols.py
index 9d34f61..65f5898 100644
--- a/jsonschema/protocols.py
+++ b/jsonschema/protocols.py
@@ -11,8 +11,6 @@ from collections.abc import Callable, Mapping
from typing import TYPE_CHECKING, Any, ClassVar, Iterable
import sys
-from referencing.jsonschema import SchemaRegistry
-
# doing these imports with `try ... except ImportError` doesn't pass mypy
# checking because mypy sees `typing._SpecialForm` and
# `typing_extensions._SpecialForm` as incompatible
@@ -32,6 +30,7 @@ else:
if TYPE_CHECKING:
import jsonschema
import jsonschema.validators
+ import referencing.jsonschema
from jsonschema.exceptions import ValidationError
@@ -73,8 +72,8 @@ class Validator(Protocol):
.. deprecated:: v4.18.0
- `RefResolver` has been deprecated in favor of `referencing`,
- and with it, this argument.
+ `RefResolver <_RefResolver>` has been deprecated in favor of
+ `referencing`, and with it, this argument.
format_checker:
@@ -119,7 +118,7 @@ class Validator(Protocol):
def __init__(
self,
schema: Mapping | bool,
- registry: SchemaRegistry,
+ registry: referencing.jsonschema.SchemaRegistry,
format_checker: jsonschema.FormatChecker | None = None,
) -> None:
...
diff --git a/jsonschema/validators.py b/jsonschema/validators.py
index b802856..8ed275b 100644
--- a/jsonschema/validators.py
+++ b/jsonschema/validators.py
@@ -786,7 +786,7 @@ class _RefResolver:
.. deprecated:: v4.18.0
- `RefResolver` has been deprecated in favor of `referencing`.
+ ``RefResolver`` has been deprecated in favor of `referencing`.
"""
_DEPRECATION_MESSAGE = (