Fork me on GitHub
#malli
<
2020-01-13
>
ikitommi05:01:31

fixed so that nil is allowed as properties and empty properties are treated as nil (and stripped from m/form).

ikitommi05:01:29

I don’t think nil should be treated as “always fail” in composite schemas. Currently, it will blow as nil is not a valid schema.

ikitommi05:01:10

also, can’t strip all nils from children, as things like :enum might have actual valid value of nil.

ikitommi05:01:14

So, options being: 1. allow (and strip) nil in map & composite schemas, for convenience sake 2. blow up in case of nil as child schema 3. map nil to “always fail”

ikitommi05:01:51

the malli.util merge is not that fun for deeply nested maps:

(malli.util/merge 
  [:map [:x [:map [:y [:map [:z int?]] 
  (if require-z2 [:map [:x [:map [:y [:map [:z2 int?]]))

roklenarcic08:01:37

each into-schema should probably decide for itself what to do with nil values

👍 1