Skip to content

Commit

Permalink
[housekeeping] bump deps, format code
Browse files Browse the repository at this point in the history
  • Loading branch information
lispyclouds committed Apr 26, 2024
1 parent e96e13c commit c840646
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 17 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,18 @@ 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"
with:
cli: latest

- name: "Apply Cache"
uses: "actions/cache@v3"
uses: "actions/cache@v4"
with:
path: |
~/.m2/repository
Expand Down
2 changes: 1 addition & 1 deletion deps.edn
Original file line number Diff line number Diff line change
Expand Up @@ -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"]}}}
2 changes: 1 addition & 1 deletion project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -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"]])
4 changes: 2 additions & 2 deletions src/navi/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
(.setTypes schema #{type})
(spec schema))
types)
(into [:or]))
(into [:or]))
(finally
(.setTypes schema types))))))

Expand Down Expand Up @@ -86,7 +86,7 @@
[_]
int?)

(defmethod spec
(defmethod spec
"number"
[_]
number?)
Expand Down
20 changes: 10 additions & 10 deletions test/navi/core_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -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.))
Expand All @@ -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.)))
Expand All @@ -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))))))

Expand Down

0 comments on commit c840646

Please sign in to comment.