http-swagger++

This commit is contained in:
Tommi Reiman 2019-04-19 22:25:59 -04:00
parent 6b5c35143d
commit dc92f6f48e
3 changed files with 9 additions and 3 deletions

View file

@ -9,8 +9,10 @@
[reitit.http.interceptors.muuntaja :as muuntaja]
[reitit.http.interceptors.exception :as exception]
[reitit.http.interceptors.multipart :as multipart]
[reitit.http.spec :as spec]
[reitit.http.interceptors.dev :as dev]
[reitit.interceptor.sieppari :as sieppari]
[reitit.dev.pretty :as pretty]
[ring.adapter.jetty :as jetty]
[aleph.http :as client]
[muuntaja.core :as m]
@ -110,9 +112,13 @@
:body {:total (- x y)}})}}]]]
{;;:reitit.interceptor/transform dev/print-context-diffs
:validate spec/validate
:exception pretty/exception
:data {:coercion spec-coercion/coercion
:muuntaja m/instance
:interceptors [;; query-params & form-params
:interceptors [;; swagger feature
swagger/swagger-feature
;; query-params & form-params
(parameters/parameters-interceptor)
;; content-negotiation
(muuntaja/format-negotiate-interceptor)

View file

@ -22,5 +22,5 @@
[routes {:keys [spec] :or {spec ::data}}]
(when-let [problems (rrs/validate-route-data routes :interceptors spec)]
(exception/fail!
::invalid-route-data
::rs/invalid-route-data
{:problems problems})))

View file

@ -42,5 +42,5 @@
[routes {:keys [spec] :or {spec ::data}}]
(when-let [problems (validate-route-data routes :middleware spec)]
(exception/fail!
::invalid-route-data
::rs/invalid-route-data
{:problems problems})))