The JSON adapter (RFC 8259): strings in, plain data with string keys out, and back, on both platforms.
The JSON adapter (RFC 8259): strings in, plain data with string keys out, and back, on both platforms.
(read-str s)The JSON string s as Clojure data with string keys.
A byte order mark before the value is skipped. Anything but white space after the value is an error, on the JVM as in JavaScript. A value nested deeper than the stack reaches is also an error. On the JVM, so is a number with a run of more than a thousand digits. A hostile server can send such values to exhaust a reader.
The JSON string `s` as Clojure data with string keys. A byte order mark before the value is skipped. Anything but white space after the value is an error, on the JVM as in JavaScript. A value nested deeper than the stack reaches is also an error. On the JVM, so is a number with a run of more than a thousand digits. A hostile server can send such values to exhaust a reader.
(write-str x)(write-str x {:keys [pretty?] :as opts})The JSON of x, indented when opts has :pretty?. Characters outside
ASCII are written as they are, on the JVM as in JavaScript.
The JSON of `x`, indented when `opts` has :pretty?. Characters outside ASCII are written as they are, on the JVM as in JavaScript.
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 |