Hi, I’m currently migrating from
dry-schema-1.6.1 and couldn’t find a way to add validation rules.
Here’s an example I had when using Dry::Validation
Dry::Validation.Params do ... rule(role_for_manage_kind: %i[filter_by_kind filter_by_role]) do |filter_by_kind, filter_by_role| filter_by_kind.eql?('manage').then(filter_by_role.filled?) end end
This is basically a conditional validation, if the value of filter_by_kind is equal ‘manage’, the field filter_by_role should be required
Any idea of how I go about this but using “Dry::Schema” instead?
Thanks in advance