Types::Params::*.optional not handling empty string #419
Open
Description
To Reproduce
Types::Params::Integer.optional[''] # => raise invalid value for Integer(): ""
Types::Optional::Params::Integer[''] # => nil
Types::Params::Date.optional[''] # => raise invalid date
Dry::Types["optional.params.date"] # => Nothing registered with the key "optional.params.date"
Expected behavior
Types::Params::Integer.optional[''] # => nil
Types::Params::Date.optional[''] # => nil
this behavior is confusing, I assumed that Types::Params::Date.optional
equivalent Types::Params::Nil | Types::Params::Date