compojure-api icon indicating copy to clipboard operation
compojure-api copied to clipboard

Pretty printing response?

Open danielcompton opened this issue 7 years ago • 2 comments

When developing, it would be nice to be able to see pretty printed EDN/JSON in responses. This would be especially useful when driving from the Swagger UI, as EDN is all printed on a single (very long) line.

Yada does this by detecting ;pretty=true as a parameter in the content type requested: https://github.com/juxt/yada/blob/49da1febd6d0d11aa56d2a8d7c32df559232117c/bundles/default/test/yada/swagger_test.clj#L51

Is this possible/desired in this library?

danielcompton avatar May 22 '18 00:05 danielcompton

Hi. I think it's a good idea. The right target would be Muuntaja, which would benefit other web libs too (used at least by duct & reitit).

ikitommi avatar May 22 '18 18:05 ikitommi

For JSON, there are things like JSONView and httpie, but guess nothing for EDN.

ikitommi avatar May 22 '18 18:05 ikitommi