summaryrefslogtreecommitdiff
path: root/docs/errors.rst
diff options
context:
space:
mode:
authorJulian Berman <Julian@GrayVines.com>2018-05-03 16:44:43 -0400
committerJulian Berman <Julian@GrayVines.com>2018-05-03 16:44:43 -0400
commit3c5e42addf4fcabb952fb5fa41fba0a81b40dc91 (patch)
tree73df924f218c72ca37c3a18ab78403a9d18d6b31 /docs/errors.rst
parentd96ee1072bca7943459ce5141e584d8eb8c753a1 (diff)
downloadjsonschema-3c5e42addf4fcabb952fb5fa41fba0a81b40dc91.tar.gz
Draft 6 for docs.
Diffstat (limited to 'docs/errors.rst')
-rw-r--r--docs/errors.rst8
1 files changed, 4 insertions, 4 deletions
diff --git a/docs/errors.rst b/docs/errors.rst
index 324884f..11b77ea 100644
--- a/docs/errors.rst
+++ b/docs/errors.rst
@@ -137,7 +137,7 @@ These attributes can be clarified with a short example:
}
}
instance = [{}, 3, "foo"]
- v = Draft4Validator(schema)
+ v = Draft6Validator(schema)
errors = sorted(v.iter_errors(instance), key=lambda e: e.path)
The error messages in this situation are not very helpful on their own.
@@ -347,14 +347,14 @@ to guess the most relevant error in a given bunch.
.. doctest::
- >>> from jsonschema import Draft4Validator
+ >>> from jsonschema import Draft6Validator
>>> from jsonschema.exceptions import best_match
>>> schema = {
... "type": "array",
... "minItems": 3,
... }
- >>> print(best_match(Draft4Validator(schema).iter_errors(11)).message)
+ >>> print(best_match(Draft6Validator(schema).iter_errors(11)).message)
11 is not of type 'array'
@@ -423,7 +423,7 @@ to guess the most relevant error in a given bunch.
... },
... }
>>> instance = {"name": 123, "phones": {"home": [123]}}
- >>> errors = Draft4Validator(schema).iter_errors(instance)
+ >>> errors = Draft6Validator(schema).iter_errors(instance)
>>> [
... e.path[-1]
... for e in sorted(errors, key=exceptions.relevance)