Fork me on GitHub
#malli
<
2023-02-18
>
pavlosmelissinos09:02:02

I want to define a schema for a map that can contain anything (it's a placeholder)

(every? true? [(m/validate schema {:foo "bar" "foo" :bar})
               (m/validate schema {{:a :b :c :d} [:ho :ho :ho]})
               (m/validate schema {})
               (not (m/validate schema '()))
               (not (m/validate schema #{}))
               (not (m/validate schema []))])
;;=> true
[:map-of any? any?] seems to work; is it the right schema to use?

2
Ben Sless10:02:54

Why not just :map?

pavlosmelissinos10:02:51

Because I was sure I tried it and it didn't work facepalm

pavlosmelissinos10:02:12

Thanks, I suspected I was missing something obvious 🙂

Ben Sless10:02:02

Happens 🙃