malli

2024-08-18T11:10:22.818419Z

Why does this give invalid schema error? (m/schema [:number? {:min 0 :max 10}]) And why does this (m/validate (m/schema [number? {:min 0 :max 10}]) 11) return true?

Ben Sless 2024-08-18T13:59:44.679489Z

The first: no schema for keyword :number?, use :number The second: you used a function not a keyword

👍 1
2024-08-18T20:12:18.111629Z

For the latter, it's a https://github.com/metosin/malli/blob/39244905665541c8d895c8b121b6ecf508fc2b18/src/malli/core.cljc#L2580-L2588 which has no support for min/max properties. Though it would be less confusing if it were the same as :number. I think that's achievable with a couple of tweaks.

2024-08-18T22:25:28.570599Z

Is there even a :number schema?

2024-08-18T23:28:06.663269Z

I experimented a bit aligning things like any? and :any. I think it'll look something like this https://github.com/metosin/malli/pull/1092