Skip to content

Commit

Permalink
Merge pull request #26 from natura-cosmeticos/hotfix/validate-error
Browse files Browse the repository at this point in the history
fix(validate): fixed validate function error for swagger 2.0 files
  • Loading branch information
robertLichtnow authored Jan 31, 2020
2 parents f0a1773 + 7ebc868 commit 7d95fd8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/validation/validate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ export const validate = async (api: string, rules?: Rules) => {
const parsedApi: any = await parse(api);

if (parsedApi.swagger) {
return Promise.reject(Error('This is not using OpenAPI 3.0.0^'));
const error = new Error();
error.name = 'NonValidApiVersion';
error.message = 'This is not using OpenAPI 3.0.0^';
return Promise.reject(error);
}

const parsedRules: Rules = {
Expand Down

0 comments on commit 7d95fd8

Please sign in to comment.