malli

dharrigan 2025-02-23T13:58:22.151879Z

If I have schema that has a default value, e.g., [:map [:is-private {:default false} :boolean]], and I run it over a malli.generator/generate Schema, the value of is-private changes randomly between true and false (which I guess is expected from a generator), but is there a way for the generator to honour a {:default ,,,} config so that I can always get it to generate a false?

Piotr Roterski 2025-02-23T14:36:56.136159Z

@dharrigan I believe https://github.com/metosin/malli#value-generation:~:text=%3Aand%20%7B-,%3Agen/return%2042,-%7D%20%3Aint%5D) is what you are looking for

dharrigan 2025-02-23T14:40:25.774229Z

beautiful! thank you! 🙂

🙌 1