@alassek When validate_keys is false, the problem won’t happening.
I want to be able to validate keys, but not on my hash prop.
Dry::Schema.config.validate_keys = true
schema = Dry::Schema.JSON do
optional(:foo).maybe(:hash)
end
r = schema.call({ bar: 1, foo: { bar: 2 } })
r.errors.to_h
# {:bar=>["is not allowed"], :foo=>{:bar=>["is not allowed"]}}
In the example above, bar shouldn’t be allowed on root, but it should be inside the hash foo prop