Closed ikitommi closed 10 months ago
from #910:
I see. Here's one repro: (m/decode [:int {:decode/math str}] 1 (mt/transformer {:name :math})) ; => "1" (m/decode [:and [:int {:decode/math str}]] 1 (mt/transformer {:name :math})) ; => "1" (m/decode [:or [:int {:decode/math str}]] 1 (mt/transformer {:name :math})) ; => 1 so, options being: do nothing: it's a feature use first branch in case none is valid after decode use first branch where value is changed in decode Not sure what is the most correct, 1 or 2 here 🤔
I see. Here's one repro:
(m/decode [:int {:decode/math str}] 1 (mt/transformer {:name :math})) ; => "1" (m/decode [:and [:int {:decode/math str}]] 1 (mt/transformer {:name :math})) ; => "1" (m/decode [:or [:int {:decode/math str}]] 1 (mt/transformer {:name :math})) ; => 1
so, options being:
Not sure what is the most correct, 1 or 2 here 🤔
this PR implements option 2.
This is a BREAKING change as the behavior changes. But, I think the current implementation is wrong and this is (more) correct.
from #910:
this PR implements option 2.
This is a BREAKING change as the behavior changes. But, I think the current implementation is wrong and this is (more) correct.