Add descriptions for remote method paramters

This commit is contained in:
Raymond Feng 2013-08-23 17:04:08 -07:00
parent 43a5398792
commit 7234c9822c
1 changed files with 9 additions and 9 deletions

View File

@ -195,7 +195,7 @@ function setRemoting(fn, options) {
setRemoting(DataAccessObject.create, {
description: 'Create a new instance of the model and persist it into the data source',
accepts: {arg: 'data', type: 'object', http: {source: 'body'}},
accepts: {arg: 'data', type: 'object', description: 'Model instance data', http: {source: 'body'}},
returns: {arg: 'data', type: 'object', root: true},
http: {verb: 'post', path: '/'}
});
@ -252,7 +252,7 @@ DataAccessObject.upsert = DataAccessObject.updateOrCreate = function upsert(data
// upsert ~ remoting attributes
setRemoting(DataAccessObject.upsert, {
description: 'Update an existing model instance or insert a new one into the data source',
accepts: {arg: 'data', type: 'object', http: {source: 'body'}},
accepts: {arg: 'data', type: 'object', description: 'Model instance data', http: {source: 'body'}},
returns: {arg: 'data', type: 'object', root: true},
http: {verb: 'put', path: '/'}
});
@ -305,7 +305,7 @@ DataAccessObject.exists = function exists(id, cb) {
// exists ~ remoting attributes
setRemoting(DataAccessObject.exists, {
description: 'Check whether a model instance exists in the data source',
accepts: {arg: 'id', type: 'any'},
accepts: {arg: 'id', type: 'any', description: 'Model id'},
returns: {arg: 'exists', type: 'any'},
http: {verb: 'get', path: '/exists'}
});
@ -335,7 +335,7 @@ DataAccessObject.findById = function find(id, cb) {
// find ~ remoting attributes
setRemoting(DataAccessObject.findById, {
description: 'Find a model instance by id from the data source',
accepts: {arg: 'id', type: 'any'},
accepts: {arg: 'id', type: 'any', description: 'Model id'},
returns: {arg: 'data', type: 'any', root: true},
http: {verb: 'get', path: '/:id'}
});
@ -450,7 +450,7 @@ DataAccessObject.find = function find(params, cb) {
// all ~ remoting attributes
setRemoting(DataAccessObject.find, {
description: 'Find all instances of the model matched by filter from the data source',
accepts: {arg: 'filter', type: 'object'},
accepts: {arg: 'filter', type: 'object', description: 'Filter defining fields, where, orderBy, offset, and limit'},
returns: {arg: 'data', type: 'array', root: true},
http: {verb: 'get', path: '/'}
});
@ -477,7 +477,7 @@ DataAccessObject.findOne = function findOne(params, cb) {
setRemoting(DataAccessObject.findOne, {
description: 'Find first instance of the model matched by filter from the data source',
accepts: {arg: 'filter', type: 'object'},
accepts: {arg: 'filter', type: 'object', description: 'Filter defining fields, where, orderBy, offset, and limit'},
returns: {arg: 'data', type: 'object', root: true},
http: {verb: 'get', path: '/findOne'}
});
@ -529,7 +529,7 @@ DataAccessObject.deleteById =
// deleteById ~ remoting attributes
setRemoting(DataAccessObject.deleteById, {
description: 'Delete a model instance by id from the data source',
accepts: {arg: 'id', type: 'any'},
accepts: {arg: 'id', type: 'any', description: 'Model id'},
http: {verb: 'del', path: '/:id'}
});
@ -554,7 +554,7 @@ DataAccessObject.count = function (where, cb) {
// count ~ remoting attributes
setRemoting(DataAccessObject.count, {
description: 'Count instances of the model matched by where from the data source',
accepts: {arg: 'where', type: 'object'},
accepts: {arg: 'where', type: 'object', description: 'Criteria to match model instances'},
returns: {arg: 'count', type: 'number'},
http: {verb: 'get', path: '/count'}
});
@ -747,7 +747,7 @@ DataAccessObject.prototype.updateAttributes = function updateAttributes(data, cb
// updateAttributes ~ remoting attributes
setRemoting(DataAccessObject.prototype.updateAttributes, {
description: 'Update attributes for a model instance and persist it into the data source',
accepts: {arg: 'data', type: 'object', http: {source: 'body'}},
accepts: {arg: 'data', type: 'object', http: {source: 'body'}, description: 'An object of model property name/value pairs'},
returns: {arg: 'data', type: 'object', root: true},
http: {verb: 'put', path: '/'}
});