mirror of
https://github.com/metosin/reitit.git
synced 2025-12-17 08:21:11 +00:00
http-swagger++
This commit is contained in:
parent
6b5c35143d
commit
dc92f6f48e
3 changed files with 9 additions and 3 deletions
|
|
@ -9,8 +9,10 @@
|
||||||
[reitit.http.interceptors.muuntaja :as muuntaja]
|
[reitit.http.interceptors.muuntaja :as muuntaja]
|
||||||
[reitit.http.interceptors.exception :as exception]
|
[reitit.http.interceptors.exception :as exception]
|
||||||
[reitit.http.interceptors.multipart :as multipart]
|
[reitit.http.interceptors.multipart :as multipart]
|
||||||
|
[reitit.http.spec :as spec]
|
||||||
[reitit.http.interceptors.dev :as dev]
|
[reitit.http.interceptors.dev :as dev]
|
||||||
[reitit.interceptor.sieppari :as sieppari]
|
[reitit.interceptor.sieppari :as sieppari]
|
||||||
|
[reitit.dev.pretty :as pretty]
|
||||||
[ring.adapter.jetty :as jetty]
|
[ring.adapter.jetty :as jetty]
|
||||||
[aleph.http :as client]
|
[aleph.http :as client]
|
||||||
[muuntaja.core :as m]
|
[muuntaja.core :as m]
|
||||||
|
|
@ -110,9 +112,13 @@
|
||||||
:body {:total (- x y)}})}}]]]
|
:body {:total (- x y)}})}}]]]
|
||||||
|
|
||||||
{;;:reitit.interceptor/transform dev/print-context-diffs
|
{;;:reitit.interceptor/transform dev/print-context-diffs
|
||||||
|
:validate spec/validate
|
||||||
|
:exception pretty/exception
|
||||||
:data {:coercion spec-coercion/coercion
|
:data {:coercion spec-coercion/coercion
|
||||||
:muuntaja m/instance
|
:muuntaja m/instance
|
||||||
:interceptors [;; query-params & form-params
|
:interceptors [;; swagger feature
|
||||||
|
swagger/swagger-feature
|
||||||
|
;; query-params & form-params
|
||||||
(parameters/parameters-interceptor)
|
(parameters/parameters-interceptor)
|
||||||
;; content-negotiation
|
;; content-negotiation
|
||||||
(muuntaja/format-negotiate-interceptor)
|
(muuntaja/format-negotiate-interceptor)
|
||||||
|
|
|
||||||
|
|
@ -22,5 +22,5 @@
|
||||||
[routes {:keys [spec] :or {spec ::data}}]
|
[routes {:keys [spec] :or {spec ::data}}]
|
||||||
(when-let [problems (rrs/validate-route-data routes :interceptors spec)]
|
(when-let [problems (rrs/validate-route-data routes :interceptors spec)]
|
||||||
(exception/fail!
|
(exception/fail!
|
||||||
::invalid-route-data
|
::rs/invalid-route-data
|
||||||
{:problems problems})))
|
{:problems problems})))
|
||||||
|
|
|
||||||
|
|
@ -42,5 +42,5 @@
|
||||||
[routes {:keys [spec] :or {spec ::data}}]
|
[routes {:keys [spec] :or {spec ::data}}]
|
||||||
(when-let [problems (validate-route-data routes :middleware spec)]
|
(when-let [problems (validate-route-data routes :middleware spec)]
|
||||||
(exception/fail!
|
(exception/fail!
|
||||||
::invalid-route-data
|
::rs/invalid-route-data
|
||||||
{:problems problems})))
|
{:problems problems})))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue