From 703d3d048e2f4fe98df7906c11a2ce2edac2a670 Mon Sep 17 00:00:00 2001 From: Tony Tam Date: Thu, 29 Jan 2015 22:00:56 -0800 Subject: [PATCH] updated for #852 --- dist/lib/swagger-client.js | 17 +++++++++++++++-- lib/swagger-client.js | 17 +++++++++++++++-- 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/dist/lib/swagger-client.js b/dist/lib/swagger-client.js index d54ef265..4913ecb9 100644 --- a/dist/lib/swagger-client.js +++ b/dist/lib/swagger-client.js @@ -696,7 +696,20 @@ SwaggerResource.prototype.addOperations = function (resource_path, ops, consumes } } o.nickname = this.sanitize(o.nickname); - var op = new SwaggerOperation(o.nickname, resource_path, method, o.parameters, o.summary, o.notes, type, responseMessages, this, consumes, produces, o.authorizations, o.deprecated); + var op = new SwaggerOperation(o.nickname, + resource_path, + method, + o.parameters, + o.summary, + o.notes, + type, + responseMessages, + this, + consumes, + produces, + o.authorizations, + o.deprecated); + this.operations[op.nickname] = op; output.push(this.operationsArray.push(op)); } @@ -888,7 +901,7 @@ var SwaggerOperation = function (nickname, path, method, parameters, summary, no this.consumes = consumes; this.produces = produces; this.authorizations = typeof authorizations !== 'undefined' ? authorizations : resource.authorizations; - this.deprecated = deprecated; + this.deprecated = (typeof deprecated === 'string' ? Boolean(deprecated) : deprecated); this['do'] = __bind(this['do'], this); if (errors.length > 0) { diff --git a/lib/swagger-client.js b/lib/swagger-client.js index d54ef265..4913ecb9 100644 --- a/lib/swagger-client.js +++ b/lib/swagger-client.js @@ -696,7 +696,20 @@ SwaggerResource.prototype.addOperations = function (resource_path, ops, consumes } } o.nickname = this.sanitize(o.nickname); - var op = new SwaggerOperation(o.nickname, resource_path, method, o.parameters, o.summary, o.notes, type, responseMessages, this, consumes, produces, o.authorizations, o.deprecated); + var op = new SwaggerOperation(o.nickname, + resource_path, + method, + o.parameters, + o.summary, + o.notes, + type, + responseMessages, + this, + consumes, + produces, + o.authorizations, + o.deprecated); + this.operations[op.nickname] = op; output.push(this.operationsArray.push(op)); } @@ -888,7 +901,7 @@ var SwaggerOperation = function (nickname, path, method, parameters, summary, no this.consumes = consumes; this.produces = produces; this.authorizations = typeof authorizations !== 'undefined' ? authorizations : resource.authorizations; - this.deprecated = deprecated; + this.deprecated = (typeof deprecated === 'string' ? Boolean(deprecated) : deprecated); this['do'] = __bind(this['do'], this); if (errors.length > 0) {