Fork me on GitHub
#malli
<
2022-03-05
>
match3718:03:39

Using malli 0.8.4, got below error, what did I miss? Appreciate your help!

user=> (require '[malli.core :as m ])
nil

user=> (def s (->> [:union
                    [:map [:x :string]]
                    [:schema [:map [:x :int]]]]))
#'user/s

user=> (m/form s)
Execution error (ExceptionInfo) at malli.core/-fail! (core.cljc:136).
:malli.core/invalid-schema {:schema :union}

user=> (m/validate s {:x "x"})
Execution error (ExceptionInfo) at malli.core/-fail! (core.cljc:136).
:malli.core/invalid-schema {:schema :union}

match3704:03:38

answer my own question, I need register some predefined schemas.

{:registry (merge (mu/schemas) (m/default-schemas))}

👌 1