Is there a formal definition of what :body
should be? Should it be a Reader or a String?
Depends if request/response. There is a spec file in the ring repo that formalizes this
Hmm InputStream .. I have a middleware that turns the body into a map - maybe that is not correct from a spec perspective
i guess body is tricky anyway because once you consume the InputStream, you can’t re-read it again
you can return a stream on the byte-buffer
Example can be found at https://gist.github.com/ska2342/4567b02531ff611db6a1208ebd4316e6#file-gh-validation-clj-L129
Depends if you control whatever consumes it. For instance turning an inputstream representing json data to a map is ok depending on the context
specially if it is the last in a chain of middleware