Open
Description
Describe the bug
When setting validate_keys
as true, empty hashes are being ignored by the validator
To Reproduce
schema = Dry::Schema.JSON do
config.validate_keys = true
end
schema.({hello: {}})
=> #<Dry::Schema::Result{} errors={}>
schema.({hello: 1})
=> #<Dry::Schema::Result{} errors={:hello=>["is not allowed"]}>
Expected behavior
Unexpected key hello
should be in the errors hash regardless of the key's value
My environment
- Affects my production application: YES
- Ruby version: ruby-2.5.7