Skip to content

Commit

Permalink
[Fix #306] Replace cheshire with data.json
Browse files Browse the repository at this point in the history
  • Loading branch information
expez committed Jul 1, 2021
1 parent dd5677f commit 5c60db6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
8 changes: 3 additions & 5 deletions project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[nrepl "0.8.3"]
^:inline-dep [http-kit "2.5.1"]
^:inline-dep [cheshire "5.10.0"]
^:inline-dep [org.clojure/data.json "2.3.1"]
^:inline-dep [org.clojure/tools.analyzer.jvm "1.1.0"]
^:inline-dep [org.clojure/tools.namespace "1.1.0" :exclusions [org.clojure/tools.reader]]
^:inline-dep [org.clojure/tools.reader "1.3.5"]
Expand All @@ -29,11 +29,9 @@
:provided {:dependencies [[cider/cider-nrepl "0.25.9"]
[org.clojure/clojure "1.9.0"]]}
:1.8 {:dependencies [[org.clojure/clojure "1.8.0"]
[org.clojure/clojurescript "1.8.51"]
[javax.xml.bind/jaxb-api "2.3.1"]]}
[org.clojure/clojurescript "1.8.51"]]}
:1.9 {:dependencies [[org.clojure/clojure "1.9.0"]
[org.clojure/clojurescript "1.9.946"]
[javax.xml.bind/jaxb-api "2.3.1"]]}
[org.clojure/clojurescript "1.9.946"]]}
:1.10 {:dependencies [[org.clojure/clojure "1.10.2"]
[org.clojure/clojurescript "1.10.520"]]}

Expand Down
8 changes: 4 additions & 4 deletions src/refactor_nrepl/artifacts.clj
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(ns refactor-nrepl.artifacts
(:require [cheshire.core :as json]
(:require [clojure.data.json :as json]
[clojure
[edn :as edn]
[string :as str]]
Expand Down Expand Up @@ -69,7 +69,7 @@
search-suffix "%22+AND+p:%22jar%22&rows=2000&wt=json"
search-url (str search-prefix group-id search-suffix)
{:keys [_ _ body _]} @(http/get search-url (assoc (get-proxy-opts) :as :text))
search-result (json/parse-string body true)]
search-result (json/read-str body :key-fn keyword)]
(map :a (-> search-result :response :docs))))

(defn- get-mvn-versions!
Expand All @@ -83,7 +83,7 @@
artifact
"%22&core=gav&rows=100&wt=json")
(assoc (get-proxy-opts) :as :text))]
(->> (json/parse-string body true)
(->> (json/read-str body :key-fn keyword)
:response
:docs
(map :v))))
Expand All @@ -102,7 +102,7 @@
(let [{:keys [body status]} @(http/get (str "https://clojars.org/api/artifacts/"
artifact))]
(when (= 200 status)
(map :version (:recent_versions (json/parse-string body true))))))
(map :version (:recent_versions (json/read-str body :key-fn keyword))))))

(defn- get-artifacts-from-clojars!
[]
Expand Down

0 comments on commit 5c60db6

Please sign in to comment.