added response check for swagger 2.0/1.2 client
This commit is contained in:
@@ -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()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user