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 * parse-strict * 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!
(coerce-clj->json-byte-stream payload)Converts clojure data to JSON serialized bytes on a ByteArrayInputStream. Cheshire will only output to writers and stockpile will only accept input streams, so some conversion needs to be done in this fn
Converts clojure data to JSON serialized bytes on a ByteArrayInputStream. Cheshire will only output to writers and stockpile will only accept input streams, so some conversion needs to be done in this fn
(generate-pretty-stream obj writer)(generate-pretty-stream obj writer opts)Thinly wraps cheshire.core/generate-stream, adding the PuppetDB default date format
and pretty printing from default-pretty-opts
Thinly wraps cheshire.core/generate-stream, adding the PuppetDB 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 PuppetDB
default date format and pretty printing from default-pretty-opts
Thinly wraps cheshire.core/generate-string, adding the PuppetDB default date format and pretty printing from `default-pretty-opts`
(generate-stream obj writer)(generate-stream obj writer opts)Thinly wraps cheshire.core/generate-stream, adding the PuppetDB default date format.
Thinly wraps cheshire.core/generate-stream, adding the PuppetDB default date format.
(generate-string obj)(generate-string obj opts)Thinly wraps cheshire.core/generate-string, adding the PuppetDB default date format.
Thinly wraps cheshire.core/generate-string, adding the PuppetDB default date format.
(parse x)(parse x key-fn)(parse x key-fn array-coerce-fn)Parses a string, byte-array, input-stream, or reader. key-fn and array-coerce-fn match the corresponding Cheshire parse-stream and parse-string arguments. The top-level object will be parsed lazily if it's an array.
Parses a string, byte-array, input-stream, or reader. key-fn and array-coerce-fn match the corresponding Cheshire parse-stream and parse-string arguments. The top-level object will be parsed lazily if it's an array.
(parse-strict x)(parse-strict x key-fn)(parse-strict x key-fn array-coerce-fn)Eagerly parses a string, byte-array, input-stream, or reader. key-fn and array-coerce-fn match the corresponding Cheshire parse-stream and parse-string arguments, and the top-level object will not be parsed lazily if it's an array.
Eagerly parses a string, byte-array, input-stream, or reader. key-fn and array-coerce-fn match the corresponding Cheshire parse-stream and parse-string arguments, and the top-level object will not be parsed lazily if it's an array.
(-parse obj key-fn array-coerce-fn)Parses obj. key-fn and array-coerce-fn match the corresponding Cheshire parse-stream arguments.
Parses obj. key-fn and array-coerce-fn match the corresponding Cheshire parse-stream arguments.
(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`
(-parse-strict obj key-fn array-coerce-fn)Eagerly parses obj. key-fn and array-coerce-fn match the corresponding Cheshire parse-stream arguments.
Eagerly parses obj. key-fn and array-coerce-fn match the corresponding Cheshire parse-stream arguments.
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 |