From 9553b97a8b8b43c8521844e687506c9d299a47db Mon Sep 17 00:00:00 2001 From: Tony Tam Date: Thu, 29 Jan 2015 22:00:56 -0800 Subject: [PATCH] updated for #852 --- lib/swagger-client.js | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/lib/swagger-client.js b/lib/swagger-client.js index d54ef265fc5..4913ecb92f2 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) {