Description
dry-validation is a data validation library that provides a powerful DSL for defining schemas and validation rules.
Validations are expressed through contract objects. A contract specifies a schema with basic type checks and any additional rules that should be applied. Contract rules are applied only once the values they rely on have been succesfully verified by the schema.
Unique features
There are a couple of unique features that make dry-validation stand out from the crowd:
Strict, explicit data schemas are separated from the domain validation logic - this allows you define validation rules that are type safe and focus exclusively on validation logic. This in turn makes rule code much simpler and easier to understand
Schemas are powered by dry-schema which sanitizes, coerces and type-checks the input for you
Contracts support defining macros, which can significantly reduce code duplication in your rules
Plays nice with dependency injection, using either option API or automated approach via dry-auto_inject
dry-validation alternatives and similar gems
Based on the "Validation" category.
Alternatively, view dry-validation alternatives based on common mentions on social networks and blogs.
-
activerecord_json_validator
🔩 ActiveRecord::JSONValidator makes it easy to validate JSON attributes against a JSON schema. -
activerecord-validations-helpers
DISCONTINUED. Active Record validation helpers for your Rails project
CodeRabbit: AI Code Reviews for Developers

Do you think we are missing an alternative of dry-validation or a related project?
README
<!--- this file is synced from dry-rb/template-gem project -->
dry-validation 
Links
Supported Ruby versions
This library officially supports the following Ruby versions:
- MRI
>= 2.7.0
- jruby
>= 9.3
(postponed until 2.7 is supported)
License
See LICENSE
file.
*Note that all licence references and agreements mentioned in the dry-validation README section above
are relevant to that project's source code only.