mirror of
https://github.com/metosin/reitit.git
synced 2025-12-18 00:41:12 +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"
|
||||
{:post {:summary "upload a file"
|
||||
:parameters {:multipart [:map [:file reitit.ring.malli/temp-file-part]]}
|
||||
:responses {200 {:body [:map [:name string?] [:size int?]]}}
|
||||
:parameters {:multipart {:file reitit.ring.malli/temp-file-part}}
|
||||
:responses {200 {:body {:name :string, :size :int}}}
|
||||
:handler (fn [{{{:keys [file]} :multipart} :parameters}]
|
||||
{:status 200
|
||||
:body {:name (:filename file)
|
||||
|
|
@ -56,26 +56,20 @@
|
|||
|
||||
["/plus"
|
||||
{:get {:summary "plus with malli query parameters"
|
||||
:parameters {:query [:map
|
||||
[:x
|
||||
{:title "X parameter"
|
||||
:description "Description for X parameter"
|
||||
:json-schema/default 42}
|
||||
int?]
|
||||
[:y int?]]}
|
||||
:responses {200 {:body [:map [:total int?]]}}
|
||||
:parameters {:query {:x [:int {:title "X parameter"
|
||||
:description "Description for X parameter"
|
||||
:json-schema/default 42}]
|
||||
:y :int}}
|
||||
:responses {200 {:body {:total :int}}}
|
||||
:handler (fn [{{{:keys [x y]} :query} :parameters}]
|
||||
{:status 200
|
||||
:body {:total (+ x y)}})}
|
||||
:post {:summary "plus with malli body parameters"
|
||||
:parameters {:body [:map
|
||||
[:x
|
||||
{:title "X parameter"
|
||||
:description "Description for X parameter"
|
||||
:json-schema/default 42}
|
||||
int?]
|
||||
[:y int?]]}
|
||||
:responses {200 {:body [:map [:total int?]]}}
|
||||
:parameters {:body {:x [:int {:title "X parameter"
|
||||
:description "Description for X parameter"
|
||||
:json-schema/default 42}]
|
||||
:y :int}}
|
||||
:responses {200 {:body {:total :int}}}
|
||||
:handler (fn [{{{:keys [x y]} :body} :parameters}]
|
||||
{:status 200
|
||||
:body {:total (+ x y)}})}}]]]
|
||||
|
|
|
|||
Loading…
Reference in a new issue