Fork me on GitHub
#malli
<
2021-03-15
>
fmn06:03:29

Currently, is it possible to do this with parse ?

(s/def ::name-or-id (s/or :name string?
                          :id   int?))
(s/conform ::name-or-id "abc")
;;=> [:name "abc"]
(s/conform ::name-or-id 100)
;;=> [:id 100]

ikitommi08:03:09

@funyako.funyao156 try [:orn [:name string?] [:id int?]]. There are named-branch variants for :or, :alt and :cat with +n in the name.