This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-04-07
Channels
- # announcements (1)
- # babashka (77)
- # beginners (219)
- # chlorine-clover (6)
- # cider (52)
- # clj-kondo (14)
- # cljdoc (5)
- # clojure (173)
- # clojure-europe (49)
- # clojure-finland (1)
- # clojure-germany (2)
- # clojure-italy (1)
- # clojure-nl (39)
- # clojure-sweden (4)
- # clojure-uk (51)
- # clojurescript (25)
- # code-reviews (9)
- # conjure (25)
- # data-science (2)
- # figwheel-main (6)
- # fulcro (74)
- # graalvm (1)
- # graphql (11)
- # jobs-discuss (17)
- # keechma (4)
- # lein-figwheel (4)
- # leiningen (1)
- # luminus (10)
- # malli (14)
- # mid-cities-meetup (2)
- # off-topic (28)
- # re-frame (5)
- # reagent (76)
- # reitit (30)
- # ring (7)
- # ring-swagger (1)
- # shadow-cljs (163)
- # spacemacs (11)
- # specter (2)
- # sql (43)
- # tools-deps (13)
- # vim (6)
- # yada (1)
Hello. How to setup retitit-swagger to group APIs under different group names? Is there a piece of code sample? THX!😊
@eric.shao Hello. Here's,a sample: https://github.com/metosin/reitit/blob/master/examples/ring-malli-swagger/src/example/server.clj#L55
@ikitommi 😀Thank you for your reply. I don’t describe clear, Is there a way to have a Two-level Group? A big group contains many secondary groups.
uthere is no such thing in swagger, but we have used tag names like admin
, admin.users
, admin.products
etc. Flat, but looks nested.
You could post an issue asking this into swagger-ui repo, if there would be such a grouping available nowadays, please paste the result here too.
oh, forgot, there is also https://cljdoc.org/d/metosin/reitit/0.4.2/doc/ring/swagger-support#multiple-swagger-apis
["/upload"
{:post {:summary "upload a file"
:parameters {:multipart [:map [:file reitit.ring.malli/temp-file-part]]}
:responses {200 {:body [:map [:name string?] [:size int?]]}}
:handler (fn [{{{:keys [file]} :multipart} :parameters}]
{:status 200
:body {:name (:filename file)
:size (:size file)}})}}]
{:middleware [;; query-params & form-params
parameters/parameters-middleware
;; content-negotiation
muuntaja/format-negotiate-middleware
;; encoding response body
muuntaja/format-response-middleware
;; exception handling
exception/exception-middleware
;; decoding request body
muuntaja/format-request-middleware
;; coercing response bodys
coercion/coerce-response-middleware
;; coercing request parameters
coercion/coerce-request-middleware
;; multipart params
multipart/multipart-middleware]
:muuntaja formats/instance
["/api"
{:middleware [;; query-params & form-params
parameters/parameters-middleware
;; content-negotiation
muuntaja/format-negotiate-middleware
;; encoding response body
muuntaja/format-response-middleware
;; exception handling
exception/exception-middleware
;; decoding request body
muuntaja/format-request-middleware
;; coercing response bodys
coercion/coerce-response-middleware
;; coercing request parameters
coercion/coerce-request-middleware
;; multipart params
multipart/multipart-middleware]
:muuntaja formats/instance
:coercion malli-coercion/coercion
because if i ignore the middleware and i hit :multipart-param directly I do see the file