ngrunwald/ring-middleware-format — pull request #28 by curious-attempt-bunny (2014-09-18 16:59:14+00:00)
Title: Do not serialize nil response bodies

Hey @ngrunwald. Thanks for creating this middleware and for maintaining it. It's very convenient being able to keep handlers concise by eliminating the encoding boilerplate.

One issue that came up for me using `wrap-restful-format` is that it changes the ring behaviour for responses with a nil `:body` or missing `:body`. I can appreciate that it's possible that folks might want a response of `{:status 500}` to be coerced to a JSON response with a body of `null`. For me, the least surprising response is an empty response body.

What do you think?

The fundamental change in this Pull Request is to [treat `nil` as non-serializable](https://github.com/curious-attempt-bunny/ring-middleware-format/commit/9833c4a492f54f7464fe584e3565422c9cd2b193).