On Tue, 20 Aug 2013 06:59:37 GMT, Sönke Ludwig wrote:

(Asumming you mean the OutputStream suggestion:) Think of it as a single ubyte[] return value. What's stored inside that array is up to the API implementor and using an OutputStream doesn't make a difference there. The wire protocol will still be well-defined, but just use binary data instead of JSON in that case. I think it's actually a quite common requirement to be able to transfer raw file contents (not necessarily from an actual file, tough). So at least we should find some solution here.

I think it is worth requiring explicit UDA annotation, something like @rawResponse - it will both make interface more clear to the reader and help client generator to verify that it is not misused (so far REST module does not rely on any extra user code to work properly and I think it is worth keeping). Once you start going the declarative way, no reasons to stop in the middle.