Skip to content

Commit

Permalink
more fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Carmine DiMascio committed Jul 18, 2019
1 parent 0f8f7fc commit e934e37
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/middlewares/openapi.request.validator.2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ export class RequestValidator {
const error = {
status: 400,
errors: errors.map(e => ({
path: (e.params && e.params.missingProperty) || e.schemaPath,
path: (e.params && e.params.missingProperty) || e.dataPath || e.schemaPath,
message: e.message,
errorCode: `${e.keyword}.openapi.validation`,
})),
Expand Down
2 changes: 1 addition & 1 deletion test/routes.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const basePath = (<any>app).basePath;
.then(r => {
const e = r.body.errors;
expect(e).to.have.length(1);
expect(e[0].path).to.equal('limit');
expect(e[0].path).to.contain('limit');
expect(e[0].message).to.equal('should be >= 5');
}));
});
Expand Down

0 comments on commit e934e37

Please sign in to comment.