you can configure the the mu/merge
with few options, see`:merge-default` in mu/union
https://github.com/metosin/malli/blob/master/src/malli/util.cljc#L104-L113
Would that be mu/intercect
with :and
? If so, PR welcome.
is there a way I can set all map schema :closed by default? so that don't need to specify individually.
I don't think there is, however, you could gather up all your schemas and map over them with malli.utils/closed-schema
to recursively close them.
That may work
You could copy the -map-schema
definition and make your own -closed-map-schema
https://github.com/metosin/malli/blob/master/src/malli/core.cljc#L616
so you could write:
[:closed-map [:xyz string?]]
not sure if that's worth it vs just typing {:closed true}
though
thanks guys, sounds good, cheers
@siddharthjain.in or better: create a PR that allows m/-map-schema
to take :closed
and then say:
(m/-map-schema {:naked-keys true, :closed true})
.. and you have a closed variant.