File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ These attributes can be clarified with a short example:
62
62
... }
63
63
>> > instance = [{}, 3 , " foo" ]
64
64
>> > v = Draft4Validator(schema)
65
- >> > errors = list (v.iter_errors(instance))
65
+ >> > errors = sorted (v.iter_errors(instance), key = lambda e : e.path )
66
66
67
67
The error messages in this situation are not very helpful on their own:
68
68
@@ -103,7 +103,7 @@ the schema each of these errors come from. In the case of sub-errors from the
103
103
.. code-block :: python
104
104
105
105
>> > for e in errors:
106
- ... for sube in e.context:
106
+ ... for sube in sorted ( e.context, key = lambda e : e.schema_path :
107
107
... print list (sube.schema_path), sube
108
108
[0 , ' type' ] {} is not of type ' string'
109
109
[1 , ' type' ] {} is not of type ' integer'
You can’t perform that action at this time.
0 commit comments