malli

https://github.com/metosin/malli :malli:
robert-stuttaford 2021-06-12T06:07:39.110600Z

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

ikitommi 2021-06-12T07:20:43.111Z

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

robert-stuttaford 2021-06-13T06:22:45.125100Z

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

robert-stuttaford 2021-06-13T14:46:36.125400Z

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

respatialized 2021-06-12T15:08:43.116200Z

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

ikitommi 2021-06-12T15:42:53.121400Z

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

✅ 1
ikitommi 2021-06-12T15:47:14.122200Z

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

respatialized 2021-06-12T16:06:29.124500Z

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

borkdude 2021-06-12T18:14:42.124700Z

Enjoyed this podcast: https://twitter.com/JacekSchae/status/1402648727215542272

👍 5