Skip to content

Commit

Permalink
return app on install
Browse files Browse the repository at this point in the history
  • Loading branch information
Carmine DiMascio committed Nov 29, 2019
1 parent 89ba6f1 commit 88ffb73
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion example/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ new OpenApiValidator({
// },
})
.install(app)
.then(() => {
.then(app => {
let id = 3;
// 3. Add routes
app.get('/v1/pets', function(req, res, next) {
Expand Down
3 changes: 2 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export class OpenApiValidator {
this.options = options;
}

public async install(app: Application): Promise<void> {
public async install(app: Application): Promise<Application> {
const spec = await new OpenApiSpecLoader({
apiDoc: this.options.apiSpec,
}).load();
Expand All @@ -62,6 +62,7 @@ export class OpenApiValidator {
if (this.options.validateResponses) {
this.installResponseValidationMiddleware(app, context);
}
return app;
}

private installPathParams(app: Application, context: OpenApiContext): void {
Expand Down

0 comments on commit 88ffb73

Please sign in to comment.