These are chat archives for dry-rb/chat

29th
Jun 2018
sarahdiendorfer
@sarahdiendorfer
Jun 29 2018 05:43
@mikhailvs @GustavoCaso I got it working with your suggestion. Thanks a lot for your help! :)
Piotr Solnica
@solnic
Jun 29 2018 09:51

@mikhailvs docs also say "If a nested hash could be nil, simply use maybe macro with a block"

yeah but with type_spec enabled, behavior is different, you must specify allowed types in the second argument, this feature has been always experimental, we're gonna make it first-class in 1.0.0

Mikhail Slyusarev
@mikhailvs
Jun 29 2018 13:19
@solnic I agree about specifying :hash in the second parameter. I meant only that optional(:address, [:nil, :hash]).maybe { schema { ... } } works, while optional(:address, [:nil, :hash]).schema { ... } does not.