diff options
author | Julian Berman <Julian+git@GrayVines.com> | 2012-09-28 14:42:15 -0400 |
---|---|---|
committer | Julian Berman <Julian+git@GrayVines.com> | 2012-09-28 14:42:15 -0400 |
commit | c5a94e7528af88e7aad882323b9a481ea0343115 (patch) | |
tree | 050f72711f33cd28bdc8070b27144a921beacf03 /README.rst | |
parent | da0b82da8f8bc020ee89ce825e94c1ab8e5cc4b5 (diff) | |
download | jsonschema-c5a94e7528af88e7aad882323b9a481ea0343115.tar.gz |
Update readme to use Draft3Validator
Diffstat (limited to 'README.rst')
-rw-r--r-- | README.rst | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -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'] |