(api->clj body)Recursively converts an API response map with snake_case string keys into a Clojure map with kebab-case keyword keys.
Example: (api->clj {"message_id" "abc" "created_at" "2024-01-01"}) ;; => {:message-id "abc" :created-at "2024-01-01"}
Recursively converts an API response map with snake_case string keys into
a Clojure map with kebab-case keyword keys.
Example:
(api->clj {"message_id" "abc" "created_at" "2024-01-01"})
;; => {:message-id "abc" :created-at "2024-01-01"}(build-query-string params)Builds a URL query string from a map of params. Keys are converted from kebab-case keywords to snake_case strings. Sequential values are serialised as repeated params (key=a&key=b). Returns an empty string when params is nil or empty.
Example: (build-query-string {:limit 10 :domain-id ["abc" "def"]}) ;; => "?limit=10&domain_id=abc&domain_id=def"
Builds a URL query string from a map of params.
Keys are converted from kebab-case keywords to snake_case strings.
Sequential values are serialised as repeated params (key=a&key=b).
Returns an empty string when params is nil or empty.
Example:
(build-query-string {:limit 10 :domain-id ["abc" "def"]})
;; => "?limit=10&domain_id=abc&domain_id=def"(clj->api body)Recursively converts a Clojure map with kebab-case keyword keys into a map with snake_case string keys ready for JSON serialisation.
Example: (clj->api {:from "a@b.com" :reply-to ["c@d.com"]}) ;; => {"from" "a@b.com" "reply_to" ["c@d.com"]}
Recursively converts a Clojure map with kebab-case keyword keys into a
map with snake_case string keys ready for JSON serialisation.
Example:
(clj->api {:from "a@b.com" :reply-to ["c@d.com"]})
;; => {"from" "a@b.com" "reply_to" ["c@d.com"]}(remove-nils m)Removes nil-valued entries from a map (non-recursive). Useful before serialising a payload so optional fields are omitted.
Removes nil-valued entries from a map (non-recursive). Useful before serialising a payload so optional fields are omitted.
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 |