mirror of
https://github.com/metosin/reitit.git
synced 2025-12-17 00:11: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.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)
|
||||
|
|
|
|||
|
|
@ -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})))
|
||||
|
|
|
|||
|
|
@ -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})))
|
||||
|
|
|
|||
Loading…
Reference in a new issue