How do I describe keywords with a certain namespace? Something like [:qualified-keyword {:namespace :asdf}]
to match :asdf/x
and :asdf/y
@aaron51 something like [:and :qualified-keyword [:fn (fn [x] (= :asdf (namespace x))]]
?
yes! thank you
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.
Also, sounds useful enough, so you could do a PR of that.
thank you, I’ll give it a try 👍
Some examples how to build custom s (simple) schemas: https://github.com/metosin/malli/blob/master/test/malli/core_test.cljc#L1392-L1470