dry-validation icon indicating copy to clipboard operation
dry-validation copied to clipboard

Validation library with type-safe schemas and rules

Results 23 dry-validation issues
Sort by recently updated
recently updated
newest added

## Describe the bug Hello. I'm running into an issue where a Dry::Validation::Contract reports an error for coercible integer strings, but only when a hash field fails validation. I've included...

bug

Here I'm trying to inject a dependency named `config` using the default kwargs strategy of dry-auto_inject. ```ruby class MyContract < Dry::Validation::Contract include Import['config'] json do required(:foo).maybe(:string) end rule(:foo) do key.failure("foo...

feature

At the moment validation contract returns nice human-readable errors via translation backend. Being a robot, I do not like it and I'd prefer pure data object/hash to be returned. Justification:...

help wanted
feature

In order to make defining rules that depend on additional conditions nicer, we can have something like this: ```ruby params do optional(:per_page).value(:integer) end rule(:per_page).if(:key?).validate(gt?: 0, lteq?: 20) ``` See the...

help wanted
feature

## Examples ```ruby require 'dry-validation' class PropsContract < Dry::Validation::Contract json do required(:contacts).value(:array, min_size?: 1).each do hash do required(:name).filled(:string) required(:email).filled(:string) required(:phone).filled(:string) end end end rule("contacts[].email").each do key.failure("email not valid") unless value.include?('@')...

help wanted
feature

## Describe the bug When schemas are passed blocks, `required` field behavior does not always work, and there is inconsistent behavior for reaching validation rules -- although it seems to...

bug
help wanted

This feature will allow contracts to be composed of other contracts, optionally mounted at input paths. ## Example ```ruby # this contract defines its own params and rules, but also...

feature
⚠️ experimental ⚠️
wip

## Describe the bug I extracted a macro into a reusable module, like this: ~~~ruby module ReusableRule extend ::ActiveSupport::Concern included do register_macro(:reusable_macro) do # do some validations here end end...

bug
help wanted

In many REST APIs it's often the case when creating resources, certain fields are required but when updating resources, all fields are optional and only the fields which are provided...

help wanted
feature

## Describe the bug The error message from dry-validation for incorrect key nesting in en.yml file for rule with nested params is giving wrong path. ## To Reproduce Consider having...

bug
help wanted