Skip to content

Commit

Permalink
don't check security against missing schema paths
Browse files Browse the repository at this point in the history
  • Loading branch information
Carmine DiMascio committed Oct 24, 2019
1 parent 9c42969 commit 1566383
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/middlewares/openapi.security.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,12 @@ export function security(
return next();
}

// const securities: OpenAPIV3.SecurityRequirementObject[] =
// req.openapi.schema.security;
const pathSchema = req.openapi.schema;
if (!pathSchema) {
// path has no schema, let it pass security validation
// request middleware is in the chain and will validate downstream
return next();
}

// use the local security object or fallbac to api doc's security or undefined
const securities: OpenAPIV3.SecurityRequirementObject[] =
Expand Down

0 comments on commit 1566383

Please sign in to comment.