From 3c5e42addf4fcabb952fb5fa41fba0a81b40dc91 Mon Sep 17 00:00:00 2001 From: Julian Berman Date: Thu, 3 May 2018 16:44:43 -0400 Subject: Draft 6 for docs. --- docs/errors.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'docs/errors.rst') 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) -- cgit v1.2.1