examples/json.rb in dry-validation-0.7.4 vs examples/json.rb in dry-validation-0.8.0
- old
+ new
@@ -1,11 +1,11 @@
require 'json'
require 'dry-validation'
schema = Dry::Validation.JSON do
- key(:email).required
+ required(:email).filled
- key(:age).required(:int?, gt?: 18)
+ required(:age).filled(:int?, gt?: 18)
end
errors = schema.call(JSON.parse('{"email": "", "age": "18"}')).messages
puts errors.inspect