Cheshire related functions
This front-ends the common set of core cheshire functions:
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.
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:
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
(add-common-json-encoders!*)
Non-memoize version of add-common-json-encoders!
Non-memoize version of add-common-json-encoders!
(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`
(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`
(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`
(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.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close