mirror of
https://github.com/metosin/reitit.git
synced 2025-12-18 17:01:11 +00:00
lite-it!
This commit is contained in:
parent
0ac3a14805
commit
20b37b7d43
1 changed files with 12 additions and 18 deletions
|
|
@ -34,8 +34,8 @@
|
||||||
|
|
||||||
["/upload"
|
["/upload"
|
||||||
{:post {:summary "upload a file"
|
{:post {:summary "upload a file"
|
||||||
:parameters {:multipart [:map [:file reitit.ring.malli/temp-file-part]]}
|
:parameters {:multipart {:file reitit.ring.malli/temp-file-part}}
|
||||||
:responses {200 {:body [:map [:name string?] [:size int?]]}}
|
:responses {200 {:body {:name :string, :size :int}}}
|
||||||
:handler (fn [{{{:keys [file]} :multipart} :parameters}]
|
:handler (fn [{{{:keys [file]} :multipart} :parameters}]
|
||||||
{:status 200
|
{:status 200
|
||||||
:body {:name (:filename file)
|
:body {:name (:filename file)
|
||||||
|
|
@ -56,26 +56,20 @@
|
||||||
|
|
||||||
["/plus"
|
["/plus"
|
||||||
{:get {:summary "plus with malli query parameters"
|
{:get {:summary "plus with malli query parameters"
|
||||||
:parameters {:query [:map
|
:parameters {:query {:x [:int {:title "X parameter"
|
||||||
[:x
|
:description "Description for X parameter"
|
||||||
{:title "X parameter"
|
:json-schema/default 42}]
|
||||||
:description "Description for X parameter"
|
:y :int}}
|
||||||
:json-schema/default 42}
|
:responses {200 {:body {:total :int}}}
|
||||||
int?]
|
|
||||||
[:y int?]]}
|
|
||||||
:responses {200 {:body [:map [:total int?]]}}
|
|
||||||
:handler (fn [{{{:keys [x y]} :query} :parameters}]
|
:handler (fn [{{{:keys [x y]} :query} :parameters}]
|
||||||
{:status 200
|
{:status 200
|
||||||
:body {:total (+ x y)}})}
|
:body {:total (+ x y)}})}
|
||||||
:post {:summary "plus with malli body parameters"
|
:post {:summary "plus with malli body parameters"
|
||||||
:parameters {:body [:map
|
:parameters {:body {:x [:int {:title "X parameter"
|
||||||
[:x
|
:description "Description for X parameter"
|
||||||
{:title "X parameter"
|
:json-schema/default 42}]
|
||||||
:description "Description for X parameter"
|
:y :int}}
|
||||||
:json-schema/default 42}
|
:responses {200 {:body {:total :int}}}
|
||||||
int?]
|
|
||||||
[:y int?]]}
|
|
||||||
:responses {200 {:body [:map [:total int?]]}}
|
|
||||||
:handler (fn [{{{:keys [x y]} :body} :parameters}]
|
:handler (fn [{{{:keys [x y]} :body} :parameters}]
|
||||||
{:status 200
|
{:status 200
|
||||||
:body {:total (+ x y)}})}}]]]
|
:body {:total (+ x y)}})}}]]]
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue