From c840646c74fa83b68c67dd474609e86d5159cd07 Mon Sep 17 00:00:00 2001 From: Rahul De Date: Fri, 26 Apr 2024 07:53:52 +0100 Subject: [PATCH] [housekeeping] bump deps, format code --- .github/workflows/ci.yaml | 6 +++--- deps.edn | 2 +- project.clj | 2 +- src/navi/core.clj | 4 ++-- test/navi/core_test.clj | 20 ++++++++++---------- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 8f4def5..2366d99 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -20,10 +20,10 @@ jobs: uses: "actions/checkout@v4" - name: "Prepare Java" - uses: "actions/setup-java@v3" + uses: "actions/setup-java@v4" with: distribution: 'temurin' - java-version: '21' + java-version: '22' - name: "Prepare tools-deps" uses: "DeLaGuardo/setup-clojure@master" @@ -31,7 +31,7 @@ jobs: cli: latest - name: "Apply Cache" - uses: "actions/cache@v3" + uses: "actions/cache@v4" with: path: | ~/.m2/repository diff --git a/deps.edn b/deps.edn index 4af5090..74b8615 100644 --- a/deps.edn +++ b/deps.edn @@ -5,6 +5,6 @@ ; https://opensource.org/licenses/MIT. {:deps {io.swagger.parser.v3/swagger-parser {:mvn/version "2.1.22"}} - :aliases {:test {:extra-deps {lambdaisland/kaocha {:mvn/version "1.87.1366"} + :aliases {:test {:extra-deps {lambdaisland/kaocha {:mvn/version "1.88.1376"} org.clojure/test.check {:mvn/version "1.1.1"}} :main-opts ["-m" "kaocha.runner" "--reporter" "kaocha.report.progress/report"]}}} diff --git a/project.clj b/project.clj index 1e6082c..cbc4bd5 100644 --- a/project.clj +++ b/project.clj @@ -10,4 +10,4 @@ :description "A tiny library converting OpenAPI route definitions to Reitit routes." :license {:name "MIT" :url "https://opensource.org/licenses/MIT"} - :dependencies [[io.swagger.parser.v3/swagger-parser "2.1.18"]]) + :dependencies [[io.swagger.parser.v3/swagger-parser "2.1.22"]]) diff --git a/src/navi/core.clj b/src/navi/core.clj index ffdeeb1..58bd127 100644 --- a/src/navi/core.clj +++ b/src/navi/core.clj @@ -36,7 +36,7 @@ (.setTypes schema #{type}) (spec schema)) types) - (into [:or])) + (into [:or])) (finally (.setTypes schema types)))))) @@ -86,7 +86,7 @@ [_] int?) -(defmethod spec +(defmethod spec "number" [_] number?) diff --git a/test/navi/core_test.clj b/test/navi/core_test.clj index 3d134b0..42d5034 100644 --- a/test/navi/core_test.clj +++ b/test/navi/core_test.clj @@ -52,29 +52,29 @@ (core/schema->spec (StringSchema.)))) (is (= string? (core/schema->spec (doto (Schema.) - (.addType "string")))))) + (.addType "string")))))) (testing "integer" (is (= int? (core/schema->spec (IntegerSchema.)))) (is (= int? (core/schema->spec (doto (Schema.) - (.addType "integer")))))) + (.addType "integer")))))) (testing "number" (is (= number? (core/schema->spec (NumberSchema.)))) (is (= number? (core/schema->spec (doto (Schema.) - (.addType "number")))))) + (.addType "number")))))) (testing "null" (is (= nil? (core/schema->spec (doto (Schema.) - (.addType "null")))))) + (.addType "null")))))) (testing "empty object" (is (= [:map {:closed false}] (core/schema->spec (ObjectSchema.)))) (is (= [:map {:closed false}] (core/schema->spec (doto (Schema.) - (.addType "object")))))) + (.addType "object")))))) (testing "object" (let [props (doto (LinkedHashMap.) (.put "x" (IntegerSchema.)) @@ -100,7 +100,7 @@ (core/schema->spec (ArraySchema.)))) (is (= [:sequential any?] (core/schema->spec (doto (Schema.) - (.addType "array")))))) + (.addType "array")))))) (testing "array" (let [arr (doto (ArraySchema.) (.setItems (StringSchema.))) @@ -117,12 +117,12 @@ (core/schema->spec (UUIDSchema.)))) (is (= uuid? (core/schema->spec (doto (Schema.) - (.addType "string") - (.setFormat "uuid")))))) - + (.addType "string") + (.setFormat "uuid")))))) + (testing "jsonschemas with multiple types" (let [strint (-> (JsonSchema.) - (.types #{"string" "integer"}))] + (.types #{"string" "integer"}))] (is (#{[:or string? int?] [:or int? string?]} (core/schema->spec strint))))))