malli 2025-11-06

Hey folks, a (maybe dump) question?: What is the difference betwen using [:merge map-schema-a map-schema-b] and (malli.util/merge map-schema-a map-schema-b)?

you can inspect the merge later when you use [:merge ...]

when you use malli.util/merge, it creates a new map-schema with no relation to map-schema-a and map-schema-b

for most use cases, both are fine, but if you're doing something more complicated, there might be a difference

Ok, and what is a correct way to extract entries from [:merge ...] ?

user=> (def registry (merge (m/default-schemas) (mu/schemas)))
#'user/registry
user=> (m/children (m/schema [:merge [:map [:a :string]] [:map [:b :string]]] {:registry registry}))
[[:map [:a :string]] [:map [:b :string]]]

that's one way, another way might be walking the schema using malli.core/walk

ok, i see, thanks for the hint