Skip to content

Commit

Permalink
Fixup babashka.json usage
Browse files Browse the repository at this point in the history
Use correct version (previous release did not provide json/read).
  • Loading branch information
joodie committed Jan 31, 2024
1 parent 7b2867d commit a979c2a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ uberjar=$(exec_base_name)-$(version)-standalone.jar
uberjar: $(uberjar)

$(uberjar): deps.edn bb.edn $(source_files)
rm -f $@
$(BB) uberjar $@ -m nl.jomco.apie.main

release: $(binary_release)
Expand Down
5 changes: 4 additions & 1 deletion deps.edn
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
:deps {org.clojure/tools.cli {:mvn/version "1.0.219"}
ring/ring-codec {:mvn/version "1.2.0"}
org.babashka/http-client {:mvn/version "0.4.15"}
org.babashka/json {:mvn/version "0.1.1"}
org.babashka/json #_{:mvn/version "0.1.5"}
{:git/url "https://github.com/babashka/json.git"
:git/sha "64d3b136b082b987ca20ce7095f7d8914372cada"
}
hiccup/hiccup {:mvn/version "2.0.0-RC2"}
nl.jomco/clj-http-status-codes {:mvn/version "0.1"}
nl.jomco/openapi-v3-validator {:mvn/version "0.2.1"}
Expand Down
3 changes: 2 additions & 1 deletion src/nl/jomco/apie/main.clj
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@

(defn- read-json
[f]
(json/read (io/reader f :encoding "UTF-8") false))
(with-open [r (io/reader f :encoding "UTF-8")]
(json/read r {:key-fn str})))

(defn print-interaction
[{{:keys [uri query-params method]} :request
Expand Down
4 changes: 2 additions & 2 deletions src/nl/jomco/apie/spider.clj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[nl.jomco.openapi.v3.validator :as validator]
[nl.jomco.spider :as spider]
[clojure.string :as string]
[clojure.data.json :as json]
[babashka.json :as json]
[babashka.http-client :as http-client]))

(defn fixup-request
Expand Down Expand Up @@ -120,7 +120,7 @@
request)]
(let [response (f request)]
(if (json-type? response)
(update response :body json/read-str)
(update response :body #(json/read-str % {:key-fn identity}))
response)))))

(defn wrap-max-requests-per-operation
Expand Down

0 comments on commit a979c2a

Please sign in to comment.