We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I have a contract class add config.namespace and try to use .errors(full: true) but got the TypeError
config.namespace
.errors(full: true)
TypeError
/Users/elct9620/.rbenv/versions/3.3.2/lib/ruby/gems/3.3.0/gems/dry-schema-1.13.4/lib/dry/schema/messages/namespaced.rb:67:in `sub': wrong argument type Symbol (expected Regexp) (TypeError) key.sub(config.top_namespace, "#{config.top_namespace}.#{namespace}") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
I use it in the dry-rails but get the same result with the below code
dry-rails
# frozen_string_literal: true require 'bundler/inline' gemfile do source 'https://rubygems.org' gem 'i18n' gem 'dry-validation', '~> 1.10' end require 'dry/validation' require 'i18n' class ApplicationContract < Dry::Validation::Contract config.messages.top_namespace = :contracts config.messages.backend = :i18n end module Example # :nodoc: class GroupContract < ApplicationContract config.messages.namespace = :example params do required(:name).filled(:string) end end end contract = Example::GroupContract.new pp contract.call(name: true).errors(full: true)
The full error message is displayed correctly.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Describe the bug
I have a contract class add
config.namespace
and try to use.errors(full: true)
but got theTypeError
To Reproduce
I use it in the
dry-rails
but get the same result with the below codeExpected behavior
The full error message is displayed correctly.
My environment
The text was updated successfully, but these errors were encountered: