added check for schema
This commit is contained in:
37
dist/lib/swagger-client.js
vendored
37
dist/lib/swagger-client.js
vendored
@@ -305,7 +305,7 @@ SwaggerClient.prototype.buildFromSpec = function(response) {
|
||||
tags = operation.tags;
|
||||
}
|
||||
var operationId = this.idFromOp(path, httpMethod, operation);
|
||||
var operation = new Operation (
|
||||
var operationObject = new Operation (
|
||||
this,
|
||||
operationId,
|
||||
httpMethod,
|
||||
@@ -325,11 +325,11 @@ SwaggerClient.prototype.buildFromSpec = function(response) {
|
||||
operationGroup.label = tag;
|
||||
operationGroup.apis = [];
|
||||
this[tag].help = this.help.bind(operationGroup);
|
||||
this.apisArray.push(new OperationGroup(tag, operation));
|
||||
this.apisArray.push(new OperationGroup(tag, operationObject));
|
||||
}
|
||||
operationGroup[operationId] = operation.execute.bind(operation);
|
||||
operationGroup[operationId].help = operation.help.bind(operation);
|
||||
operationGroup.apis.push(operation);
|
||||
operationGroup[operationId] = operationObject.execute.bind(operationObject);
|
||||
operationGroup[operationId].help = operationObject.help.bind(operationObject);
|
||||
operationGroup.apis.push(operationObject);
|
||||
|
||||
// legacy UI feature
|
||||
var j;
|
||||
@@ -340,7 +340,7 @@ SwaggerClient.prototype.buildFromSpec = function(response) {
|
||||
}
|
||||
}
|
||||
if(api) {
|
||||
api.operationsArray.push(operation);
|
||||
api.operationsArray.push(operationObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -405,6 +405,7 @@ var OperationGroup = function(tag, operation) {
|
||||
var Operation = function(parent, operationId, httpMethod, path, args, definitions) {
|
||||
var errors = [];
|
||||
this.operation = args;
|
||||
this.deprecated = args.deprecated;
|
||||
this.consumes = args.consumes;
|
||||
this.produces = args.produces;
|
||||
this.parent = parent;
|
||||
@@ -439,6 +440,30 @@ var Operation = function(parent, operationId, httpMethod, path, args, definition
|
||||
response = responses['200'];
|
||||
defaultResponseCode = '200';
|
||||
}
|
||||
else if(responses['201']) {
|
||||
response = responses['201'];
|
||||
defaultResponseCode = '201';
|
||||
}
|
||||
else if(responses['202']) {
|
||||
response = responses['202'];
|
||||
defaultResponseCode = '202';
|
||||
}
|
||||
else if(responses['203']) {
|
||||
response = responses['203'];
|
||||
defaultResponseCode = '203';
|
||||
}
|
||||
else if(responses['204']) {
|
||||
response = responses['204'];
|
||||
defaultResponseCode = '204';
|
||||
}
|
||||
else if(responses['205']) {
|
||||
response = responses['205'];
|
||||
defaultResponseCode = '205';
|
||||
}
|
||||
else if(responses['206']) {
|
||||
response = responses['206'];
|
||||
defaultResponseCode = '206';
|
||||
}
|
||||
else if(responses['default']) {
|
||||
response = responses['default'];
|
||||
defaultResponseCode = 'default';
|
||||
|
||||
Reference in New Issue
Block a user