Add the abilty to enable verbose output using query param (api).

This commit is contained in:
Andrey Antukh 2021-12-02 17:46:06 +01:00
parent 86bbfde19e
commit 76dafea8a6
2 changed files with 6 additions and 5 deletions

View file

@ -75,9 +75,10 @@
:compile (constantly wrap-parse-request-body)})
(defn- impl-format-response-body
[response _request]
(let [body (:body response)
opts {:type :json}]
[response request]
(let [body (:body response)
params (:query-params request)
opts {:type (if (contains? params "transit_verbose") :json-verbose :json)}]
(cond
(coll? body)
(-> response