Skip to content

Commit

Permalink
Add some deprecated directives (for previous deprecations) to the docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
Julian committed Aug 30, 2022
1 parent ca96760 commit d67decc
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/validate.rst
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,10 @@ By default, no validation is enforced, but optionally, validation can be enabled
`jsonschema.exceptions.ValidationError.cause` attribute
of the resulting validation error.

.. deprecated:: v4.14.0

Use `FormatChecker.checks` on an instance instead.


.. autoexception:: FormatError
:noindex:
Expand Down
10 changes: 10 additions & 0 deletions jsonschema/protocols.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ class Validator(Protocol):
against instances. Ensure you've installed `jsonschema` with
its `extra (optional) dependencies <index:extras>` when
invoking ``pip``.
.. deprecated:: v4.12.0
Subclassing validator classes now explicitly warns this is not part of
their public API.
"""

#: An object representing the validator's meta schema (the schema that
Expand Down Expand Up @@ -171,6 +176,11 @@ def iter_errors(self, instance: Any) -> Iterable[ValidationError]:
... print(error.message)
4 is not one of [1, 2, 3]
[2, 3, 4] is too long
.. deprecated:: v4.0.0
Calling this function with a second schema argument is deprecated.
Use `Validator.evolve` instead.
"""

def validate(self, instance: Any) -> None:
Expand Down
2 changes: 2 additions & 0 deletions jsonschema/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -803,6 +803,8 @@ def base_uri(self):
def in_scope(self, scope):
"""
Temporarily enter the given scope for the duration of the context.
.. deprecated:: v4.0.0
"""
warnings.warn(
"jsonschema.RefResolver.in_scope is deprecated and will be "
Expand Down

0 comments on commit d67decc

Please sign in to comment.