Improve "filter" arg description

Add an example showing how to serialize object values as JSON.
This commit is contained in:
Raymond Camden 2017-02-20 10:30:01 -06:00 committed by Miroslav Bajtoš
parent c69e010670
commit 440b9a52a6
No known key found for this signature in database
GPG Key ID: 797723F23CE0A94A
1 changed files with 7 additions and 3 deletions

View File

@ -750,7 +750,9 @@ module.exports = function(registry) {
{arg: 'id', type: 'any', description: 'Model id', required: true, {arg: 'id', type: 'any', description: 'Model id', required: true,
http: {source: 'path'}}, http: {source: 'path'}},
{arg: 'filter', type: 'object', {arg: 'filter', type: 'object',
description: 'Filter defining fields and include'}, description:
'Filter defining fields and include - must be a JSON-encoded string (' +
'{"something":"value"})'},
{arg: 'options', type: 'object', http: 'optionsFromRequest'}, {arg: 'options', type: 'object', http: 'optionsFromRequest'},
], ],
returns: {arg: 'data', type: typeName, root: true}, returns: {arg: 'data', type: typeName, root: true},
@ -783,7 +785,8 @@ module.exports = function(registry) {
accessType: 'READ', accessType: 'READ',
accepts: [ accepts: [
{arg: 'filter', type: 'object', description: {arg: 'filter', type: 'object', description:
'Filter defining fields, where, include, order, offset, and limit'}, 'Filter defining fields, where, include, order, offset, and limit - must be a ' +
'JSON-encoded string ({"something":"value"})'},
{arg: 'options', type: 'object', http: 'optionsFromRequest'}, {arg: 'options', type: 'object', http: 'optionsFromRequest'},
], ],
returns: {arg: 'data', type: [typeName], root: true}, returns: {arg: 'data', type: [typeName], root: true},
@ -795,7 +798,8 @@ module.exports = function(registry) {
accessType: 'READ', accessType: 'READ',
accepts: [ accepts: [
{arg: 'filter', type: 'object', description: {arg: 'filter', type: 'object', description:
'Filter defining fields, where, include, order, offset, and limit'}, 'Filter defining fields, where, include, order, offset, and limit - must be a ' +
'JSON-encoded string ({"something":"value"})'},
{arg: 'options', type: 'object', http: 'optionsFromRequest'}, {arg: 'options', type: 'object', http: 'optionsFromRequest'},
], ],
returns: {arg: 'data', type: typeName, root: true}, returns: {arg: 'data', type: typeName, root: true},