-
Notifications
You must be signed in to change notification settings - Fork 39
Chain result upto compare method #90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@vishrutshah, |
lib/validate.js
Outdated
return openApiDiff.compare(oldSwagger, newSwagger); | ||
return openApiDiff.compare(oldSwagger, newSwagger).then((result, err) => { | ||
console.log(result); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.catch
on error
lib/validate.js
Outdated
@@ -29,5 +29,7 @@ exports.compare = function compare(oldSwagger, newSwagger, options) { | |||
log.filepath = options.logFilepath || log.filepath; | |||
let openApiDiff = new OpenApiDiff(options); | |||
|
|||
return openApiDiff.compare(oldSwagger, newSwagger); | |||
return openApiDiff.compare(oldSwagger, newSwagger).then((result, err) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need to err
lib/validate.js
Outdated
@@ -30,6 +30,10 @@ exports.compare = function compare(oldSwagger, newSwagger, options) { | |||
let openApiDiff = new OpenApiDiff(options); | |||
|
|||
return openApiDiff.compare(oldSwagger, newSwagger).then((result, err) => { | |||
console.log(result); | |||
if (err) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need for if (err) if we do catch
Address review feedback
f14684c
to
4d9c926
Compare
This reverts commit 4d9c926.
@veronicagg & @amarzavery I've updated PR to incorporate yesterday's feedback. Please feel free to review again as you get chance. Thanks! Here is the successfully failed CI Build: https://travis-ci.org/Azure/azure-rest-api-specs/builds/262944817?utm_source=github_status&utm_medium=notification |
CHANGELOG.md
Outdated
@@ -1,6 +1,10 @@ | |||
## 0.1.7 | |||
Released on 2017-08-10. | |||
- Chaining the promises upto `compare` method and gracefully existing application [#88](https://github.com/Azure/openapi-diff/issues/88) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exi s ting
lib/validators/openApiDiff.js
Outdated
@@ -61,11 +61,8 @@ class OpenApiDiff { | |||
|
|||
return Promise.all([promise1, promise2]).then(results => { | |||
return self.processViaOpenApiDiff(results[0], results[1]).then((result, error) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return Promise.all([promise1, promise2]).then(results => {
return self.processViaOpenApiDiff(results[0], results[1]); //this is already returning a promise, so need to chain a redundant `.then()` to it
};
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
:) |
Part of #88
Verification PR : Azure/azure-rest-api-specs#1520
Verification Build : https://travis-ci.org/Azure/azure-rest-api-specs/builds/262397614?utm_source=github_status&utm_medium=notification
TODO: