malli

Shantanu Kumar 2025-12-22T16:41:57.903609Z

Hi, I have a newbie question: Why would this return true?

(mc/validate [:map [:count {:optional true :min 1 :max 10} :int]] {:count 0})
=> true
I want the validation to fail when :count value is not in min/max range.

Kirill Chernyshov 2025-12-22T16:44:47.418519Z

min/max are ignored when applied to the map key schema. Add those to the :int instead https://malli.io/?value=%7B%3Acount%200%7D&schema=%5B%3Amap%20%5B%3Acount%20%7B%3Aoptional%20true%7D%20%5B%3Aint%20%7B%3Amin%201%20%3Amax%2010%7D%5D%5D%5D

👍 1
🙏🏽 1
dharrigan 2025-12-22T16:46:59.873399Z

(mc/validate [:map [:count {:optional true} [:int {:min 1 :max 10}]]] {:count 0}) => false

🙏🏽 1
Shantanu Kumar 2025-12-22T16:46:59.964059Z

I see, thank you!

conao3 2025-12-22T05:51:02.017819Z

I'm using light-theme Emacs. Malli's error messages are likely designed for dark-theme users, making them difficult to read for those using light-theme. Is it possible to configure these messages for light-theme?

➕ 1
Samuel Ludwig 2025-12-22T13:09:02.348809Z

Oh man this has also been killing me for a while, my background is a slightly-off-white (flatwhite theme) so those chars are practically invisible