Fork me on GitHub
#malli
<
2023-10-08
>
DrLjótsson07:10:43

What is the easiest way to make all top-level keys in a schema optional?

[:map 
   [:a [:map [:b :string]]] 
   [:c [:map [:d :int]]]]
;; =>
[:map
   [:a {:optional true} [:map [:b :string]]]
   [:c {:optional true} [:map [:d :int]]]]

DrLjótsson08:10:12

Thanks! And now I see that it's even mentioned in the docs...