Fork me on GitHub
#malli
<
2021-06-12
>
robert-stuttaford06:06:39

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

ikitommi07:06:43

humaize should not throw, ever. There is an open issue/PR, seems stalled: https://github.com/metosin/malli/pull/333#discussion_r588855299

robert-stuttaford06:06:45

i'll put together a repro and submit an issue. my problem seems different to the one that you have linked

robert-stuttaford14:06:36

turns out i was overwriting instead of adding to the default error message set facepalm

respatialized15:06:43

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

ikitommi15:06:53

@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.

3
ikitommi15:06:14

see m/children-schema and m/properties-schema

respatialized16:06:29

@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.