test: enable openapi spec tests

This commit is contained in:
Joel Kaasinen 2023-02-15 16:23:59 +02:00
parent f03134e215
commit 8f48cdc96c

View file

@ -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,25 +114,24 @@
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 ""}}}
:options {:summary "options"
:responses {200 {:description "200"}}}
:get {:parameters [{:in "query"
:name "x" :name "x"
:description "" :description ""
:required true :required true
:schema {:type "integer"}} :schema {:type "integer"
:format "int64"}}
{:in "query" {:in "query"
:name "y" :name "y"
:description "" :description ""
:required true :required true
:schema {:type "integer"}} :schema {:type "integer"
:format "int64"}}
{:in "path" {:in "path"
:name "z" :name "z"
:description "" :description ""
:required true :required true
:schema {:type "integer"}}] :schema {:type "integer"
:format "int64"}}]
: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"}}
@ -149,8 +143,11 @@
:post {:parameters [{:in "path" :post {:parameters [{:in "path"
:name "z" :name "z"
:required true :required true
:schema {:type "integer"}}] :description ""
:requestBody {:content {"application/json" {:schema {:oneOf [{:items {:type "integer"} :schema {:type "integer"
:format "int64"}}]
:requestBody {:content {"application/json" {:schema {:oneOf [{:items {:type "integer"
:format "int64"}
:type "array"} :type "array"}
{:type "null"}]}}}} {:type "null"}]}}}}
:responses {200 {:content {"application/json" {:schema {:properties {"total" {:format "int64" :responses {200 {:content {"application/json" {:schema {:properties {"total" {:format "int64"