Fork me on GitHub

there is also loose matching with regex on content-type in muuntaja: The results are (fifo-)memoized against input, so about as fast as the the exact-matching like "application/json". I dislike regexs, but as current ring-json, ring-transit & ring-middleware-format have that, it’s supported in Muuntaja.


for the dynamic swagger generation - not easy with c-api. Libs like Kekkonen ( create swagger-docs dynamically: routes are filtered away based on user privileges and one can partially apply parameters for request and get a “what do I still need” docs. But swagger-ui doesn’t really support that.


When the spec-things are finalized, there could be a spec-enabled api-docs ui for e2e cljs apps, while swagger would serve the non-cljs clients.


bit of an odd question that i do have a workaround for but curious , i’d like to put the swagger.json as generated from (swagger-routes) behind an api resource (behind liberator in fact to reuse shared auth / etc) , struggling to get this to work , have a liberator resource just returning (swagger-routes) , with no coercion , with my swagger items configured under top level (api {:swagger})


this just gives me a cannot encode json exception


is this the right approach? i’d just like to generate a swagger.json and serve it as a resource


i ended up just duplicating the (let [runtime-info …) from api/swagger.clj (swagger-docs) in my liberator resource and it works fine