Fork me on GitHub
#reitit
<
2020-02-03
>
ikitommi06:02:27

there could be a api-middleware chain that is ordered and contains all the top-level relevant things. both the :middleware and :interceptors flatten extra vectors, so just having this works:

(def api-middleware
  [;; swagger feature
   swagger/swagger-feature
   ;; 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
   multipart/multipart-middleware])

;; Usage
{:middleware [api-middleware my-middleware ...]}

dharrigan20:02:25

btw, I'm not sure my bugfix for the exception handling doc fixed the issue, it's still trying to reference a md page. I tried running with gitbook serve, but it won't translate the md to html.