liberator

Joe Lane 2015-12-20T14:22:35.000020Z

can you define "not to try to convert data to json by itself?"

Joe Lane 2015-12-20T14:22:57.000021Z

do you mean when it comes out of liberator via the resource or as input?

Joe Lane 2015-12-20T14:30:35.000022Z

@jeremys: ^^

2015-12-20T16:28:38.000023Z

@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.

2015-12-20T16:31:19.000024Z

It doesn't play nice if you want to use https://github.com/ring-clojure/ring-json wrap-json-response.

Joe Lane 2015-12-20T17:24:40.000026Z

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.

Joe Lane 2015-12-20T17:25:57.000027Z

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.

Joe Lane 2015-12-20T17:26:02.000029Z

@jeremys: docs ^^

2015-12-20T18:14:28.000031Z

@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.