Fork me on GitHub

Hi, I'm sure it's been asked before, but googling didn't turn anything up: is there an easy way to associate comments to specs? My usecase is working together with some non-clojure (actually, non-programmer) people on a data definition. I'm used to spec and all the related tooling, but I can't expect the others to really understand everything from code.


it's not supported out of the box. you need to build your own metadata api for specs right now if you need that.


it's quite easy to do tho, basically an atom and a few functions that will work against it. We have something like that internally, we can do (-> (s/def ::foo string?) (x/vary-meta! assoc :doc "some docstring"))


s/def returns the spec key, you can take advantage of this. and from there writing x/with-doc is just a small fn

👍 2
Alex Miller (Clojure team)14:07:14

this is the most requested feature for spec and I expect it will be added in spec 2

👍 8