dry-validation v0.10.0 Release Notes
Release Date: 2016-09-21 // over 7 years ago-
โ Added
- ๐ Support for
validate
DSL which accepts an arbitratry validation block that gets executed in the context of a schema object and is treated as a custom predicate (solnic) - ๐ Support for
or
error messages ie "must be a string or must be an integer" (solnic) - ๐ Support for retrieving error messages exclusively via
schema.(input).errors
(solnic) - ๐ Support for retrieving hint messages exclusively via
schema.(input).hints
(solnic) - Support for opt-in extensions loaded via
Dry::Validation.load_extensions(:my_ext)
(flash-gordon) - โ Add
:monads
extension which transforms a result instance toEither
monad,schema.(input).to_either
(flash-gordon) - โ Add
dry-struct
integration via an extension activated byDry::Validation.load_extensions(:struct)
(flash-gordon)
๐ Fixed
- Input rules (defined via
input
macro) are now lazy-initialized which makes it work with predicates defined on the schema object (solnic) - Hints are properly generated based on argument type in cases like
size?
, where the message should be different for strings (uses "length") or other types (uses "size") (solnic) - Defining nested keys without
schema
blocks results inArgumentError
(solnic)
๐ Changed
- ๐ [BREAKING]
when
macro no longer supports multiple disconnected rules in its block, whatever the block returns will be used for the implication (solnic) - [BREAKING]
rule(some_name: %i(some keys))
will always use:some_name
as the key for failure messages (solnic)
- ๐ Support for