diff --git a/dist/lib/swagger-client.js b/dist/lib/swagger-client.js index b895541a..eac794f1 100644 --- a/dist/lib/swagger-client.js +++ b/dist/lib/swagger-client.js @@ -1,6 +1,6 @@ /** * swagger-client - swagger.js is a javascript client for use with swaggering APIs. - * @version v2.1.1-M1 + * @version v2.1.2-M1 * @link http://swagger.io * @license apache 2.0 */ @@ -578,6 +578,20 @@ var Operation = function(parent, scheme, operationId, httpMethod, path, args, de this.description = args.description; this.useJQuery = parent.useJQuery; + if(typeof this.deprecated === 'string') { + switch(this.deprecated.toLowerCase()) { + case 'true': case 'yes': case '1': { + this.deprecated = true; + break; + } + case 'false': case 'no': case '0': case null: { + this.deprecated = false; + break; + } + default: this.deprecated = Boolean(this.deprecated); + } + } + if(definitions) { // add to global models var key; @@ -810,9 +824,7 @@ Operation.prototype.getHeaderParams = function (args) { if (param.in === 'header') { var value = args[param.name]; if(Array.isArray(value)) - value = this.encodePathCollection(param.collectionFormat, param.name, value); - else - value = this.encodePathParam(value); + value = value.toString(); headers[param.name] = value; } } @@ -1683,6 +1695,7 @@ var SwaggerResource = function (resourceObj, api) { this.description = resourceObj.description; this.authorizations = (resourceObj.authorizations || {}); + var parts = this.path.split('/'); this.name = parts[parts.length - 1].replace('.{format}', ''); this.basePath = this.api.basePath; @@ -1761,7 +1774,7 @@ SwaggerResource.prototype.addApiDeclaration = function (response) { this.consumes = response.consumes; if ((typeof response.basePath === 'string') && response.basePath.replace(/\s/g, '').length > 0) this.basePath = response.basePath.indexOf('http') === -1 ? this.getAbsoluteBasePath(response.basePath) : response.basePath; - + this.resourcePath = response.resourcePath; this.addModels(response.models); if (response.apis) { for (var i = 0 ; i < response.apis.length; i++) { @@ -2040,9 +2053,23 @@ 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 = (typeof deprecated === 'string' ? Boolean(deprecated) : deprecated); + this.deprecated = deprecated; this['do'] = __bind(this['do'], this); + if(typeof this.deprecated === 'string') { + switch(this.deprecated.toLowerCase()) { + case 'true': case 'yes': case '1': { + this.deprecated = true; + break; + } + case 'false': case 'no': case '0': case null: { + this.deprecated = false; + break; + } + default: this.deprecated = Boolean(this.deprecated); + } + } + if (errors.length > 0) { console.error('SwaggerOperation errors', errors, arguments); this.resource.api.fail(errors); diff --git a/dist/swagger-ui.js b/dist/swagger-ui.js index 3fa0cab0..63e68c5e 100644 --- a/dist/swagger-ui.js +++ b/dist/swagger-ui.js @@ -1,6 +1,6 @@ /** * swagger-ui - Swagger UI is a dependency-free collection of HTML, Javascript, and CSS assets that dynamically generate beautiful documentation from a Swagger-compliant API - * @version v2.1.1-M1 + * @version v2.1.2-M1 * @link http://swagger.io * @license Apache 2.0 */ @@ -199,6 +199,14 @@ var Docs = { } }; +this["Handlebars"] = this["Handlebars"] || {}; +this["Handlebars"]["templates"] = this["Handlebars"]["templates"] || {}; +this["Handlebars"]["templates"]["apikey_button_view"] = Handlebars.template({"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) { + var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; + return "\n