diff --git a/src/babashka/json.clj b/src/babashka/json.clj index 381d172..7bf39aa 100644 --- a/src/babashka/json.clj +++ b/src/babashka/json.clj @@ -36,21 +36,31 @@ (def ^:private read-fn read-fn)) (defn read + "Returns a Clojure value from the JSON reader. + + Options: + :key-fn - Convert JSON keys using this function. Defaults to keyword." ([reader] (read reader nil)) ([reader opts] (read-fn reader opts))) (defn read-str + "Returns a Clojure value from the JSON string. + + Options: + :key-fn - Convert JSON keys using this function. Defaults to keyword." ([s] (read-str s nil)) ([s opts] (read-str-fn s opts))) (defn write-str - ([s] (write-str s nil)) - ([s opts] - (write-str-fn s opts))) + "Returns a JSON string from the Clojure value." + ([x] (write-str x nil)) + ([x opts] + (write-str-fn x opts))) (defn ->json-reader + "Returns a JSON reader." ([x] (->json-reader x nil)) ([x opts] (internal->json-reader x opts)))