Update server.clj

This commit is contained in:
Tommi Reiman 2020-02-14 16:27:45 +02:00 committed by GitHub
parent 076f1327b4
commit 96c2764de6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -55,13 +55,13 @@
{:swagger {:tags ["math"]}} {:swagger {:tags ["math"]}}
["/plus" ["/plus"
{:get {:summary "plus with spec query parameters" {:get {:summary "plus with malli query parameters"
:parameters {:query [:map [:x int?] [:y int?]]} :parameters {:query [:map [:x int?] [:y int?]]}
:responses {200 {:body [:map [:total 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 spec body parameters" :post {:summary "plus with malli body parameters"
:parameters {:body [:map [:x int?] [:y int?]]} :parameters {:body [:map [:x int?] [:y int?]]}
:responses {200 {:body [:map [:total int?]]}} :responses {200 {:body [:map [:total int?]]}}
:handler (fn [{{{:keys [x y]} :body} :parameters}] :handler (fn [{{{:keys [x y]} :body} :parameters}]