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]
@funyako.funyao156 try [:orn [:name string?] [:id int?]]
. There are named-branch variants for :or,
:alt
and :cat
with +n in the name.
@ikitommi Thanks!