Skip to content

Releases: jprochazk/garde

v0.9.0

29 Mar 19:29
Compare
Choose a tag to compare

Breaking changes

  • garde::rules::length::Size was renamed to HasLength, and the size method to length
  • 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 to validate_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

29 Mar 15:52
Compare
Choose a tag to compare

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

27 Mar 22:54
Compare
Choose a tag to compare

Breaking changes

  • Added From<Result<(), Errors>> for Errors and Errors::finish to convert between the two easily

Other changes

  • Added more guide-level documentation on:
    • Implementing rules and Validate
    • Usage examples
    • Custom rules + context

Full Changelog: https://github.com/jprochazk/garde/compare/v0.7.0..v0.8.0

v0.7.0

27 Mar 21:01
Compare
Choose a tag to compare

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

Full Changelog: https://github.com/jprochazk/garde/compare/v0.6.1..v0.7.0

v0.6.1

27 Mar 00:31
Compare
Choose a tag to compare

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

27 Mar 00:09
Compare
Choose a tag to compare

Breaking changes

  • Implemented Validate for &T, various std types, like Vec, HashMap, pointers, and other containers.

Full Changelog: https://github.com/jprochazk/garde/commits/v0.6.0

v0.5.0

26 Mar 23:30
Compare
Choose a tag to compare

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 is fn(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

26 Mar 12:23
Compare
Choose a tag to compare

Breaking changes

  • The value in Unvalidated is no longer accessible directly, only through .validate. It may be created via deserialization ::new, or From<T: Validate.

Full Changelog: https://github.com/jprochazk/garde/commits/v0.4.0