Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
cdimascio authored Oct 24, 2019
1 parent fb91ff0 commit 5e20731
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -520,19 +520,19 @@ that are _not_ under the base URL—such as pages—will not be validated.

**A:** Yes. Be sure to add the swagger serve middleware prior to installing the OpenApiValidator. This will ensure that `swagger-ui-express` is able to fully prepare the spec before before OpenApiValidator attempts to use it.

```javascript
app.use('/', swaggerUi.serve, swaggerUi.setup(documentation))
new OpenApiValidator({
apiSpec: documentation,
validateResponses: true,
securityHandlers: {
bearerAuth: (req, scopes, schema) => {
console.log(req, scopes, schema)
}
}
}).install(app)
```
```javascript
app.use('/', swaggerUi.serve, swaggerUi.setup(documentation))
new OpenApiValidator({
apiSpec: documentation,
validateResponses: true,
securityHandlers: {
bearerAuth: (req, scopes, schema) => {
console.log(req, scopes, schema)
}
}
}).install(app)
```
## Contributors

Contributions welcome! Here's how to [contribute](CONTRIBUTING.md).
Expand Down

0 comments on commit 5e20731

Please sign in to comment.