Read JSON into plain Clojure data, built on the Java library io.github.ralfspoeth/greyson.
Reading is a two-step process:
read-json / read-json-str parse text into Greyson's
immutable JsonValue tree.->clj converts that tree into maps, vectors, strings,
BigDecimals, booleans and nil.Writing mirrors this: ->greyson turns Clojure data into a
Greyson JsonValue, and write-json / write-json-str turn
Clojure data or a JsonValue into JSON text.
Example:
(->clj (read-json-str "{"a": [1, true, null]}")) ;; => {"a" [1M true nil]}
Read JSON into plain Clojure data, built on the Java library
io.github.ralfspoeth/greyson.
Reading is a two-step process:
1. `read-json` / `read-json-str` parse text into Greyson's
immutable `JsonValue` tree.
2. `->clj` converts that tree into maps, vectors, strings,
BigDecimals, booleans and nil.
Writing mirrors this: `->greyson` turns Clojure data into a
Greyson `JsonValue`, and `write-json` / `write-json-str` turn
Clojure data or a `JsonValue` into JSON text.
Example:
(->clj (read-json-str "{\"a\": [1, true, null]}"))
;; => {"a" [1M true nil]}Implementation details of io.github.ralfspoeth.cljson. Not part of the public API; may change without notice.
Implementation details of io.github.ralfspoeth.cljson. Not part of the public API; may change without notice.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |