In schemas with validate_keys enabled, any input key that is a substring of either a defined key (including nested) or a full key path in dot notation will pass the validation.
To Reproduce
schema = Dry::Schema.define do
config.validate_keys = true
optional(:name).filled(:string)
optional(:address).hash do
optional(:city).filled(:string)
end
end
schema.call(am: 'Jane', city: 'NYC', dress: { cit: '?' })
=> #<Dry::Schema::Result{} errors={} path=[]>
Expected behavior
schema.call(am: 'Jane', city: 'NYC', dress: { cit: '?' })
=> #<Dry::Schema::Result{} errors={:am=>["is not allowed"], :city=>["is not allowed"], :dress=>{:cit=>["is not allowed"]}} path=[]>
Describe the bug
In schemas with
validate_keys
enabled, any input key that is a substring of either a defined key (including nested) or a full key path in dot notation will pass the validation.To Reproduce
Expected behavior
My environment