This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-10-24
Channels
- # announcements (1)
- # aws (2)
- # beginners (147)
- # boot (19)
- # cider (57)
- # clara (52)
- # cljdoc (18)
- # cljs-dev (14)
- # cljsrn (4)
- # clojure (176)
- # clojure-conj (9)
- # clojure-dev (9)
- # clojure-germany (2)
- # clojure-italy (4)
- # clojure-spec (13)
- # clojure-uk (56)
- # clojurescript (72)
- # code-reviews (11)
- # cursive (17)
- # data-science (1)
- # datomic (52)
- # duct (26)
- # emacs (6)
- # events (9)
- # figwheel (1)
- # figwheel-main (21)
- # fulcro (132)
- # funcool (1)
- # graphql (3)
- # jobs-discuss (42)
- # leiningen (3)
- # luminus (45)
- # mount (10)
- # off-topic (2)
- # re-frame (17)
- # reagent (12)
- # reitit (20)
- # ring-swagger (7)
- # rum (3)
- # shadow-cljs (256)
- # slack-help (15)
- # sql (7)
- # tools-deps (50)
- # uncomplicate (1)
- # yada (9)
@petr.mensik could you explain your use case bit more? There are several ways…
I plan to feed it to the AWS API Gateway to automate API creation and update directly from code. I might also use this project which expects swagger.json in target folder https://github.com/trieloff/lein-aws-apigateway
@petr.mensik One way is to ask the generated out of an app:
(require '[compojure.api.swagger :as swagger])
;; the app
(def app ...)
(app {:request-method :get, :uri (swagger/swagger-spec-path app)})
the default swagger-endpoint is named :compojure.api.swagger/swagger
and that function uses the reverse-routing to find the uri and then you just ask the response.
(defn swagger-spec-path
[app]
(some-> app
routes/get-routes
routes/route-lookup-table
::swagger
keys
first))
not documented that well, but one can get the reverse-routing tree out of an app, and lot’s of other things too.
Sounds like a good option, thank you! haven't thought of reverse routing