Recent Releases of https://github.com/dry-rb/dry-validation
https://github.com/dry-rb/dry-validation - v1.11.1
Fixed
- Fixed warning about unused block in macros (@flash-gordon)
- Ruby
Published by dry-bot about 1 year ago
https://github.com/dry-rb/dry-validation - v1.11.0
Changed
- Passing non-hash values to
Contract#callnow raises a meaningful error (issue #716 via #723) (@flash-gordon) - Set minimum Ruby version to 3.1 (@flash-gordon)
- Ruby
Published by dry-bot about 1 year ago
https://github.com/dry-rb/dry-validation - v1.10.0
This release is mostly about upgrading to dry-core 1.0 and dry-configurable 1.0. One of the outcomes is dropping dependency on dry-container (because it was moved to dry-core). If you happen to use dry-container, please switch to Dry::Core::Container.
Changed
- Upgraded to the latest versions of dry-{core,configurable,logic,types} (@flash-gordon + @solnic)
- Ruby
Published by dry-bot over 3 years ago
https://github.com/dry-rb/dry-validation - v1.9.0
Fixed
- Duplicated keys mishandling in rule evaluation (issue #676 fixed via #711) (@mereghost)
Changed
- Use Zeitwerk for auto-loading (via #715) (@solnic)
- Ruby
Published by dry-bot over 3 years ago
https://github.com/dry-rb/dry-validation - v1.8.1
Fixed
- Raise an InvalidKeyErrors on substring of valid keys (issue #705 fixed via #706) (@MatElGran)
- Using
rule(:arr).each { .. }doesn't crash when:arrturns out to benil(issue #708 fixed via #709) (@bautrey37)
- Ruby
Published by dry-bot almost 4 years ago
https://github.com/dry-rb/dry-validation - v1.8.0
Added
- New rule helper
base_rule_error?which checks if there's any base error set (via #690) (@wuarmin)
Changed
- Dependency on dry-schema was bumped to 1.9.1 (@solnic)
- Ruby
Published by dry-bot about 4 years ago
https://github.com/dry-rb/dry-validation - v1.7.0
Changed
- [internal] Upgraded to new
settingAPI provided in dry-configurable 0.13.0 (@timriley in #686 and 3f8f7d8) - Bumped dry-schema dependency to 1.8.0 (in part, to ensure dry-configurable 0.13.0 is available) (@timriley)
- Ruby
Published by dry-bot over 4 years ago
https://github.com/dry-rb/dry-validation - 1.6.0
Added
- You can now pass a key name or path to
rule_error?predicate (issue #658 closed via #673) (@moofkit) - You can now pass initial context object to
Contract#call(issue #674 via #675) (@pyromaniac)
Fixed
- Checking
key?within a rule no longer crashes when value isnilor an empty string (issue #670 fixed via #672) (@alexxty7)
- Ruby
Published by solnic about 5 years ago
https://github.com/dry-rb/dry-validation -
Fixed
- Dependency on dry-schema was bumped to >= 1.5.1. This time for real (@solnic)
- Ruby
Published by solnic over 5 years ago
https://github.com/dry-rb/dry-validation -
Fixed
- Dependency on dry-schema was bumped to >= 1.5.2 (see #666 for more info) (@artofhuman)
- Ruby
Published by solnic over 5 years ago
https://github.com/dry-rb/dry-validation -
Added
- You can now pass any key or a path to the rule's
key?helper (see #664 for more info) (@alassek)
Fixed
- Full messages work correctly with rule failures now (issue #661 fixed via #662) (@stind)
- Providing a custom message template for array errors works correctly (issue #663 fixed via #665) (@tadeusz-niemiec)
- Ruby
Published by solnic over 5 years ago
https://github.com/dry-rb/dry-validation -
Added
- You can now access current value's index via
rule(:foo).each do |index:|(issue #606 done via #657) (@mrbongiolo)
Fixed
- Using
.each(:foo)works as expected when there are errors related to other keys (issue #659 fixed via #660) (@solnic)
Changed
Result#error?is now a public API and it takes into consideration both schema and rule errors (issue #655 fixed via #656) (@PragTob)
- Ruby
Published by solnic over 5 years ago
https://github.com/dry-rb/dry-validation -
Fixed
key?predicate in rules no longer crashes when the rule path points to a non-existent array value (issue #653 fixed via #654) (@solnic)
Compare v1.5.1...v1.5.2
- Ruby
Published by solnic over 5 years ago
https://github.com/dry-rb/dry-validation -
Fixed
- dry-monads no longer required for the
:hintsextension (@schokomarie) - Using
full: trueoption works as expected with custom rule messages (issue #618 fixed via #651) (@sirfilip) - Using
locale: ...option works as expected with hints (issue #589 fixed via #652) (@sirfilip)
- Ruby
Published by solnic over 5 years ago
https://github.com/dry-rb/dry-validation -
Added
schema_error?rule helper (@waiting-for-dev)rule_error?rule helper (@waiting-for-dev)
Changed
- dry-schema dependency was bumped to
~> 1.5(@solnic) - [internal]
KeyMappatches have been removed since dry-schema now provides required functionality (@solnic)
- Ruby
Published by solnic almost 6 years ago
https://github.com/dry-rb/dry-validation -
Added
- Pattern matching on result values (@flash-gordon)
Fixed
- List tokens are correctly interpolated as a comma-separated list in rule messages (see #611) (@waiting-for-dev)
- Warnings about delegated keywords (@flash-gordon)
- Ruby
Published by flash-gordon about 6 years ago
https://github.com/dry-rb/dry-validation -
Added
- Support for multi-schema inheritance (@ianwhite)
Fixed
- Keyword warnings reported by Ruby 2.7 (@flash-gordon)
- Fixed an issue where
MessageSetwould be marked as empty too early (@ianwhite) - Messages are correctly generated when there are errors for both an array and one or more of its elements (see #599) (@Bugagazavr)
Changed
- A meaningful exception is raised when failure options are not valid (@MatElGran)
- [internal] improved performance in
Contract.ensure_valid_keys(@grzegorz-jakubiak) - [internal] fixed keyword warnings on MRI 2.7.0 (@flash-gordon)
- Ruby
Published by solnic about 6 years ago
https://github.com/dry-rb/dry-validation -
Added
- Support for setting an external schema (that can be extended too) (fixed #574) (@solnic)
Fixed
- Using a hash spec to define rule keys with more than one value is properly handled by rule guard now (fixed #576) (@solnic)
Changed
valueswithin rules usesHash#fetch_valuesinternally now, which improves performance (@esparta)
- Ruby
Published by solnic over 6 years ago
https://github.com/dry-rb/dry-validation -
Fixed
- Defining an abstract contract class that has no schema no longer crashes (issue #565) (@solnic)
- Fixed an issue where
Rule#eachwould crash when the value is not an array (issue #567) (@solnic) - Fixed an issue where guarding a rule would crash when keys are missing in the input (issue #569) (@solnic)
- Added missing "pathname" require (issue #570) (@solnic)
- Ruby
Published by solnic over 6 years ago
https://github.com/dry-rb/dry-validation -
Added
- New extension
:predicates_as_macros(@waiting-for-dev)
Fixed
- Guarding rules for nested keys works correctly (issue #560) (@solnic)
Changed
dry-schemadependency was bumped to>= 1.3.1(@solnic)
- Ruby
Published by solnic over 6 years ago
https://github.com/dry-rb/dry-validation -
Fixed
Rule#eachworks with array values from nested hashes (@mustardnoise)
- Ruby
Published by solnic over 6 years ago
https://github.com/dry-rb/dry-validation -
Added
key?method available within rules, that can be used to check if there's a value under the rule's default key (refs #540) (@solnic)valuesupports hash-based path specifications now (refs #547) (@solnic)valuecan read multiple values when the key points to them, ie in case ofrule(geo: [:lat, :lon])it would return an array withlatandlon(@solnic)
Fixed
- Passing multiple macro names to
validateoreachworks correctly (fixed #538 #541) (@jandudulski)
- Ruby
Published by solnic over 6 years ago
https://github.com/dry-rb/dry-validation -
This release is a complete rewrite on top of dry-schema that uses contract classes to define schema and validation rules. It's not backward-compatible. This release addressed over 150 known issues, including bugs and missing features.
See the list of all addressed issues as well as issues that were moved to dry-schema and addressed there.
✨ Release highlights ✨
- New
Dry::Validation::ContractAPI for defining contract classes with schemas and validation rules - Improved message backends with support for
keyandbasemessages, and arbitrary meta-data (like error codes etc.) - Support for defining rules for array elements ie
rule(:items).each { ... } - Support for macros that encapsulate common rule logic
- Built-in
:acceptancemacro
- Ruby
Published by solnic over 6 years ago
https://github.com/dry-rb/dry-validation -
Fixed
- Caching message templates uses restricted set of known keys to calculate cache keys (solnic)
- Ruby
Published by solnic almost 7 years ago
https://github.com/dry-rb/dry-validation -
Added
- [EXPERIMENTAL]
Validation.register_macrofor registering global macros (solnic) - [EXPERIMENTAL]
Contract.register_macrofor registering macros available to specific contract classes (solnic) Dry::Validation.Contractshortcut for quickly defining a contract and getting its instance back (solnic)- New configuration option
config.localefor setting the default locale (solnic)
Fixed
config/errors.ymlare now bundled with the gem,rc2was broken because of this (solnic)
Compare v1.0.0.rc2...v1.0.0.rc3
- Ruby
Published by solnic almost 7 years ago
https://github.com/dry-rb/dry-validation - v1.0.0.rc2 (YANKED)
This was yanked on rubygems.org because the bundled gem was missing config directory, thus it was not possible to require it. It was fixed in rc3.
Added
- [EXPERIMENTAL] support for registering macros via
Dry::Validation::Macros.register(:your_macro, &block)(solnic) - [EXPERIMENTAL]
:acceptanceas the first built-in macro (issue #157) (solnic)
Fixed
- Passing invalid argument to
failurewill raise a meaningful error instead of crashing (solnic)
Changed
- In rule validation blocks,
valuesis now an instance of a hash-likeDry::Validation::Valuesclass, rather thanDry::Schema::Result. This gives more convenient access to data within rules (solnic) - Dependency on
dry-schemawas updated to~> 1.0(solnic)
Compare v1.0.0.rc1...v1.0.0.rc2
- Ruby
Published by solnic almost 7 years ago
https://github.com/dry-rb/dry-validation -
Added
:hintsextension is back (solnic)Resultobjects have access to the context object which is shared between rules (flash-gordon)
Fixed
- Multiple hint messages no longer crash message set (flash-gordon)
Contract#inspectno longer crashes (solnic)
Changed
- Dependency on
dry-schemawas bumped to~> 0.6- this pulls indry-types 1.0.0anddry-logic 1.0.0(solnic) - Dependency on
dry-initializerwas bumped to~> 3.0(solnic)
Compare v1.0.0.beta2...v1.0.0.rc1
- Ruby
Published by solnic almost 7 years ago
https://github.com/dry-rb/dry-validation - v1.0.0.beta2
Added
-
Support for arbitrary meta-data in failures, ie:
class NewUserContract < Dry::Validation::Contract params do required(:login).filled(:string) end rule(:login) do key.failure(text: 'is taken', code: 123) unless db.unique?(values[:login]) end endNow your error hash will include
{ login: [{ text: 'is taken', code: 123 }] }(solnic + flash-gordon)
Changed
- [BREAKING]
Errorwas renamed toMessageas it is a more generic concept (solnic) - [BREAKING]
ErrorSetwas renamed toMessageSetfor consistency (solnic) - [BREAKING]
:monadsextension wraps entire result objects inSuccessorFailure(flash-gordon)
Compare v1.0.0.beta1...v1.0.0.beta2
- Ruby
Published by solnic almost 7 years ago
https://github.com/dry-rb/dry-validation - v1.0.0.beta1
Added
- New API for setting failures
base.failurefor base errors andkey.failurefor key errors (solnic) - Support for
baseerrors associated with a key even when child keys have errors too (solnic) - Support for
baseerrors not associated with any key (solnic) - Result objects use
ErrorSetobject now for managing messages (solnic) - Nested keys are properly handled when generating messages hash (issue #489) (flash-gordon + solnic)
- Result objects support
localeandfulloptions now (solnic) - Ability to configure
top_namespacefor messages, which will be used for both schema and rule localization (solnic) - Rule blocks receive a context object that you can use to share data between rules (solnic)
Changed
- [BREAKING]
Result#errorsreturns an instance ofErrorSetnow, it's an enumerable, coerible to a hash (solnic) - [BREAKING]
failurewas removed in favor ofkey.failureorkey(:foo).failure(solnic) - [BREAKING]
Result#to_hashwas removed (flash-gordon)
Compare v1.0.0.alpha2...v1.0.0.beta1
- Ruby
Published by solnic almost 7 years ago
https://github.com/dry-rb/dry-validation -
v0.13.1 2019-03-22
Changed
dry-typeswas locked to~> 0.14.0(flash-gordon)
- Ruby
Published by flash-gordon almost 7 years ago
https://github.com/dry-rb/dry-validation -
The first round of bug fixes. Thanks for testing <3!
Fixed
- Errors with nested messages are correctly built (flash-gordon)
- Messages for nested keys are correctly resolved (solnic)
- A message for a nested key is resolved when it's defined under
errors.rule.%{key}too, but a message under nested key will override it (solnic)
Changed
- When a message template is not found a more meaningful error is raised that includes both rule identifier and key path (solnic)
Compare v1.0.0.alpha1...v1.0.0.alpha2
- Ruby
Published by solnic almost 7 years ago
https://github.com/dry-rb/dry-validation -
Complete rewrite on top of dry-schema.
Added
- [BREAKING]
Dry::Validation::Contractas a replacement for validation schemas (solnic) - [BREAKING] New
ruleDSL with an improved API for setting error messages (solnic)
Compare v0.13.0...v1.0.0.alpha1
- Ruby
Published by solnic almost 7 years ago
https://github.com/dry-rb/dry-validation -
v0.12.3 2019-01-29
Changed
- [internal] dyr-logic was pinned to
~> 0.4.2(flash-gordon)
- Ruby
Published by flash-gordon about 7 years ago
https://github.com/dry-rb/dry-validation -
v0.12.2 2018-08-29
Fixed
- Use correct key names for rule messages when using i18n (jozzi05)
- Ruby
Published by flash-gordon about 7 years ago
https://github.com/dry-rb/dry-validation -
v0.12.1 2018-07-06
Fixed
- [internal] fixed deprecation warnings (flash-gordon)
- Ruby
Published by flash-gordon over 7 years ago
https://github.com/dry-rb/dry-validation -
v0.12.0 2018-05-31
Changed
- Code updated to work with
dry-types0.13.1 anddry-struct0.5.0, these are now minimal supported versions (flash-gordon) - [BREAKING]
Formwas renamed toParamsto be consistent with the latest changes fromdry-types. You canrequire 'dry/validation/compat/form'to use the previous names but it will be removed in the next version (flash-gordon)
- Ruby
Published by flash-gordon almost 8 years ago
https://github.com/dry-rb/dry-validation - v0.11.0
Changed
- [internal] input processor compilers have been updated to work with new dry-types' AST (GustavoCaso)
- Ruby
Published by solnic over 8 years ago