Just enough JSON to talk to the Cloudflare REST API v4: read the small
{success, errors, messages, result} envelopes it returns and write the
compact request bodies (and x-amz-free metadata blobs) we send.
This is deliberately not a general JSON library — but it is a correct one
for the subset it covers: objects, arrays, strings (with \uXXXX and the
usual escapes), numbers (long or double), true/false/null. Keeping it
in-house preserves the library's zero-dependency promise, the same way
internal.xml does for S3.
read returns objects as maps with string keys (Cloudflare's are camelCase,
so callers destructure with :strs); write accepts maps with string or
keyword keys.
Just enough JSON to talk to the Cloudflare REST API v4: read the small
`{success, errors, messages, result}` envelopes it returns and write the
compact request bodies (and `x-amz`-free metadata blobs) we send.
This is deliberately *not* a general JSON library — but it is a correct one
for the subset it covers: objects, arrays, strings (with `\uXXXX` and the
usual escapes), numbers (long or double), `true`/`false`/`null`. Keeping it
in-house preserves the library's zero-dependency promise, the same way
`internal.xml` does for S3.
`read` returns objects as maps with *string* keys (Cloudflare's are camelCase,
so callers destructure with `:strs`); `write` accepts maps with string or
keyword keys.(read s)Parse JSON text s into Clojure data (objects as string-keyed maps). Returns
nil for nil/blank input. Throws ex-info on malformed JSON.
Parse JSON text `s` into Clojure data (objects as string-keyed maps). Returns nil for nil/blank input. Throws `ex-info` on malformed JSON.
(write v)Render Clojure data v as a compact JSON string. Maps become objects (string
or keyword keys), sequential collections become arrays; keywords/symbols
stringify to their name. Anything unrecognized is written as its str.
Render Clojure data `v` as a compact JSON string. Maps become objects (string or keyword keys), sequential collections become arrays; keywords/symbols stringify to their name. Anything unrecognized is written as its `str`.
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 |