Liking cljdoc? Tell your friends :D

puppetlabs.kitchensink.json

Cheshire related functions

This front-ends the common set of core cheshire functions:

  • generate-string
  • generate-stream
  • parse-string
  • parse-stream

This namespace when 'required' will also setup some common JSON encoders globally, so you can avoid doing this for each call.

Cheshire related functions

This front-ends the common set of core cheshire functions:

* generate-string
* generate-stream
* parse-string
* parse-stream

This namespace when 'required' will also setup some common JSON encoders
globally, so you can avoid doing this for each call.
raw docstring

*datetime-encoder*clj

source

add-common-json-encoders!clj

Registers some common encoders for cheshire JSON encoding.

This is a memoize function, to avoid unnecessary calls to add-encoder.

Ideally this function should be called once in your apply, for example your main class.

Encoders currently include:

  • org.joda.time.DateTime - handled with to-string
Registers some common encoders for cheshire JSON encoding.

This is a memoize function, to avoid unnecessary calls to add-encoder.

Ideally this function should be called once in your apply, for example your
main class.

Encoders currently include:

* org.joda.time.DateTime - handled with to-string
sourceraw docstring

add-common-json-encoders!*clj

(add-common-json-encoders!*)

Non-memoize version of add-common-json-encoders!

Non-memoize version of add-common-json-encoders!
sourceraw docstring

default-pretty-optsclj

source

generate-pretty-streamclj

(generate-pretty-stream obj writer)
(generate-pretty-stream obj writer opts)

Thinly wraps cheshire.core/generate-stream, adding the clj-time default date format and pretty printing from default-pretty-opts

Thinly wraps cheshire.core/generate-stream, adding the clj-time default date
format and pretty printing from `default-pretty-opts`
sourceraw docstring

generate-pretty-stringclj

(generate-pretty-string obj)
(generate-pretty-string obj opts)

Thinly wraps cheshire.core/generate-string, adding the clj-time default date format and pretty printing from default-pretty-opts

Thinly wraps cheshire.core/generate-string, adding the clj-time default date
format and pretty printing from `default-pretty-opts`
sourceraw docstring

generate-streamclj

source

generate-stringclj

source

parse-streamclj

source

parse-stringclj

source

spit-jsonclj

(spit-json f obj & options)

Similar to clojure.core/spit, but writes the Clojure datastructure as JSON to f

Similar to clojure.core/spit, but writes the Clojure
datastructure as JSON to `f`
sourceraw docstring

with-datetime-encodercljmacro

(with-datetime-encoder encoder & body)

Evaluates the body using the given encoder to serialize DateTime objects to JSON. Requires that add-common-json-encoders! from this namespace has already been called, and that nobody else has re-extended org.joda.date.DateTime to cheshire's JSONable protocol in the meantime.

Evaluates the body using the given encoder to serialize DateTime objects to
JSON. Requires that `add-common-json-encoders!` from this namespace has
already been called, and that nobody else has re-extended
org.joda.date.DateTime to cheshire's JSONable protocol in the meantime.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close