clojure-spec

ghaskins 2024-04-08T17:46:24.333759Z

Hi All. I swear I have done this before, but I cannot find it or an answer on the web: Is there a way to validate that a map adheres to a certain spec for keys and a different spec for values, rather than something like s/keys where I know the keys up front?

ghaskins 2024-04-08T17:47:45.153859Z

What I am trying to do specifically is ensure that all the values are valid json strings

phronmophobic 2024-04-08T17:52:08.757839Z

Are you thinking of https://clojure.github.io/spec.alpha/clojure.spec.alpha-api.html#clojure.spec.alpha/map-of

ghaskins 2024-04-08T17:52:33.420979Z

Yes! ty!

👍 1