Problem: I want to spec a coll of maps. I know I can use s/coll-of
and specify :kind vector?
or :kind list?
,
but either is fine, so I've omitted it. When I call s/explain
for this spec with a map it fails properly,
but I get explain data for each map entry that says "x" isn't a map. I'd prefer it say it's not a collection and stop there.
Solution:
(s/def ::example (s/coll-of (s/keys :req-un [::foo])