reitit

https://cljdoc.org/d/metosin/reitit/ https://github.com/metosin/reitit/
DG 2021-03-12T01:48:12.066300Z

Hi, I’ve been trying to find out how to enable reitit to output the :definitions key with models when using swagger and couldn’t find any solution. Is there some way to integrate ring-swagger with it? Same way ring-swagger outputs model defintions here: https://github.com/metosin/ring-swagger#more-complete-example (automatically references the schema via definitions)

raymcdermott 2021-03-12T12:59:49.066900Z

I want to protect the swagger doc built from the malli data model using buddy. I have seen the reitit examples which protect routes but it's not clear how this integrates into the Swagger model ... also x post to malli

ikitommi 2021-03-12T15:12:26.069800Z

@raymcdermott we pulled out the swagger-endpoints into normal ring handler just for this. in compojure-api, they we inside the api macro, making things hard. With reitit, you just wrap a security mw into the routes, e.g.

["" {:no-doc :true, 
     :middleware [wrap-hide-me-from-the-evil-of-the-world]}
 ["/swagger.json" ...]
 ["/api-docs/*" ...]]
don’t have the buddy-auth example at hand, I recall there is one under /examples

raymcdermott 2021-03-12T15:47:53.070100Z

yeah, I got it working from the examples

raymcdermott 2021-03-12T15:48:00.070300Z

thanks @ikitommi