Open
Description
Describe the bug
A json schema that is not picking up on valid input.
To Reproduce
class TestContract < Dry::Validation::Contract
json do
required(:mykey?).value(:bool)
end
end
input = JSON.parse('{"mykey?": true }')
result = TestContract.new.call(input)
# #<Dry::Validation::Result{} errors={:mykey?=>["is missing"]}>
result.to_h
# {}
result.errors
# #<Dry::Validation::MessageSet messages=[#<Dry::Schema::Message text="is missing" path=[:mykey?] predicate=:key? input={}>] options={}>
Expected behavior
It should have picked up the input since it was conforming to the schema.
My environment
- Affects my production application: NO
- Ruby version: 2.6.10
- OS: macOS 12.6