Fix description of updateAll response

Correctly describe the first non-error callback arg as an `info` object
containing a `count` property.
This commit is contained in:
Miroslav Bajtoš 2016-10-11 16:31:57 +02:00
parent 765e53098b
commit bf5c206bd6
2 changed files with 15 additions and 4 deletions

View File

@ -795,10 +795,15 @@ module.exports = function(registry) {
description: 'An object of model property name/value pairs'},
],
returns: {
arg: 'count',
description: 'The number of instances updated',
type: 'object',
root: true
arg: 'info',
description: 'Information related to the outcome of the operation',
type: {
count: {
type: 'number',
description: 'The number of instances updated',
},
},
root: true,
},
http: {verb: 'post', path: '/update'}
});

View File

@ -269,6 +269,12 @@ function formatReturns(m) {
return '';
}
var type = returns[0].type;
// handle anonymous type definitions, e.g
// { arg: 'info', type: { count: 'number' } }
if (typeof type === 'object' && !Array.isArray(type))
type = 'object';
return type ? ':' + type : '';
}