Fork me on GitHub
#ring-swagger
<
2016-09-16
>
jstokes17:09:35

i noticed in swagger when i hit an endpoint that returns application/json i get pretty printed results, but not true for application/edn — is there a way to get pretty printed edn results?

ikitommi17:09:35

@jstokes do you mean via the swagger-ui?

ikitommi17:09:53

I don't think there is, you could check the swagger-ui repo for tips how to do it

ikitommi17:09:28

if there is a custom printer, we could inject that in to ring-swagger-ui

jstokes17:09:37

i was able to find this way - (resp/response (with-out-str (clojure.pprint/pprint edn))) vs just (resp/response edn)

ikitommi17:09:42

but no idea how to do that

ikitommi17:09:44

ah, but that will be really slow (the pprint)

ikitommi17:09:48

I think best would be to do it on the javascript-code on the client. @juhoteperi might have insight how to do that..

jstokes17:09:27

this is really just for an internal app-config type endpoint, so if it’s slowish it should be fine

ikitommi18:09:53

you could then override the ring-middleware-format edn printer to get it done behind the scenes. There should be an example of that in the wiki (I think)

jstokes18:09:26

great, thanks

jstokes18:09:50

thanks for all the great work on kekkonen too, i’ve been looking at that recently

ikitommi18:09:16

cool. We are going to push new stuff to kekkonen, ws-adapter & async support. Compojure-api will also go async, just need to rewrite the content negotiation module first.