Liking cljdoc? Tell your friends :D

s-exp.oda

Fast JSON parser/writer working directly on UTF-8 bytes.

Fast JSON parser/writer working directly on UTF-8 bytes.
raw docstring

parseclj

(parse input)
(parse input {:keys [key-fn max-depth] :or {max-depth 1000}})

Parses JSON from input (byte-array, String or InputStream) into Clojure data structures.

Options:

  • :key-fn - fn of String -> map key, applied to object keys. Unset or nil leaves keys as strings. clojure.core/keyword is recognized and uses an optimized interning path. Must be pure: results are cached by fn identity, so a def'd fn gets cross-parse caching while a fresh lambda is only cached within a single parse
  • :max-depth - maximum nesting depth (default 1000)

Throws com.s_exp.oda.JsonParseException on invalid input.

Parses JSON from `input` (byte-array, String or InputStream) into Clojure
data structures.

Options:
* `:key-fn`    - fn of String -> map key, applied to object keys. Unset or
  nil leaves keys as strings. `clojure.core/keyword` is recognized and uses
  an optimized interning path. Must be pure: results are cached by fn
  identity, so a def'd fn gets cross-parse caching while a fresh lambda is
  only cached within a single parse
* `:max-depth` - maximum nesting depth (default 1000)

Throws `com.s_exp.oda.JsonParseException` on invalid input.
sourceraw docstring

writeclj

(write x out)
(write x out {:keys [default-fn]})

Writes x as JSON to out (OutputStream), flushes, does not close. See write-str for options.

Writes `x` as JSON to `out` (OutputStream), flushes, does not close.
See `write-str` for options.
sourceraw docstring

write-bytesclj

(write-bytes x)
(write-bytes x {:keys [default-fn]})

Writes x as JSON UTF-8 encoded byte-array. See write-str for options.

Writes `x` as JSON UTF-8 encoded byte-array. See `write-str` for options.
sourceraw docstring

write-strclj

(write-str x)
(write-str x {:keys [default-fn]})

Writes x as a JSON String.

Options:

  • :default-fn - called on values of unsupported types, must return a writable value. Without it, unsupported types throw.
Writes `x` as a JSON String.

Options:
* `:default-fn` - called on values of unsupported types, must return a
  writable value. Without it, unsupported types throw.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close