can you define "not to try to convert data to json by itself?"
do you mean when it comes out of liberator via the resource or as input?
@jeremys: ^^
@lanejo01: Hi thanks for your interest! what I mean is that when a ressouce declares "application/json" as the :available-media-type
and the :handle-ok
function returns clojure data, liberator will try to generate a json string from that data.
It doesn't play nice if you want to use https://github.com/ring-clojure/ring-json wrap-json-response
.
what would you prefer it return? I ran into this last week with csv data and the docs do not make it very clear how to return csv data.
these are the docs for custom json response. in this example {:some "json"}
is the response data and beneath that are the headers. ring-response ( if I remember correctly) is from liberator.
https://clojure-liberator.github.io/liberator/doc/representations.html
@jeremys: docs ^^
@lanejo01: I completely overlooked this page of the doc thanks!!!
I had read https://clojure-liberator.github.io/liberator/tutorial/conneg.html and thought, since content negociation whas to be handled in the :handle-ok
fn, liberator didn't care about what the :handle-ok
fn returned and just stuck it in the body of a response map. I'll admit I hadn't thought deeply (if at all) at what needs to happen to the body of the response or where does it need to happen.