Merge pull request #2846 from strongloop/fix/metadata-update-delete-all-2x

Fix description of updateAll response
This commit is contained in:
Miroslav Bajtoš 2016-10-17 14:10:46 +02:00 committed by GitHub
commit f9cd880eaa
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'}, description: 'An object of model property name/value pairs'},
], ],
returns: { returns: {
arg: 'count', arg: 'info',
description: 'The number of instances updated', description: 'Information related to the outcome of the operation',
type: 'object', type: {
root: true count: {
type: 'number',
description: 'The number of instances updated',
},
},
root: true,
}, },
http: {verb: 'post', path: '/update'} http: {verb: 'post', path: '/update'}
}); });

View File

@ -269,6 +269,12 @@ function formatReturns(m) {
return ''; return '';
} }
var type = returns[0].type; 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 : ''; return type ? ':' + type : '';
} }