diff options
author | Julian Berman <Julian@GrayVines.com> | 2020-03-04 17:12:02 +0200 |
---|---|---|
committer | Julian Berman <Julian@GrayVines.com> | 2020-11-22 21:01:02 -0500 |
commit | 521a02ca42b3c970531ac47ac524141949d42f25 (patch) | |
tree | f5dfd0965d264e56cecd6c84a3dd725cd891b2d0 /docs/errors.rst | |
parent | e5b0127d2c48ae4712b1baa27c077cd5147778b6 (diff) | |
download | jsonschema-draft2019-09.tar.gz |
WIPdraft2019-09
Diffstat (limited to 'docs/errors.rst')
-rw-r--r-- | docs/errors.rst | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/docs/errors.rst b/docs/errors.rst index 2b2f485..dbcecc0 100644 --- a/docs/errors.rst +++ b/docs/errors.rst @@ -140,7 +140,7 @@ These attributes can be clarified with a short example: } } instance = [{}, 3, "foo"] - v = Draft7Validator(schema) + v = Draft201909Validator(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. @@ -350,14 +350,14 @@ to guess the most relevant error in a given bunch. .. doctest:: - >>> from jsonschema import Draft7Validator + >>> from jsonschema import Draft201909Validator >>> from jsonschema.exceptions import best_match >>> schema = { ... "type": "array", ... "minItems": 3, ... } - >>> print(best_match(Draft7Validator(schema).iter_errors(11)).message) + >>> print(best_match(Draft201909Validator(schema).iter_errors(11)).message) 11 is not of type 'array' @@ -395,7 +395,7 @@ to guess the most relevant error in a given bunch. ... }, ... } >>> instance = {"name": 123, "phones": {"home": [123]}} - >>> errors = Draft7Validator(schema).iter_errors(instance) + >>> errors = Draft201909Validator(schema).iter_errors(instance) >>> [ ... e.path[-1] ... for e in sorted(errors, key=exceptions.relevance) |