aboutsummaryrefslogtreecommitdiffstats
path: root/validator_derive/tests/compile-fail
AgeCommit message (Collapse)Author
2020-04-12Fix CIVincent Prouillet
2019-04-28Issue #69: Change `range` to require only one argCaroline Glassberg-Powell
Currently range is hard-coded to take both max and min. This is unhelpful in cases where we may only want to check one of the bounds. Update so that it behaves more like the `length` validator and can take either max or min, as well as both. Also ensure that at least one of them is supplied.
2018-09-13Nested Validation (#60)Simon Sparks
* Nested Validation Added support for a plain validate attribute on a struct's field to imply that validate() should be called on it with results being merged. Validation errors are now keyed with a string that indicates the path to the invalid field within a complex data structure. The errors themselves also include the path to the invalid field, expressed as a vector of strings. Added support for option and vector fields where the wrapped values perform nested validation. Refactored vector wrapping for more reusable nested validation quoting. Vector index is now more conveniently represented as an individual item in the ValidationError's path attribute. A few ergonomic changes to support custom (i.e. non-derived) Validate implementations. A custom Validator implementation may either implement the validate() method as before or implement the new validate_path(ValidationPath) method which gives context of where the validation is taking place in a complex data structure. It is not necessary to implement both methods. Refactored ValidationErrors to adopt a structure reflecting that of the data being validated. Instead of holding a vector of ValidationError instances for each field, the ValidationErrors map may now include 3 different kinds of error values representing the field, nested struct and nested vector of struct scenarios. Note that this implies a breaking change to the ValidationErrors map and the "inner" method signature for accessing errors programmatically compared to previous versions. Added new accessor methods to the ValidationErrors type for retrieving either field-level errors for a validated struct or all errors for the struct and it's nested children. The existing `inner` method provides the field-level behaviour for backwards compatibility and has been marked as deprecated. Documented the new associated functions of the ValidationErrors implementation and removed unnecessary feature declaration in a test module. Refactored tests to use the new `field_errors` accessor method. Updated README.md to describe nested validation behaviour. Keats/validator#31
2018-07-27Added support for validating Cow<'a, str> fields. (#56)Simon Sparks
* Added support for validating Cow<'a, str> fields. Keats/validator#55 * Corrected error message comparison in compiler-fail/length test. Keats/validator#55
2017-05-28RevampVincent Prouillet
2017-02-14Fix compile fail testsVincent Prouillet
2017-01-28Update depsVincent Prouillet
2017-01-19Make it work with lifetimesVincent Prouillet
2017-01-17Remove need for attr_literalsVincent Prouillet
2017-01-16Struct level validationVincent Prouillet
2016-12-29Added must_matchVincent Prouillet
2016-12-28Initial commitVincent Prouillet