Hello, I'm trying out Malli and I'm wondering what is the idiomatic approach to spec'ing a finit explicit set of values. Here's an example of a schema which works.
(m/validate
[:or [:= :foo]
[:= :bar]
[:= :baz]]
:foo)
;=> true
The syntax isn't as compact as I'd expect though. I'd hope something like
(m/validate
#{:foo :bar :baz}
:foo)
could work but I haven't seen this in the docs anywhere. Do I have to set up a custom registry for this?@smchugh230395 try [:enum :foo :bar :baz]
. Doc PRs welcome!
I will have a look after work today and make a doc PR. Thanks!