diff options
author | Stephen Rosen <sirosen@globus.org> | 2021-12-13 14:06:33 -0500 |
---|---|---|
committer | Stephen Rosen <sirosen@globus.org> | 2021-12-13 19:09:54 +0000 |
commit | 642a09f08318605b16563f47073d3e7b73025029 (patch) | |
tree | 4808693b8dbc5fad4184676e2bb6044fff4da52d /docs | |
parent | 5a99f6db52c18bce5143640677f77245dfbe5f95 (diff) | |
download | jsonschema-642a09f08318605b16563f47073d3e7b73025029.tar.gz |
Apply suggestions from code review
Primarily, rewrite `IValidator` to `Validator`
Co-authored-by: Julian Berman <Julian@GrayVines.com>
Diffstat (limited to 'docs')
-rw-r--r-- | docs/creating.rst | 2 | ||||
-rw-r--r-- | docs/errors.rst | 2 | ||||
-rw-r--r-- | docs/faq.rst | 2 | ||||
-rw-r--r-- | docs/validate.rst | 6 |
4 files changed, 6 insertions, 6 deletions
diff --git a/docs/creating.rst b/docs/creating.rst index 468e81d..b77edc4 100644 --- a/docs/creating.rst +++ b/docs/creating.rst @@ -27,7 +27,7 @@ where in the instance or schema respectively the error occurred. The Validator Protocol ---------------------- -``jsonschema`` defines a protocol, ``jsonschema.protocols.IValidator`` which +``jsonschema`` defines a `protocol <typing.Protocol>`, `jsonschema.protocols.Validator` which can be used in type annotations to describe the type of a validator object. For full details, see `validator-protocol`. diff --git a/docs/errors.rst b/docs/errors.rst index ceb5607..7cef27e 100644 --- a/docs/errors.rst +++ b/docs/errors.rst @@ -275,7 +275,7 @@ error objects. As you can see, `jsonschema.exceptions.ErrorTree` takes an iterable of `ValidationError`\s when constructing a tree so you can directly pass it the return value of a validator object's -`jsonschema.protocols.IValidator.iter_errors` method. +`jsonschema.protocols.Validator.iter_errors` method. `ErrorTree`\s support a number of useful operations. The first one we might want to perform is to check whether a given element in our instance diff --git a/docs/faq.rst b/docs/faq.rst index dbe0ef3..4fa2ac3 100644 --- a/docs/faq.rst +++ b/docs/faq.rst @@ -90,7 +90,7 @@ but fail the second! Still, filling in defaults is a thing that is useful. `jsonschema` allows you to `define your own validator classes and callables -<creating>`, so you can easily create an `jsonschema.protocols.IValidator` +<creating>`, so you can easily create an `jsonschema.protocols.Validator` that does do default setting. Here's some code to get you started. (In this code, we add the default properties to each object *before* the properties are validated, so the default values themselves will need to diff --git a/docs/validate.rst b/docs/validate.rst index 74c1221..576b0c5 100644 --- a/docs/validate.rst +++ b/docs/validate.rst @@ -21,17 +21,17 @@ The simplest way to validate an instance under a given schema is to use the .. _validator-protocol: -The Validator Interface +The Validator Protocol ----------------------- `jsonschema` defines a protocol that all validator classes should adhere to. -.. autoclass:: jsonschema.protocols.IValidator +.. autoclass:: jsonschema.protocols.Validator :members: All of the `versioned validators <versioned-validators>` that are included with -`jsonschema` adhere to the interface, and implementers of validator classes +`jsonschema` adhere to the protocol, and implementers of validator classes that extend or complement the ones included should adhere to it as well. For more information see `creating-validators`. |