-
Notifications
You must be signed in to change notification settings - Fork 62
Closed
Description
In strongloop/strong-remoting#284, we added support for new return type "file":
MyModel.download = function(cb) {
// this can be for example http.request()
getTheStreamBody(function(err, stream) {
if (err) return cb(err);
// stream can be any of: string, buffer, ReadableStream (e.g. http.IncomingMessage)
cb(null, stream, 'application/octet-stream');
});
}
MyModel.remoteMethod('download', {
isStatic: true,
returns: [
{ arg: 'body', type: 'file', root: true },
{ arg: 'Content-Type', type: 'string', http: { target: 'header' } },
],
});Now we need to extend swagger-spec generator to support his new file and map it to swagger type "file".
Nice to have: support return arguments mapped as http.target:header too.
Reactions are currently unavailable