Fork me on GitHub
#clojure-spec
<
2023-06-11
>
Sturm13:06:24

is it possible to use spec to validate maps where keys are strings? eg. to check {"name" "Joe" "age" 66} to make sure "name" and "age" are present and that they match string? and int? respectively. I might be missing something obvious, but I can only see examples with keyword-based maps.

Alex Miller (Clojure team)13:06:03

You can use map-of but not s/keys

Sturm13:06:44

thanks @U064X3EF3, I'll have a play with map-of