dry-rb / dry-rb/dry-validation
JSON schema contract failing to recognise valid input
Open
bug
help wanted
- Dominant language
- Ruby
- Stars
- 1.4k
- Forks
- 195
- PR merge metrics
- No merged PRs in 30d
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)
# #["is missing"]}>
result.to_h
# {}
result.errors
# #] 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
Contributor guide
Assessment
This issue has not been assessed yet.