Skip to content

Commit

Permalink
[houskeeping] deps
Browse files Browse the repository at this point in the history
  • Loading branch information
lispyclouds committed Oct 13, 2023
1 parent f032fe0 commit da0fb17
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 32 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ jobs:

steps:
- name: "Checkout code"
uses: "actions/checkout@v3"
uses: "actions/checkout@v4"

- name: "Prepare Java"
uses: "actions/setup-java@v3"
with:
distribution: 'temurin'
java-version: '19'
java-version: '21'

- name: "Prepare tools-deps"
uses: "DeLaGuardo/setup-clojure@master"
Expand Down
4 changes: 2 additions & 2 deletions deps.edn
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
; license that can be found in the LICENSE file or at
; https://opensource.org/licenses/MIT.

{:deps {io.swagger.parser.v3/swagger-parser {:mvn/version "2.1.13"}}
:aliases {:test {:extra-deps {lambdaisland/kaocha {:mvn/version "1.81.1290"}
{:deps {io.swagger.parser.v3/swagger-parser {:mvn/version "2.1.16"}}
:aliases {:test {:extra-deps {lambdaisland/kaocha {:mvn/version "1.87.1366"}
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.13"]])
:dependencies [[io.swagger.parser.v3/swagger-parser "2.1.16"]])
50 changes: 23 additions & 27 deletions src/navi/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,20 @@
(ns navi.core
(:import [java.util Map$Entry]
[io.swagger.v3.oas.models.media StringSchema
IntegerSchema
ObjectSchema
ArraySchema
NumberSchema
BooleanSchema
UUIDSchema
MediaType]
IntegerSchema
ObjectSchema
ArraySchema
NumberSchema
BooleanSchema
UUIDSchema
MediaType]
[io.swagger.v3.oas.models.parameters PathParameter
HeaderParameter
QueryParameter
RequestBody
Parameter]
HeaderParameter
QueryParameter
RequestBody
Parameter]
[io.swagger.v3.oas.models Operation
PathItem]
PathItem]
[io.swagger.v3.parser OpenAPIV3Parser]
[io.swagger.v3.parser.core.models ParseOptions]))

Expand All @@ -30,11 +30,9 @@
(defn wrap-map
"Surrounds the key in a map for malli conformance"
[k m]
(if (contains? m k)
(update-in m
[k]
#(into [:map] %))
m))
(cond-> m
(contains? m k)
(update-in [k] #(into [:map] %))))

;; TODO: Better
(defn ->prop-schema
Expand Down Expand Up @@ -144,11 +142,10 @@
.get)
body-spec (-> content
.getSchema
spec)
maybe-body (if (.getRequired param)
body-spec
[:or nil? body-spec])]
{:body maybe-body}))
spec)]
{:body (if (.getRequired param)
body-spec
[:or nil? body-spec])}))

(defn operation->data
"Converts an Operation to map of parameters, schemas and handler conforming to reitit"
Expand All @@ -163,11 +160,10 @@
(apply merge-with into)
(wrap-map :path)
(wrap-map :query)
(wrap-map :header))
handler {:handler (get handlers (.getOperationId op))}]
(if (seq schemas)
(assoc handler :parameters schemas)
handler)))
(wrap-map :header))]
(cond-> {:handler (get handlers (.getOperationId op))}
(seq schemas)
(assoc :parameters schemas))))

(defn path-item->data
"Converts a path to its corresponding vector of method and the operation map"
Expand Down

0 comments on commit da0fb17

Please sign in to comment.