malli
malli copied to clipboard
Custom Default Options
what
Instead of allowing one to override just the default registry (using malli.registry/type
), one should be able to override the full default options instead.
why
- one can configure anything, e.g. override error localization, generators, ...
-
sci
can be passed in via explicit option - there can be schema systems with and without sci in same JVM:
(m/schema
[:fn '(fn [x] (> x 10))]
{:evaluator malli.sci/evaluator})
how
instead of malli.registry/type
, define a malli.core/options
with values "default"
or "custom"
. Relevant keys are (at least):
-
:registry
(themalli.registry/Registry
impl -
:evaluator
, maybe a Protocol for this too.
big change
nah, mostly mechanical port.