Fork me on GitHub
#reitit
<
2022-12-14
>
Ben Sless19:12:49

Bad scenario I came across with coercion By default coercion removes keys not in schema Ordering schemas incorrectly inside :or can corrupt data Found out the hard way

ikitommi21:12:22

I now think it's a bad default to drop extra keys. But, the ordering part, how and what does happen?

Ben Sless21:12:18

Imagine schema a is subset of schema b If you receive data from schema b but check a first, it will be coerced with a first, keys dropped and you pass even when you could pass b, because order matters

Ben Sless21:12:35

Result: data corruption Cause: user error with foot gun