Merge pull request #2842 from strongloop/fix/metadata-update-delete-all

Fix description of updateAll response
This commit is contained in:
Miroslav Bajtoš 2016-10-12 13:03:32 +02:00 committed by GitHub
commit 46ab65cf50
2 changed files with 14 additions and 3 deletions

View File

@ -808,9 +808,14 @@ 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: {
count: {
type: 'number',
description: 'The number of instances updated',
},
},
root: true, root: true,
}, },
http: { verb: 'post', path: '/update' }, http: { verb: 'post', path: '/update' },

View File

@ -262,6 +262,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 : '';
} }