mirror of
https://github.com/metosin/reitit.git
synced 2025-12-18 17:01:11 +00:00
test: enable openapi spec tests
This commit is contained in:
parent
f03134e215
commit
8f48cdc96c
1 changed files with 46 additions and 49 deletions
|
|
@ -22,14 +22,9 @@
|
||||||
:openapi {:info {:title "my-api"}}
|
:openapi {:info {:title "my-api"}}
|
||||||
:handler (openapi/create-openapi-handler)}}]
|
:handler (openapi/create-openapi-handler)}}]
|
||||||
|
|
||||||
#_["/spec" {:coercion spec/coercion}
|
["/spec" {:coercion spec/coercion}
|
||||||
["/plus/:z"
|
["/plus/:z"
|
||||||
{:patch {:summary "patch"
|
{:get {:summary "plus"
|
||||||
:handler (constantly {:status 200})}
|
|
||||||
:options {:summary "options"
|
|
||||||
:middleware [{:data {:openapi {:responses {200 {:description "200"}}}}}]
|
|
||||||
:handler (constantly {:status 200})}
|
|
||||||
:get {:summary "plus"
|
|
||||||
:parameters {:query {:x int?, :y int?}
|
:parameters {:query {:x int?, :y int?}
|
||||||
:path {:z int?}}
|
:path {:z int?}}
|
||||||
:openapi {:responses {400 {:description "kosh"
|
:openapi {:responses {400 {:description "kosh"
|
||||||
|
|
@ -119,48 +114,50 @@
|
||||||
expected {:x-id #{::math}
|
expected {:x-id #{::math}
|
||||||
:openapi "3.1.0"
|
:openapi "3.1.0"
|
||||||
:info {:title "my-api"}
|
:info {:title "my-api"}
|
||||||
:paths {#_#_"/api/spec/plus/{z}" {:patch {:summary "patch"
|
:paths {"/api/spec/plus/{z}" {:get {:parameters [{:in "query"
|
||||||
:responses {:default {:description ""}}}
|
:name "x"
|
||||||
:options {:summary "options"
|
:description ""
|
||||||
:responses {200 {:description "200"}}}
|
:required true
|
||||||
:get {:parameters [{:in "query"
|
:schema {:type "integer"
|
||||||
:name "x"
|
:format "int64"}}
|
||||||
:description ""
|
{:in "query"
|
||||||
:required true
|
:name "y"
|
||||||
:schema {:type "integer"}}
|
:description ""
|
||||||
{:in "query"
|
:required true
|
||||||
:name "y"
|
:schema {:type "integer"
|
||||||
:description ""
|
:format "int64"}}
|
||||||
:required true
|
{:in "path"
|
||||||
:schema {:type "integer"}}
|
:name "z"
|
||||||
{:in "path"
|
:description ""
|
||||||
:name "z"
|
:required true
|
||||||
:description ""
|
:schema {:type "integer"
|
||||||
:required true
|
:format "int64"}}]
|
||||||
:schema {:type "integer"}}]
|
:responses {200 {:content {"application/json" {:schema {:type "object"
|
||||||
:responses {200 {:content {"application/json" {:schema {:type "object"
|
:properties {"total" {:format "int64"
|
||||||
:properties {"total" {:format "int64"
|
:type "integer"}}
|
||||||
:type "integer"}}
|
:required ["total"]}}}}
|
||||||
:required ["total"]}}}}
|
400 {:description "kosh"
|
||||||
400 {:description "kosh"
|
:content {"application/json" {:schema {:type "string"}}}}
|
||||||
:content {"application/json" {:schema {:type "string"}}}}
|
500 {:description "fail"}}
|
||||||
500 {:description "fail"}}
|
:summary "plus"}
|
||||||
:summary "plus"}
|
:post {:parameters [{:in "path"
|
||||||
:post {:parameters [{:in "path"
|
:name "z"
|
||||||
:name "z"
|
:required true
|
||||||
:required true
|
:description ""
|
||||||
:schema {:type "integer"}}]
|
:schema {:type "integer"
|
||||||
:requestBody {:content {"application/json" {:schema {:oneOf [{:items {:type "integer"}
|
:format "int64"}}]
|
||||||
:type "array"}
|
:requestBody {:content {"application/json" {:schema {:oneOf [{:items {:type "integer"
|
||||||
{:type "null"}]}}}}
|
:format "int64"}
|
||||||
:responses {200 {:content {"application/json" {:schema {:properties {"total" {:format "int64"
|
:type "array"}
|
||||||
:type "integer"}}
|
{:type "null"}]}}}}
|
||||||
:required ["total"]
|
:responses {200 {:content {"application/json" {:schema {:properties {"total" {:format "int64"
|
||||||
:type "object"}}}}
|
:type "integer"}}
|
||||||
400 {:content {"application/json" {:schema {:type "string"}}}
|
:required ["total"]
|
||||||
:description "kosh"}
|
:type "object"}}}}
|
||||||
500 {:description "fail"}}
|
400 {:content {"application/json" {:schema {:type "string"}}}
|
||||||
:summary "plus with body"}}
|
:description "kosh"}
|
||||||
|
500 {:description "fail"}}
|
||||||
|
:summary "plus with body"}}
|
||||||
"/api/malli/plus/{z}" {:get {:parameters [{:in "query"
|
"/api/malli/plus/{z}" {:get {:parameters [{:in "query"
|
||||||
:name :x
|
:name :x
|
||||||
:required true
|
:required true
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue