Skip to content

Commit

Permalink
Replace data.json with babashka.json
Browse files Browse the repository at this point in the history
Latest data.json is broken on babashka.
  • Loading branch information
joodie committed Jan 24, 2024
1 parent 593ac1b commit 808ca53
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion deps.edn
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
: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.clojure/data.json {:mvn/version "2.5.0"}
org.babashka/json {:mvn/version "0.1.1"}
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
4 changes: 2 additions & 2 deletions src/nl/jomco/apie/main.clj
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(ns nl.jomco.apie.main
(:require [clojure.data.json :as data.json]
(:require [babashka.json :as json]
[clojure.edn :as edn]
[clojure.java.io :as io]
[clojure.pprint :as pprint]
Expand Down Expand Up @@ -88,7 +88,7 @@

(defn- read-json
[f]
(data.json/read-json (io/reader f :encoding "UTF-8") false))
(json/read (io/reader f :encoding "UTF-8") false))

(defn print-interaction
[{{:keys [uri query-params method]} :request
Expand Down
4 changes: 2 additions & 2 deletions src/nl/jomco/apie/report/json.clj
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(ns nl.jomco.apie.report.json
(:require [clojure.data.json :as json]
(:require [babashka.json :as json]
[clojure.string :as string]))

(defn to-s
Expand Down Expand Up @@ -46,7 +46,7 @@

;; for anything else fall back to clojure.data.json
:else
(let [v (json/write-str val :escape-slash false, :escape-unicode false)]
(let [v (json/write-str val)]
(if (and max-length (> (count v) max-length))
(str (subs v 0 max-length) ellipsis)
v)))))))

0 comments on commit 808ca53

Please sign in to comment.