Skip to content

Commit

Permalink
Merge pull request #29 from mgalmes/master
Browse files Browse the repository at this point in the history
fix parameters bug
  • Loading branch information
HugoMario authored Dec 7, 2020
2 parents 27fbd49 + 78f5c9f commit 9349490
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/middleware/swagger.parameters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export class SwaggerParameters {
};

return (req, res, next) => {
if (!req.openapi || !req.openapi.schema || !req.openapi.schema.parameters) {
if (!req.openapi || !req.openapi.schema) {
next();
return;
}
Expand All @@ -36,7 +36,7 @@ export class SwaggerParameters {
});
}

const parameters = req.openapi.schema.parameters;
const parameters = req.openapi.schema.parameters || [];
for (let i = 0; i < parameters.length; i++) {
const parameter = parameters[i];
if (parameter.in === 'query') {
Expand Down

0 comments on commit 9349490

Please sign in to comment.