These are chat archives for dry-rb/chat
Next-gen ruby libs! » github.com/dry-rb » website: https://dry-rb.org » forum: https://discourse.dry-rb.org
Hi guys, it seems that I maybe encounter a bug of
dry-types SUM, but I'm not sure. Could you help me on this?
It happens when I try to verify a object which should be a hash or a string
test = Dry::Types['hash'].map(Dry::Types['symbol'], Dry::Types['strict.string']) | Dry::Types['strict.string'] test[a: 'b'] # passed as expected test['a' => 'b'] # should fail but pass! test['test'] # passed as expected test # should fail but pass!
I'm wondering if there is anything that I didn't notice or I use the wrong way to build my rule. Thanks :)
Links = Map(Symbol, String | JSONAPI::Types::Link)
Links = Map(Symbol, String | JSONAPI::Types::Link.optional)