4 ms·
I’ve recently built a thing at work to generate an OpenAPI spec from Clojure specs and some annotations, which worked out surprisingly well. We already have a c
by sulami 7y ago
I’ve recently built a thing at work to generate an OpenAPI spec from Clojure specs and some annotations, which worked out surprisingly well. We already have a collection of endpoints through compojure, and we just spec the handler functions and add some annotations for docstrings, and that’s basically it. As an added bonus we have the test suite validate all api calls against the spec, so in theory the OpenAPI spec should always be accurate.
For the curious, we took and hacked https://github.com/metosin/spec-tools https://github.com/metosin/spec-tools to output OpenAPI 3, and added a very thin shim to hook that up to our routes.