diff --git a/test/cljc/reitit/openapi_test.clj b/test/cljc/reitit/openapi_test.clj index 6ae134b2..3db5533f 100644 --- a/test/cljc/reitit/openapi_test.clj +++ b/test/cljc/reitit/openapi_test.clj @@ -408,23 +408,23 @@ (get-in [:paths "/parameters" :post :parameters]) normalize)))) (testing "body parameter" - (is (match? {:schema (merge {:type "object" - :properties {:b {:type "string"}} - :required ["b"]} - ;; spec outputs open schemas - (when-not (#{#'spec/coercion} coercion) - {:additionalProperties false}))} + (is (match? (merge {:type "object" + :properties {:b {:type "string"}} + :required ["b"]} + ;; spec outputs open schemas + (when-not (#{#'spec/coercion} coercion) + {:additionalProperties false})) (-> spec - (get-in [:paths "/parameters" :post :requestBody :content "application/json"]) + (get-in [:paths "/parameters" :post :requestBody :content "application/json" :schema]) normalize)))) (testing "body response" - (is (match? {:schema (merge {:type "object" - :properties {:ok {:type "string"}} - :required ["ok"]} - (when-not (#{#'spec/coercion} coercion) - {:additionalProperties false}))} + (is (match? (merge {:type "object" + :properties {:ok {:type "string"}} + :required ["ok"]} + (when-not (#{#'spec/coercion} coercion) + {:additionalProperties false})) (-> spec - (get-in [:paths "/parameters" :post :responses 200 :content "application/json"]) + (get-in [:paths "/parameters" :post :responses 200 :content "application/json" :schema]) normalize)))) (testing "spec is valid" (is (nil? (validate spec)))))))) @@ -461,38 +461,38 @@ app :body)] (testing "body parameter" - (is (match? {:schema (merge {:type "object" - :properties {:b {:type "string"}} - :required ["b"]} - (when-not (#{#'spec/coercion} coercion) - {:additionalProperties false}))} + (is (match? (merge {:type "object" + :properties {:b {:type "string"}} + :required ["b"]} + (when-not (#{#'spec/coercion} coercion) + {:additionalProperties false})) (-> spec - (get-in [:paths "/parameters" :post :requestBody :content "application/json"]) + (get-in [:paths "/parameters" :post :requestBody :content "application/json" :schema]) normalize))) - (is (match? {:schema (merge {:type "object" - :properties {:c {:type "string"}} - :required ["c"]} - (when-not (#{#'spec/coercion} coercion) - {:additionalProperties false}))} + (is (match? (merge {:type "object" + :properties {:c {:type "string"}} + :required ["c"]} + (when-not (#{#'spec/coercion} coercion) + {:additionalProperties false})) (-> spec - (get-in [:paths "/parameters" :post :requestBody :content "application/edn"]) + (get-in [:paths "/parameters" :post :requestBody :content "application/edn" :schema]) normalize)))) (testing "body response" - (is (match? {:schema (merge {:type "object" - :properties {:ok {:type "string"}} - :required ["ok"]} - (when-not (#{#'spec/coercion} coercion) - {:additionalProperties false}))} + (is (match? (merge {:type "object" + :properties {:ok {:type "string"}} + :required ["ok"]} + (when-not (#{#'spec/coercion} coercion) + {:additionalProperties false})) (-> spec - (get-in [:paths "/parameters" :post :responses 200 :content "application/json"]) + (get-in [:paths "/parameters" :post :responses 200 :content "application/json" :schema]) normalize))) - (is (match? {:schema (merge {:type "object" - :properties {:edn {:type "string"}} - :required ["edn"]} - (when-not (#{#'spec/coercion} coercion) - {:additionalProperties false}))} + (is (match? (merge {:type "object" + :properties {:edn {:type "string"}} + :required ["edn"]} + (when-not (#{#'spec/coercion} coercion) + {:additionalProperties false})) (-> spec - (get-in [:paths "/parameters" :post :responses 200 :content "application/edn"]) + (get-in [:paths "/parameters" :post :responses 200 :content "application/edn" :schema]) normalize)))) (testing "validation" (let [query {:request-method :post