mirror of
https://github.com/metosin/reitit.git
synced 2025-12-17 00:11:11 +00:00
fix: enable validatio nin examples/ring-malli-swagger, make it pass
This commit is contained in:
parent
5352fd4f99
commit
557c89acdd
1 changed files with 6 additions and 6 deletions
|
|
@ -12,7 +12,7 @@
|
||||||
[reitit.ring.middleware.multipart :as multipart]
|
[reitit.ring.middleware.multipart :as multipart]
|
||||||
[reitit.ring.middleware.parameters :as parameters]
|
[reitit.ring.middleware.parameters :as parameters]
|
||||||
; [reitit.ring.middleware.dev :as dev]
|
; [reitit.ring.middleware.dev :as dev]
|
||||||
; [reitit.ring.spec :as spec]
|
[reitit.ring.spec :as spec]
|
||||||
; [spec-tools.spell :as spell]
|
; [spec-tools.spell :as spell]
|
||||||
[ring.adapter.jetty :as jetty]
|
[ring.adapter.jetty :as jetty]
|
||||||
[muuntaja.core :as m]
|
[muuntaja.core :as m]
|
||||||
|
|
@ -46,7 +46,7 @@
|
||||||
:handler (openapi/create-openapi-handler)}}]
|
:handler (openapi/create-openapi-handler)}}]
|
||||||
|
|
||||||
["/files"
|
["/files"
|
||||||
{:tags ["files"]}
|
{:tags #{"files"}}
|
||||||
|
|
||||||
["/upload"
|
["/upload"
|
||||||
{:post {:summary "upload a file"
|
{:post {:summary "upload a file"
|
||||||
|
|
@ -61,7 +61,7 @@
|
||||||
{:get {:summary "downloads a file"
|
{:get {:summary "downloads a file"
|
||||||
:swagger {:produces ["image/png"]}
|
:swagger {:produces ["image/png"]}
|
||||||
:responses {200 {:description "an image"
|
:responses {200 {:description "an image"
|
||||||
:content {"image/png" any?}}}
|
:content {"image/png" {:schema any?}}}}
|
||||||
:handler (fn [_]
|
:handler (fn [_]
|
||||||
{:status 200
|
{:status 200
|
||||||
:headers {"Content-Type" "image/png"}
|
:headers {"Content-Type" "image/png"}
|
||||||
|
|
@ -70,7 +70,7 @@
|
||||||
(io/input-stream))})}}]]
|
(io/input-stream))})}}]]
|
||||||
|
|
||||||
["/math"
|
["/math"
|
||||||
{:tags ["math"]}
|
{:tags #{"math"}}
|
||||||
|
|
||||||
["/plus"
|
["/plus"
|
||||||
{:get {:summary "plus with malli query parameters"
|
{:get {:summary "plus with malli query parameters"
|
||||||
|
|
@ -99,7 +99,7 @@
|
||||||
:body {:total (+ x y)}})}}]]
|
:body {:total (+ x y)}})}}]]
|
||||||
|
|
||||||
["/secure"
|
["/secure"
|
||||||
{:tags ["secure"]
|
{:tags #{"secure"}
|
||||||
:openapi {:security [{"auth" []}]}
|
:openapi {:security [{"auth" []}]}
|
||||||
:swagger {:security [{"auth" []}]}}
|
:swagger {:security [{"auth" []}]}}
|
||||||
["/get"
|
["/get"
|
||||||
|
|
@ -115,7 +115,7 @@
|
||||||
:body {:error "unauthorized"}}))}}]]]
|
:body {:error "unauthorized"}}))}}]]]
|
||||||
|
|
||||||
{;;:reitit.middleware/transform dev/print-request-diffs ;; pretty diffs
|
{;;:reitit.middleware/transform dev/print-request-diffs ;; pretty diffs
|
||||||
;;:validate spec/validate ;; enable spec validation for route data
|
:validate spec/validate ;; enable spec validation for route data
|
||||||
;;:reitit.spec/wrap spell/closed ;; strict top-level validation
|
;;:reitit.spec/wrap spell/closed ;; strict top-level validation
|
||||||
:exception pretty/exception
|
:exception pretty/exception
|
||||||
:data {:coercion (reitit.coercion.malli/create
|
:data {:coercion (reitit.coercion.malli/create
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue