aboutsummaryrefslogtreecommitdiffstats
path: root/validator_derive
AgeCommit message (Collapse)Author
2020-05-27Add a blanket Validate implementation for referencesLucas Pickering
2020-04-12Fix CIVincent Prouillet
2019-10-17Fix bug + cargo fmtVincent Prouillet
2019-10-14Update depsVincent Prouillet
2019-10-14Add utf-8 non-control chars validatorAndras Mocsary
2019-07-13Update if_chainVincent Prouillet
2019-05-01Cargo fmt + edition 2018 for validatorVincent Prouillet
2019-05-01attr_literals is stable \o/Vincent Prouillet
2019-05-01Update deps of validator_deriveVincent 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-19Update deps of validatorVincent Prouillet
2018-09-19Prepare for 0.8.0 releaseVincent Prouillet
2018-09-13Update synVincent Prouillet
2018-09-13RustfmtVincent Prouillet
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-27Prepare releaseVincent Prouillet
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
2018-06-28Prepare for releaseVincent Prouillet
2018-06-20Update syn, quote and bump versionBastien Orivel
2018-05-29Some more tweaksVincent Prouillet
2018-05-29Prepare for releaseVincent Prouillet
2018-05-15feature gate card validatorErin
2018-04-14Update syn and quoteVincent Prouillet
2018-04-13fix path parsing for regex validatorsErin
see also: 8ca1fe94d779dcccf4b3f4c23a08f3ede7e10956
2018-03-20Update changelogVincent Prouillet
2018-03-20Merge pull request #44 from csharad/double-optionVincent Prouillet
Support for validating Option<Option<T>>. Fixes #41
2018-03-18Fix path parsing for custom validatorsBastien Orivel
`::foo::bar` isn't a valid ident in syn 0.12. This lead to some code failing to compile if it was using paths as custom validators. This fixes it and adds a test.
2018-03-18Added test to validate None valuesSharad Chand
2018-03-18Added Option<Option<Vec<T>> field to testSharad Chand
2018-03-18Added complex testsSharad Chand
2018-03-18Optional validator params and wraping for Option<Option<T>>Sharad Chand
2018-03-18Added assertions for Option<Option<T>>Sharad Chand
2018-03-16Bump versionBastien Orivel
2018-03-16Bump syn to 0.12 and quote to 0.4Bastien Orivel
2018-01-28Don't emit a warning when a struct with no validator derives ValidateBastien Orivel
2018-01-25Update some dependenciesVincent Prouillet
2017-12-17Move extraction of message and code in single functiongtors
2017-11-08Feature gate phone feature in validator_derive as wellVincent Prouillet
2017-11-08Update changelog and versionsVincent Prouillet
2017-11-08Add missing credit_card derive implVincent Prouillet
2017-11-08Merge branch 'master' of https://github.com/valeriansaliou/validator into ↵Vincent Prouillet
valeriansaliou-master
2017-11-07Ability to validate an international phone numberValerian Saliou
Signed-off-by: Valerian Saliou <valerian@valeriansaliou.name> Derives for the ‘phone’ validator (still unsure about it) Signed-off-by: Valerian Saliou <valerian@valeriansaliou.name> Fix review Merge + Add missing documented ‘credit_cards’ feature Signed-off-by: Valerian Saliou <valerian@valeriansaliou.name> Fix Signed-off-by: Valerian Saliou <valerian@valeriansaliou.name> Fix Signed-off-by: Valerian Saliou <valerian@valeriansaliou.name> Merge Signed-off-by: Valerian Saliou <valerian@valeriansaliou.name> ‘credit_cards’ feature is no longer needed as per #33 Signed-off-by: Valerian Saliou <valerian@valeriansaliou.name>
2017-09-28[#29] Add test for `?` operatorDmitry Vdovin
2017-08-12Update validator_derive to use crates.io for validatorVincent Prouillet
2017-07-19Update readmeVincent Prouillet
2017-05-28RevampVincent Prouillet
2017-05-22v0.5.0 of validator_deriveVincent Prouillet
2017-05-22Update serde to 1.0Vincent Prouillet
2017-05-22Add test for Option in range validatorVincent Prouillet
2017-05-22Added missing signs; fixes issue #23René Perschon