Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MessageMissingError when using uri? predicate #476

Open
timjnh opened this issue Mar 4, 2024 · 1 comment
Open

MessageMissingError when using uri? predicate #476

timjnh opened this issue Mar 4, 2024 · 1 comment

Comments

@timjnh
Copy link
Contributor

timjnh commented Mar 4, 2024

Describe the bug

With 1.13.3 I receive a Dry::Schema::MissingMessageError if I try to generate errors for the uri? predicate

To Reproduce

require 'dry/schema'
require 'uri'

contract = Dry::Schema.Params do
  required(:uri) { str? & uri?(:https) & filled? }
end

result = contract.call(uri: "nope")

puts result.errors.inspect

Expected behavior

I should get a reasonable error message such as must be a valid URI

My environment

  • Dry-schema version: 1.13.3
  • Affects my production application: NO
  • Ruby version: 3.1.3
  • OS: MacOS 14.3.1
@timjnh
Copy link
Contributor Author

timjnh commented Mar 4, 2024

Happy to put in a PR to fix this one. Seems very similar to #470 and https://github.com/dry-rb/dry-schema/pull/244/files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant