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
Object doesn't support #inspect error is raised when validating an object shown in the example below.
Object doesn't support #inspect
require 'dry/schema' module Types include Dry::Types() end class MyItem1 < Dry::Schema::JSON define do required(:name).filled(Types::String.enum(*%w[a])) optional(:time).filled(:time) end end class MyItem2 < Dry::Schema::JSON define do required(:name).filled(Types::String.enum(*%w[b])) optional(:time).filled(:time) end end class MyList < Dry::Schema::JSON define do required(:list).value(:array).each { MyItem1.new | MyItem2.new } end end item1 = { 'name' => 'a', 'time' => Time.now.iso8601 } item2 = { 'name' => 'b', 'time' => Time.now.iso8601 } MyItem1.new.call(item1).failure? # => false MyItem2.new.call(item2).failure? # => false MyList.new.call('list' => [item1, item2]).failure? # => true MyList.new.call('list' => [item1, item2]) (Object doesn't support #inspect) =>
I would expect to receive a proper result of validation while executing the command below:
MyList.new.call('list' => [item1, item2])
1.8.0
ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [x86_64-darwin19]
macOS Monetery 12.0.1
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Describe the bug
Object doesn't support #inspect
error is raised when validating an object shown in the example below.To Reproduce
Expected behavior
I would expect to receive a proper result of validation while executing the command below:
My environment
1.8.0
ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [x86_64-darwin19]
macOS Monetery 12.0.1
, Ubuntu 18.04The text was updated successfully, but these errors were encountered: