added response check for swagger 2.0/1.2 client

This commit is contained in:
Tony Tam
2014-09-16 17:40:33 -07:00
parent 394afba3e5
commit 91822035ef
7 changed files with 39 additions and 22 deletions

View File

@@ -184,6 +184,7 @@ var SwaggerClient = function(url, options) {
this.basePath = null;
this.authorizations = null;
this.authorizationScheme = null;
this.isValid = false;
this.info = null;
this.useJQuery = false;
@@ -236,6 +237,11 @@ SwaggerClient.prototype.build = function() {
if(responseObj.swagger && responseObj.swagger === 2.0) {
self.swaggerVersion = responseObj.swagger;
self.buildFromSpec(responseObj);
self.isValid = true;
}
else {
self.isValid = false;
self.failure()
}
}
}