summaryrefslogtreecommitdiff
path: root/README.rst
diff options
context:
space:
mode:
authorJulian Berman <Julian+git@GrayVines.com>2012-09-28 14:42:15 -0400
committerJulian Berman <Julian+git@GrayVines.com>2012-09-28 14:42:15 -0400
commitc5a94e7528af88e7aad882323b9a481ea0343115 (patch)
tree050f72711f33cd28bdc8070b27144a921beacf03 /README.rst
parentda0b82da8f8bc020ee89ce825e94c1ab8e5cc4b5 (diff)
downloadjsonschema-c5a94e7528af88e7aad882323b9a481ea0343115.tar.gz
Update readme to use Draft3Validator
Diffstat (limited to 'README.rst')
-rw-r--r--README.rst12
1 files changed, 6 insertions, 6 deletions
diff --git a/README.rst b/README.rst
index ca2df50..1937029 100644
--- a/README.rst
+++ b/README.rst
@@ -41,14 +41,14 @@ Features
::
- >>> from jsonschema import Validator
+ >>> from jsonschema import Draft3Validator
>>> schema = {
... "type" : "array",
... "items" : {"enum" : [1, 2, 3]},
... "maxItems" : 2,
... }
- >>> v = Validator()
- >>> for error in sorted(v.iter_errors([2, 3, 4], schema), key=str):
+ >>> v = Draft3Validator(schema)
+ >>> for error in sorted(v.iter_errors([2, 3, 4]), key=str):
... print(error)
4 is not one of [1, 2, 3]
[2, 3, 4] is too long
@@ -59,15 +59,15 @@ Features
::
- >>> from jsonschema import ErrorTree, Validator
+ >>> from jsonschema import ErrorTree, Draft3Validator
>>> schema = {
... "type" : "array",
... "items" : {"type" : "number", "enum" : [1, 2, 3]},
... "minItems" : 3,
... }
>>> instance = ["spam", 2]
- >>> v = Validator()
- >>> tree = ErrorTree(v.iter_errors(instance, schema))
+ >>> v = Draft3Validator(schema)
+ >>> tree = ErrorTree(v.iter_errors(instance))
>>> sorted(tree.errors)
['minItems']