get api filter limit 10 by default

This commit is contained in:
Vijay 2017-12-07 16:45:28 +05:30
parent 1a1a297b57
commit d52eef3bb7
1 changed files with 5 additions and 1 deletions

View File

@ -157,7 +157,11 @@ function mountSwagger(loopbackApplication, swaggerApp, opts) {
});
}
if (verb === 'get' && result[newKey].get) {
if (!result[newKey].get.parameters) {
if (result[newKey].get.parameters) {
if (result[newKey].get.parameters[0].name === 'filter') {
result[newKey].get.parameters[0].default = JSON.stringify({limit: 10});
}
} else {
result[newKey].get.parameters = [];
}
if (_.isArray(result[newKey].get.parameters) && _.findIndex(result[newKey].get.parameters, { name: 'getFrom', enum: ['elastic'] }) === -1) {