is there a trick to debugging this m/explain
exception? Vector's key for assoc must be a number.
at https://github.com/metosin/malli/blob/master/src/malli/error.cljc#L139
humaize should not throw, ever. There is an open issue/PR, seems stalled: https://github.com/metosin/malli/pull/333#discussion_r588855299
i'll put together a repro and submit an issue. my problem seems different to the one that you have linked
turns out i was overwriting instead of adding to the default error message set 🤦
I feel like I may have asked this question before, but am having trouble finding the right keywords to search in the slack archive, so apologies for the redundant question: Does malli
provide a meta-schema or helper function I can use to programatically validate forms that may or may not be valid malli
schemas? Is there a self-describing malli schema for malli schemas?
Something like:
(m/validate malli-meta-schema [:a])
=> false
(m/validate malli-meta-schema [:or [:fn int?] [:fn string?]])
=> true
@afoltzm not yet. But since 0.5.0, each IntoSchema
can describe it's properties and children schemas. Once all built-in schemas have described themselves (currently empty impls), one can ask from a registry the accumulated schema for schema AST.
see m/children-schema
and m/properties-schema
@ikitommi gotcha, thanks! right now I'm just doing a basic helper predicate that relies on the catching the exception thrown by calling m/schema
on the form, which I think suffices for my current use case.
Enjoyed this podcast: https://twitter.com/JacekSchae/status/1402648727215542272