From f99a76886e11ab791bf4753ec31b89baf624b97b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Varela?= Date: Fri, 9 Feb 2024 11:21:31 +0200 Subject: [PATCH 1/3] Fix: fix swagger ring tests, malli keys are now strings, not keywords --- test/cljc/reitit/swagger_test.clj | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/cljc/reitit/swagger_test.clj b/test/cljc/reitit/swagger_test.clj index 409027045..0ad096c77 100644 --- a/test/cljc/reitit/swagger_test.clj +++ b/test/cljc/reitit/swagger_test.clj @@ -161,14 +161,14 @@ expected {:x-id #{::math} :swagger "2.0" :info {:title "my-api"} - :definitions {::req-key {:type "string" + :definitions {"reitit.swagger-test/req-key" {:type "string" :x-anyOf [{:type "string"} {:type "string"}]} - ::req-val {:type "object" + "reitit.swagger-test/req-val" {:type "object" :x-anyOf [{:type "object"} {:type "string"}]} - ::resp-map {:type "object"}, - ::resp-string {:type "string" + "reitit.swagger-test/resp-map" {:type "object"}, + "reitit.swagger-test/resp-string" {:type "string" :minLength 1}} :paths {"/api/spec/plus/{z}" {:patch {:parameters [] :summary "patch" From 982ac3ec72ad52e4da7aa7b2dca10428a813d221 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Varela?= Date: Fri, 9 Feb 2024 11:37:34 +0200 Subject: [PATCH 2/3] Fix: account for changed malli encoder behavior that was breaking ring-coercion-test --- test/cljc/reitit/ring_coercion_test.cljc | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/test/cljc/reitit/ring_coercion_test.cljc b/test/cljc/reitit/ring_coercion_test.cljc index ec2bd1fe4..0a1c6503c 100644 --- a/test/cljc/reitit/ring_coercion_test.cljc +++ b/test/cljc/reitit/ring_coercion_test.cljc @@ -652,12 +652,14 @@ :uri "/foo" :muuntaja/request {:format request-format} :muuntaja/response {:format response-format} - :body-params body})] + :body-params body}) + normalize-json (fn[body] + (-> body j/write-value-as-string (j/read-value j/keyword-keys-object-mapper)))] (testing "succesful call" - (is (= {:status 200 :body {:request :json, :response :json}} - (call (request "application/json" "application/json" {:request :json :response :json})))) - (is (= {:status 200 :body {:request :edn, :response :json}} - (call (request "application/edn" "application/json" {:request :edn :response :json})))) + (is (= {:status 200 :body {:request "json", :response "json"}} + (normalize-json (call (request "application/json" "application/json" {:request :json :response :json}))))) + (is (= {:status 200 :body {:request "edn", :response "json"}} + (normalize-json (call (request "application/edn" "application/json" {:request :edn :response :json}))))) (is (= {:status 200 :body {:request :default, :response :default}} (call (request "application/transit" "application/transit" {:request :default :response :default}))))) (testing "request validation fails" From 82c714d0cc531871e9da96b285ef92fbd65fe64e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Varela?= Date: Fri, 9 Feb 2024 11:42:19 +0200 Subject: [PATCH 3/3] fix: pin version for openapi-schema-validator on CI --- .github/workflows/testsuite.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/testsuite.yml b/.github/workflows/testsuite.yml index 47f70b8d5..19bcc28f6 100644 --- a/.github/workflows/testsuite.yml +++ b/.github/workflows/testsuite.yml @@ -32,6 +32,9 @@ jobs: uses: DeLaGuardo/setup-clojure@3.1 with: lein: 2.9.5 + - name: Install dependencies + run: | + npm ci - name: Run tests run: ./scripts/test.sh clj