Fork me on GitHub
#clojure-spec
<
2019-12-11
>
bbrinck02:12:41

Slightly off-topic, but I have a question about what people would prefer in their error messages. I’d appreciate a vote if you have a minute https://twitter.com/bbrinck/status/1204595098207444993

👌 8
kenny22:12:00

Does anyone have a keys spec but for a map with string keys?

seancorfield23:12:00

@kenny Not sure how you'd do that -- s/keys requires keywords I believe? You could use s/map-of for string keys (and add some custom predicates depending on how much checking you need)...

kenny23:12:35

Yeah that's what I have. Was hoping someone had written something already that did that & generated valid values.

Alex Miller (Clojure team)23:12:39

you can get some of what you want by combining s/and and an s/conformer that keywordizes keys

Alex Miller (Clojure team)23:12:13

not sure it works on all the api operations the way you want though