demo normal swagger-responses

This commit is contained in:
Tommi Reiman 2018-06-25 10:18:40 +03:00
parent 18bd2e684f
commit 1993dee5f2

View file

@ -23,6 +23,8 @@
{:get {:summary "plus"
:parameters {:query {:x int?, :y int?}
:path {:z int?}}
:swagger {:responses {400 {:schema {:type "string"}
:description "kosh"}}}
:responses {200 {:body {:total int?}}
500 {:description "fail"}}
:handler (fn [{{{:keys [x y]} :query
@ -34,6 +36,8 @@
{:get {:summary "plus"
:parameters {:query {:x Int, :y Int}
:path {:z Int}}
:swagger {:responses {400 {:schema {:type "string"}
:description "kosh"}}}
:responses {200 {:body {:total Int}}
500 {:description "fail"}}
:handler (fn [{{{:keys [x y]} :query
@ -90,6 +94,8 @@
:type "integer"}}
:required ["total"]
:type "object"}}
400 {:schema {:type "string"}
:description "kosh"}
500 {:description "fail"}}
:summary "plus"}}
"/api/spec/plus/{z}" {:get {:parameters [{:description ""
@ -115,6 +121,8 @@
:type "integer"}}
:required ["total"]
:type "object"}}
400 {:schema {:type "string"}
:description "kosh"}
500 {:description "fail"}}
:summary "plus"}}}}
spec)))))