Fork me on GitHub
#malli
<
2020-12-29
>
aaron5116:12:18

How do I describe keywords with a certain namespace? Something like [:qualified-keyword {:namespace :asdf}] to match :asdf/x and :asdf/y

ikitommi16:12:40

@aaron51 something like [:and :qualified-keyword [:fn (fn [x] (= :asdf (namespace x))]]?

aaron5116:12:07

yes! thank you

ikitommi16:12:59

You can also create your own :qualified-keyword impl quite easily, on top of malli.core/-simple-schema, which would read the :namespace property and validate it behind the scenes. e.g. the syntax you proposed. Not near computer, but there are examples how to do that kind of stuff in the user space.

ikitommi16:12:44

Also, sounds useful enough, so you could do a PR of that.

aaron5117:12:25

thank you, I’ll give it a try 👍