@steveb8n doesn’t work :thinking_face:. Will check it out.
(for some reason, the keys are not followed AFTER converted to keywords.
oh, the key-transformer applies on :leave
, which is after-the-fact.
… should be on :enter
on decode and on :leave
on encode. Just a sec.
no hurry. the workaround of doing 2 transforms is ok. but it will be good to see the transform composition handling this use case eventually
even if that means dropping down to the interceptor level
btw: for fun I might run https://github.com/stevebuik/Stu on my project. it’ll show the extra 200k from sci very clearly
@steveb8n fixed in master: https://github.com/metosin/malli/commit/679ca7780f2e36e427885e2343772369e048598e
great! that was quick. I’ll update first thing tomorrow
@lucio just added a feature to fork at about the same speed. you guys are awesome
didn’t know about Stu, looks nice
it needs a couple of fixes to use properly. let me know if you want to use it. then I’ll go fix them
@shortlyportly related to you question on #reitit, would this help:
(let [path->schema (atom {})]
(mu/find-first
[:and
[:fn '(constantly true)]
[:map
[:name string?]
[:tags [:set [:map [:name string?]]]]
[:address [:and
[:fn '(constantly true)]
[:map [:street string?]]
[:fn '(constantly true)]]]]
[:fn '(constantly true)]]
(fn [s i _]
(swap! path->schema update i (fnil identity s))
nil))
@path->schema)
;{[] [:and
; [:fn (constantly true)]
; [:map
; [:name string?]
; [:tags [:set [:map [:name string?]]]]
; [:address [:and [:fn (constantly true)] [:map [:street string?]] [:fn (constantly true)]]]]
; [:fn (constantly true)]],
; [:name] string?,
; [:tags] [:set [:map [:name string?]]],
; [:tags :malli.core/in] [:map [:name string?]],
; [:tags :malli.core/in :name] string?,
; [:address] [:and [:fn (constantly true)] [:map [:street string?]] [:fn (constantly true)]],
; [:address :street] string?}
you would get the schemas per value path for standalone validation.
Thanks again @ikitommi - I'll take a look. Just wanted to say love your talks and the libraries metosin are putting out. many thanks.