diff options
| author | Thomas Churchman | 2019-11-13 09:18:04 +0100 | 
|---|---|---|
| committer | GitHub | 2019-11-13 09:18:04 +0100 | 
| commit | 0d237f50b81503b51f3b6632cc73c9184f36a375 (patch) | |
| tree | 91cb33ce40997bc2a97a5ebdd10fd51e41d755e3 /README.md | |
| parent | 0153ed9bf9af0fa21296d8f6ab9f62b702642c02 (diff) | |
| download | validator-0d237f50b81503b51f3b6632cc73c9184f36a375.tar.bz2 | |
Update struct level validation in README
Struct-level validation has been changed in b31fd25cc5cec96ccee737ba1313c6e9f702f32a, but it appears the README was not completely updated: the return value for struct-level validation refers to the old functionality.
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 6 | 
1 files changed, 2 insertions, 4 deletions
| @@ -280,14 +280,12 @@ struct CategoryData {  }  ``` -The function mentioned should return a `Option<(String, String)>` where the tuple is (key error, error code) -and will be called after validation is done for all fields. -This means that the error can be reported on an existing field or on a new key. +The function mentioned should return a `Result<(), ValidationError>` and will be called after validation is done for all fields.  The `skip_on_field_errors` defaults to `true` if not present and will ensure that the function is not called  if an error happened while validating the struct fields. -Any error on the schema level validation will appear in the key `__all__` of the hashmap of errors. +Any error on the struct level validation will appear in the key `__all__` of the hashmap of errors.  ## Message and code | 
