dry-rb/dry-validation
63.5
Adequate · 19 September 2026
2.1k
lines of production code
Ruby
primary language
1
measurement over time
What this system is
This system is a Ruby validation library that defines schemas and contracts to validate input data against structured rules. It provides a unified interface for processing parameters, JSON, and nested structures, returning detailed error results with localized message support. The library includes extensions for functional programming patterns and performance benchmarking tools to compare its validation strategies against standard Ruby frameworks.
How it got here
2015 — dry-validation 1.11 release
11 changes.
This period focused on the major release of dry-validation 1.11, which introduced a new Contract API, a Result object, and a complete restructuring of the internal validation logic. The project underwent a significant dependency overhaul, upgrading to Ruby 3.3 and replacing legacy components with modern tools like Zeitwerk and dry-schema. CI infrastructure was also modernized, and comprehensive tests and examples were added to support the new features.
2016–2020 — Contract API and extension ecosystem
16 changes.
This period focused on expanding the dry-validation library with a new Contract class interface, interactive REPL console, and performance benchmarks. It introduced several extensions for hints, monads, and predicate macros, while significantly refactoring message resolution and error handling logic. Comprehensive integration tests were added to validate these new features and ensure robust behavior across different locales and backends.
Features
Add interactive REPL console with Dry schema helpers
A new bin/console script is introduced, allowing developers to launch an interactive IRB session pre-loaded with Dry::Validation and Dry::Types. The console provides a Context object that exposes helper methods for defining schemas (schema, params, json) and building validation contracts (contract), streamlining the development and testing of validation logic.
bin · high confidence
Add new validation examples for basic, params, JSON, nested, each, and multiple rules
The examples directory now includes six new Ruby scripts demonstrating specific dry-validation capabilities: basic schema validation, params-style validation, JSON input processing, nested schema structures, array iteration with the \each\ rule, and multiple custom failure rules on a single field.
examples · high confidence
Add validation benchmarks comparing dry-validation with ActiveModel and ActiveRecord
The benchmarks directory now includes a comprehensive suite for measuring validation performance. New files introduce comparisons between dry-validation, ActiveModel::Validations, and ActiveRecord, covering both valid and invalid input scenarios. The suite also adds specific benchmarks for large-scale schemas (huge forms) and profiling scripts for schema definition, schema calls, and message generation, allowing users to evaluate performance characteristics across different validation strategies and input sizes.
benchmarks · high confidence
New extensions for hints, monads, and predicate macros
Three new extensions are now available for dry-validation: the :hints extension adds a hints method to validation results to return error messages excluding hints, while the :monads extension allows converting validation results into dry-monads Result objects via to\_monad; additionally, the :predicates\_as\_macros extension enables importing dry-logic predicates as validation macros in contracts.
lib/dry/validation/extensions · high confidence
Removals
Removal of legacy rule modules and registry
The \lib/dry/rules\ directory has been cleaned up by removing several legacy modules: \Each\, \Embedded\, \Length\, \Presence\, and \Registry\. These files, which previously handled specific validation logic (such as checking presence, length ranges, or iterating over embedded values) and registry behavior, are no longer present in the codebase. This change likely reflects a shift in how rules are defined or processed, requiring users to update their validation logic to align with the new structure.
lib/dry/rules · high confidence
Removal of legacy validation processor and attribute extractor
The \lib/dry/validator/processor.rb\ and \lib/dry/validator/processor/attribute\_extractor.rb\ files have been removed. This eliminates the previous implementation that used \Dry::Rules\ to iterate over validator rules and extract attribute values from objects, effectively stripping out the core logic responsible for processing validation rules against input data in this location.
lib/dry/validator · high confidence
Behavioural changes
Library renamed from dry-validator to dry-validation with new entry points
The library has been renamed from dry-validator to dry-validation. The old require paths (lib/dry-validator.rb and lib/dry/validator.rb) have been removed and replaced with new entry points (lib/dry-validation.rb and lib/dry/validation.rb). The new entry point uses Zeitwerk for autoloading and registers extensions like monads and hints. The old Dry::Validator class and Dry::Rules module have been removed, indicating a significant API change where the previous validator implementation is no longer available via these paths.
lib/dry · high confidence
Log support directory relocated
The .gitkeep file previously located in spec/support has been moved to the log directory. This change reorganizes the project's internal directory structure without altering any functional behavior or user-facing features.
log · low confidence
New class interface and build shortcut for validation contracts
The contract definition API has been refactored into a dedicated \ClassInterface\ module, introducing a \build\ class method that allows creating one-off, non-inheritable contract instances without defining a named class. The interface now explicitly supports defining \params\, \json\, and \schema\ blocks, with the latter two accepting external schemas. Additionally, rule definitions now strictly validate that specified keys exist within the defined schema, raising an \InvalidKeysError\ if mismatches are detected.
lib/dry/validation/contract · high confidence
New message resolution logic for validation errors
A new Messages::Resolver class has been introduced to handle the resolution of validation error messages. This component manages the lookup of message templates based on rule names and field paths, supports locale-specific resolution, and formats full error messages by combining field keys with the error text. It also handles the parsing of token values, such as converting arrays into comma-separated strings, ensuring consistent error output for users.
lib/dry/validation/messages · high confidence
New repository configuration and CI task structure
The repository has been restructured with new configuration files including \.yardopts\ for documentation generation, \repo-sync.yml\ for automated synchronization, and \zizmor.yml\ for security policy enforcement. The legacy Travis CI configuration (\.travis.yml\) has been removed, and the \Rakefile\ has been updated to define new tasks for running core specs, extension-specific specs, and isolated extension tests, replacing the previous default spec task. Additionally, the \.rubocop.yml\ now inherits from a remote Hanakai template, and the \LICENSE\ year range has been updated to 2015-2026.
(repo-wide) · high confidence
Removal of RuboCop rake tasks
The RuboCop integration tasks have been removed from the Rake environment. Users can no longer invoke RuboCop checks or auto-configuration generation via the standard Rake tasks defined in the project.
rakelib · high confidence
dry-validation 1.11.1: New Contract API and Result object
The library has been updated to version 1.11.1, introducing a new \Contract\ class that wraps schema validation and custom rules into a single callable unit. This change replaces the previous \Validator\ namespace with \Validation\ and provides a \Result\ object that aggregates schema errors and rule failures, offering methods like \success?\, \failure?\, and \errors\ for easier inspection. The update also includes a new \Evaluator\ context for rule blocks, a \Failures\ accumulator, and support for localized messages via \MessageSet\.
lib/dry/validation · high confidence
Test coverage
Added integration tests for Contract, Evaluator, and Result; removed legacy Validator specs; Added integration tests for Dry::Validation::Contract; Added integration tests for evaluator error handling, failure APIs, and context usage; Added integration tests for macro validation features; Added integration tests for the Contract class interface; Added integration tests for the message resolver; Added integration tests for validation rules; Added test support configuration files; Added tests for Result pattern matching; Added tests for predicates\_as\_macros extension; Added tests for the monads extension's Result\#to\_monad method; Added unit tests for rule composition and value path resolution; Standardized RSpec configuration and test environment setup.
Dependencies
Major dependency overhaul and Ruby version upgrade
The gem has been renamed from dry-validator to dry-validation and now requires Ruby 3.3 or higher. Runtime dependencies have been significantly updated: dry-schema is now pinned to \~\> 1.14, dry-core to \~\> 1.1, and dry-initializer to \~\> 3.2, while adding concurrent-ruby and zeitwerk as new runtime requirements. The old dependencies (dry-configurable, dry-container, thread\_safe) have been removed. Development tooling has also shifted, replacing rubocop and guard with dry-monads and i18n for testing, and adding a benchmarks group with ActionPack, ActiveModel, ActiveRecord, and SQLite3.
(dependencies) · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Baseline
- First survey — no prior run to compare against. CAI 63.
Lenses
- Code Health 100
- Architecture 99
- Maturity 43
- Readiness 73
- Security 77
- Domain Modelling 100
Changes since last survey
- 300 commits — 286 feature/other, 14 fixes
By area
- (root) — 189 commits
- .github/workflows — 54 commits
- lib/dry — 26 commits
- (repo) — 14 commits
- spec/integration — 5 commits
- docsite/source — 3 commits
- benchmarks/benchmark_form_invalid.rb — 2 commits
- spec/support — 2 commits
- .github/FUNDING.yml — 1 commit
- .github/SUPPORT.md — 1 commit
- bin/console — 1 commit
- examples/multiple.rb — 1 commit
- spec/extensions — 1 commit
Notable commits
- fix: Fix RuboCop issue
- fix: Fix RuboCop issues
- fix: Fix constant reference
- fix: Fix deprecated dry-configurable usage
- fix: Fix spec
- fix: Fix version specs (fix #726)
- fix: Merge pull request #694 from JuanVqz/fix-test-convention
- fix: Merge pull request #699 from bhicks/messages-doc-fix
- fix: Merge pull request #706 from MatElGran/bugfix/invalid_substring_rule_keys
- fix: Merge pull request #709 from bautrey37/fix-rule.each-on-optional-value
- fix: Merge pull request #744 from dry-rb/bundle-fixes-for-jruby
- fix: Skip parameter to fix warnings
- fix: [ci] fix codacy action
- fix: fix: test convention
- change: Add .action_hero.yml
- change: Add .github/workflows/rubocop.yml from action-hero/workflows
- change: Add .github/workflows/sync_configs.yml from dry-rb/template-gem
- change: Add .repobot.yml
- change: Add 3.4 to CI, remove 3.0
- change: Add gemspec from dry-rb/template-gem
- …and 280 more
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
dry-rb/dry-validation was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 19 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 2d938780bf8cd0e13b6dd7efe4f0f5a064801202 — the exact code this score is about.
- Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-b51f968c9b10.