Increasingly Functional.
by Joshua Miller | on Twitter | on the web | on github

Dynamically Generating clojure.spec Keywords

July 13th 2016

I've been experimenting with clojure.spec on a new web project, as a way of validating data coming in from the client. We're using JSON API as the lingua franca between the server and client, which adds a not-insignificant amount of ceremony and overhead to the JSON payload. So once I got one namespace's endpoints spec'ed correctly, the obvious next step was to generalize it with a function that looked like this (edited for brevity):