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 to Either monad, schema.(input).to_either (flash-gordon)
    • โž• Add dry-struct integration via an extension activated by Dry::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 in ArgumentError (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)

    Compare v0.9.5...v0.10.0