diff --git a/lib/persisted-model.js b/lib/persisted-model.js index d3a5c597..195b0f2e 100644 --- a/lib/persisted-model.js +++ b/lib/persisted-model.js @@ -808,9 +808,14 @@ module.exports = function(registry) { description: 'An object of model property name/value pairs' }, ], returns: { - arg: 'count', - description: 'The number of instances updated', - type: 'object', + 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' }, diff --git a/test/remoting.integration.js b/test/remoting.integration.js index f21c4203..75a5f5f4 100644 --- a/test/remoting.integration.js +++ b/test/remoting.integration.js @@ -262,6 +262,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 : ''; }