Skip to content

Commit

Permalink
fix: allow ref for query param fields
Browse files Browse the repository at this point in the history
  • Loading branch information
theoomoregbee committed Aug 29, 2019
1 parent 78c482f commit 3dfc2f1
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions lib/generators.js
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,7 @@ function _getPathParamsFromKeys(keys) {
return params;
}


/**
* this is used to create param for custom controllers
* @param parameters
Expand Down Expand Up @@ -405,13 +406,20 @@ function _getQueryParamsFromRouteQuery(queries) {
var params = [];

_.forEach(queries, function (query) {
params.push({
in: 'query',
name: query,
required: false,
type: 'string',
description: 'This is a query param for ' + query
});
let param
if(typeof query !== 'string' && query.$ref){
param = query
}else{
param = {
in: 'query',
name: query,
required: false,
type: 'string',
description: 'This is a query param for ' + query
}
}

params.push(param);
});

return params;
Expand Down

0 comments on commit 3dfc2f1

Please sign in to comment.