malli

richiardiandrea 2024-09-10T13:36:28.902509Z

Hi folks, I was wondering if there is a way to validate symbols in :extend-with-metadata protocols...my team is worried we get out of sync if we don't have that 😄

avocade 2024-09-10T13:53:51.587979Z

Hey, love malli (esp with prismatic/plumatic schema syntax 🙏🙂). But I'd like our spec errors to manifest as thrown exceptions when they happen, instead of spewing sometimes tens/hundreds of similar errors in the logs, making things hard to see. I remember us enabling a setting for some spec lib years ago, but not malli (could have been guardrails or smth). Basically we're using a simple convenience wrapper macro internally, so if there's not a global setting to enable throwing on the first error, should we just add something here to get a similar result?

(defmacro >defn
     [& args]
     (mx/-defn mx/SchematizedParams args))

Stig Brautaset 2024-09-10T21:33:00.515289Z

You could use one of the built-in reporters that throw instead of returning errors, e.g. https://github.com/metosin/malli/blob/master/src/malli/dev/pretty.cljc#L173-L179

avocade 2024-09-11T08:44:45.757039Z

Thx Stig I’ll try that 🙌🏻