updated swagger-client
This commit is contained in:
12
dist/lib/swagger.js
vendored
12
dist/lib/swagger.js
vendored
@@ -216,8 +216,6 @@
|
|||||||
produces = [];
|
produces = [];
|
||||||
consumes = [];
|
consumes = [];
|
||||||
this.path = this.api.resourcePath != null ? this.api.resourcePath : resourceObj.path;
|
this.path = this.api.resourcePath != null ? this.api.resourcePath : resourceObj.path;
|
||||||
console.log("we produce " + resourceObj.produces);
|
|
||||||
console.log('using path ' + this.path);
|
|
||||||
this.description = resourceObj.description;
|
this.description = resourceObj.description;
|
||||||
parts = this.path.split("/");
|
parts = this.path.split("/");
|
||||||
this.name = parts[parts.length - 1].replace('.{format}', '');
|
this.name = parts[parts.length - 1].replace('.{format}', '');
|
||||||
@@ -309,7 +307,7 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
SwaggerResource.prototype.addOperations = function(resource_path, ops, consumes, produces) {
|
SwaggerResource.prototype.addOperations = function(resource_path, ops, consumes, produces) {
|
||||||
var method, o, op, responseMessages, type, _i, _len, _results;
|
var method, o, op, ref, responseMessages, type, _i, _len, _results;
|
||||||
if (ops) {
|
if (ops) {
|
||||||
_results = [];
|
_results = [];
|
||||||
for (_i = 0, _len = ops.length; _i < _len; _i++) {
|
for (_i = 0, _len = ops.length; _i < _len; _i++) {
|
||||||
@@ -327,6 +325,13 @@
|
|||||||
produces = this.produces;
|
produces = this.produces;
|
||||||
}
|
}
|
||||||
type = o.type || o.responseClass;
|
type = o.type || o.responseClass;
|
||||||
|
if (type === "array") {
|
||||||
|
ref = null;
|
||||||
|
if (o.items) {
|
||||||
|
ref = o.items["type"] || o.items["$ref"];
|
||||||
|
}
|
||||||
|
type = "array[" + ref + "]";
|
||||||
|
}
|
||||||
responseMessages = o.responseMessages;
|
responseMessages = o.responseMessages;
|
||||||
method = o.method;
|
method = o.method;
|
||||||
if (o.httpMethod) {
|
if (o.httpMethod) {
|
||||||
@@ -547,6 +552,7 @@
|
|||||||
this.method = this.method.toLowerCase();
|
this.method = this.method.toLowerCase();
|
||||||
this.isGetMethod = this.method === "get";
|
this.isGetMethod = this.method === "get";
|
||||||
this.resourceName = this.resource.name;
|
this.resourceName = this.resource.name;
|
||||||
|
console.log("model type: " + type);
|
||||||
if (((_ref = this.type) != null ? _ref.toLowerCase() : void 0) === 'void') {
|
if (((_ref = this.type) != null ? _ref.toLowerCase() : void 0) === 'void') {
|
||||||
this.type = void 0;
|
this.type = void 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -216,8 +216,6 @@
|
|||||||
produces = [];
|
produces = [];
|
||||||
consumes = [];
|
consumes = [];
|
||||||
this.path = this.api.resourcePath != null ? this.api.resourcePath : resourceObj.path;
|
this.path = this.api.resourcePath != null ? this.api.resourcePath : resourceObj.path;
|
||||||
console.log("we produce " + resourceObj.produces);
|
|
||||||
console.log('using path ' + this.path);
|
|
||||||
this.description = resourceObj.description;
|
this.description = resourceObj.description;
|
||||||
parts = this.path.split("/");
|
parts = this.path.split("/");
|
||||||
this.name = parts[parts.length - 1].replace('.{format}', '');
|
this.name = parts[parts.length - 1].replace('.{format}', '');
|
||||||
@@ -309,7 +307,7 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
SwaggerResource.prototype.addOperations = function(resource_path, ops, consumes, produces) {
|
SwaggerResource.prototype.addOperations = function(resource_path, ops, consumes, produces) {
|
||||||
var method, o, op, responseMessages, type, _i, _len, _results;
|
var method, o, op, ref, responseMessages, type, _i, _len, _results;
|
||||||
if (ops) {
|
if (ops) {
|
||||||
_results = [];
|
_results = [];
|
||||||
for (_i = 0, _len = ops.length; _i < _len; _i++) {
|
for (_i = 0, _len = ops.length; _i < _len; _i++) {
|
||||||
@@ -327,6 +325,13 @@
|
|||||||
produces = this.produces;
|
produces = this.produces;
|
||||||
}
|
}
|
||||||
type = o.type || o.responseClass;
|
type = o.type || o.responseClass;
|
||||||
|
if (type === "array") {
|
||||||
|
ref = null;
|
||||||
|
if (o.items) {
|
||||||
|
ref = o.items["type"] || o.items["$ref"];
|
||||||
|
}
|
||||||
|
type = "array[" + ref + "]";
|
||||||
|
}
|
||||||
responseMessages = o.responseMessages;
|
responseMessages = o.responseMessages;
|
||||||
method = o.method;
|
method = o.method;
|
||||||
if (o.httpMethod) {
|
if (o.httpMethod) {
|
||||||
@@ -547,6 +552,7 @@
|
|||||||
this.method = this.method.toLowerCase();
|
this.method = this.method.toLowerCase();
|
||||||
this.isGetMethod = this.method === "get";
|
this.isGetMethod = this.method === "get";
|
||||||
this.resourceName = this.resource.name;
|
this.resourceName = this.resource.name;
|
||||||
|
console.log("model type: " + type);
|
||||||
if (((_ref = this.type) != null ? _ref.toLowerCase() : void 0) === 'void') {
|
if (((_ref = this.type) != null ? _ref.toLowerCase() : void 0) === 'void') {
|
||||||
this.type = void 0;
|
this.type = void 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user