Fork me on GitHub
Ilari Tuominen12:07:59

Hi, I’m having a bit of problems with swagger.json generation with reitit. My idea is to run my app with two sets of routes, where the public one is swagger-documented but the private one is not.

(defn routes []
   ["/public" public-route-configuration
   ;; swagger documentation
    ["" {:no-doc true
         :swagger {:info {:title "Public"
                          :description "Public api for external service integration"}}}

      {:get (swagger/create-swagger-handler)}]

      {:get (swagger-ui/create-swagger-ui-handler
             {:url "/api/swagger.json"
              :config {:validator-url nil}})}]]

     {:no-doc true
      :get (constantly (ok {:message "pong"}))}]


  ["/private" private-route-configuration
For some reason if I add the private route the swagger.json generation fails silently. Is this something that is discouraged and therefore shouldn’t even work by design or should I put the swagger description on the top level instead and mark them with :no-doc?