Releases: jprochazk/garde
Releases · jprochazk/garde
v0.9.0
Breaking changes
garde::rules::length::Size
was renamed toHasLength
, and thesize
method tolength
- All rule traits working on string types now have blanket impls over
AsRef<str>
. This includes:alphanumeric
ascii
contains
credit_card
email
ip
pattern
phone_number
prefix
suffix
url
- Rule trait methods were renamed to match the pattern
validate_<rule>
, e.g.garde::rules::Url::try_parse_url
was changed tovalidate_url
.
Other changes
All the rule traits should now be fully documented.
Full Changelog: https://github.com/jprochazk/garde/compare/v0.8.1..v0.9.0
v0.8.1
Fixes
- Errors in rules were not being propagated correctly.
Before:
#[derive(Debug, garde::Validate)]
struct Test {
#[garde(length(min = -10))] // error: unrecognized rule
field: String,
}
After:
#[derive(Debug, garde::Validate)]
struct Test {
#[garde(length(min = -10))] // error: value must be a valid `usize`: invalid digit found in string
field: String,
}
Full Changelog: https://github.com/jprochazk/garde/compare/v0.8.0..v0.8.1
v0.8.0
Breaking changes
- Added
From<Result<(), Errors>> for Errors
andErrors::finish
to convert between the two easily
Other changes
- Added more guide-level documentation on:
- Implementing rules and
Validate
- Usage examples
- Custom rules + context
- Implementing rules and
Full Changelog: https://github.com/jprochazk/garde/compare/v0.7.0..v0.8.0
v0.7.0
Breaking changes
- Added
skip
rule - Each field in a struct or enum annotated
#[derive(garde::Validate)]
must now have:- At least one validation rule
- The
dive
rule, which performs validation of the nested value - The
skip
rule, which skips validating that field
What's Changed
- Require some validation or skip by @jprochazk in #17
Full Changelog: https://github.com/jprochazk/garde/compare/v0.6.1..v0.7.0
v0.6.1
Fixes
- Fixed deriving
Validate
for enums with tuple/struct variants that had more than one field
Full Changelog: https://github.com/jprochazk/garde/commits/v0.6.1
v0.6.0
Breaking changes
- Implemented
Validate
for&T
, variousstd
types, likeVec
,HashMap
, pointers, and other containers.
Full Changelog: https://github.com/jprochazk/garde/commits/v0.6.0
v0.5.0
Breaking changes
garde::error::Errors
type was changed to an enum (more explanation in #15)- Every rule in
garde::rules::*
now accepts constraint parameters as a tuple, e.g.prefix
isfn(value; &str, (pattern,): (&str,)) -> Result<(), Error>
What's Changed
- Implement nested validation and nested errors by @jprochazk in #15
Full Changelog: https://github.com/jprochazk/garde/commits/v0.5.0
v0.4.0
Breaking changes
- The value in
Unvalidated
is no longer accessible directly, only through.validate
. It may be created via deserialization::new
, orFrom<T: Validate.
Full Changelog: https://github.com/jprochazk/garde/commits/v0.4.0