@raymcdermott listened that defn, good stuff. Finnish is simple, just pronounce the way you write it, right? ๐
but, reitit is pronounced ray-tit
.
@rutledgepaulv the entry handling is bit too hard atm, but not sure what woud be a simpler way.
there is a way to ask for the entry instead of the value, just a sec.
oh, undocumeted, untested and had a bug, but maybe something like this?
(mu/find
[:map [:b {:optional true} int?]]
:b)
; => [:b {:optional true} int?]
(-> [:map [:a [:map [:b {:optional true} int?]]]]
(mu/get :a)
(mu/find :b))
; => [:b {:optional true} int?]
where mu/find
is just sugar on top of the hidden feature of โgive me the entry tupleโ of:
(-> [:map [:a [:map [:b {:optional true} int?]]]]
(mu/get-in [:a [::m/find :b]]))
; => [:b {:optional true} int?]
btw, those interested in the sequence schemas, hereโs the PR (draft): https://github.com/metosin/malli/pull/317
(m/explain
[:+ [:cat*
[:prop string?]
[:val [:alt* [:s string?] [:b boolean?]]]]]
["-server" :foo "-verbose" true "-user" "joe"])
=>
{:schema [:+ [:cat* [:prop string?] [:val [:alt* [:s string?] [:b boolean?]]]]],
:value ["-server" :foo "-verbose" true "-user" "joe"],
:errors (#Error{:path [0 :val :s], :in [1], :schema string?, :value :foo}
#Error{:path [0 :val :b], :in [1], :schema boolean?, :value :foo})}
Can confirm, Ray is a tit ;) @raymcdermott