diff --git a/lib/apiswagger.js b/lib/apiswagger.js index a24c31a..261cbc9 100644 --- a/lib/apiswagger.js +++ b/lib/apiswagger.js @@ -474,7 +474,7 @@ module.exports = (app, client) => { streamArray(), data => ({ instance: data.value._source.instance, comment: data.value._source.blocks.find(block => block.domain === clean(req.params.instance)).comment }) ]) - result.on('readable', () => res.write('[')) + pipeline.on('readable', () => res.write('[')) pipeline.on('data', data => res.write(data.toString() + ',')) pipeline.on('end', () => res.end(']')) result.pipe(pipeline)