Hello there.
It looks like array definitions got broken after dry-schema 1.9.3
To Reproduce
In 1.9.3:
Dry::Schema.Params do
required(:foo).array(Types::Params::Integer | Types::Params::Nil)
end
#=> #<Dry::Schema::Params keys=["foo"] rules={:foo=>"key?(:foo) AND key[foo](array? AND each(int? OR nil?))"}>
In any later version:
Dry::Schema.Params do
required(:foo).array(Types::Params::Integer | Types::Params::Nil)
end
# Dry::Container::KeyError: key not found: "int?"
# from /Users/pyromaniac/.rvm/gems/ruby-2.7.6@bookingsync/gems/dry-container-0.11.0/lib/dry/container/resolver.rb:31:in `block in call'
However, I found a workaround for this that seemingly gives the same schema definition and works in all the versions so far:
Dry::Schema.Params do
required(:foo).value(array[Types::Params::Integer | Types::Params::Nil])
end
#=> #<Dry::Schema::Params keys=["foo"] rules={:foo=>"key?(:foo) AND key[foo](array? AND each(int? OR nil?))"}>
Though it is uglier to my taste.
I saw similar issues with types resolving but they were fixed in 1.10.something.
Expected behavior
The first definition supposed to work in all the versions.
Describe the bug
Hello there. It looks like array definitions got broken after dry-schema 1.9.3
To Reproduce
In 1.9.3:
In any later version:
However, I found a workaround for this that seemingly gives the same schema definition and works in all the versions so far:
Though it is uglier to my taste. I saw similar issues with types resolving but they were fixed in 1.10.something.
Expected behavior
The first definition supposed to work in all the versions.
My environment
Thanks in advance!