updated versions, swagger-js
This commit is contained in:
22
dist/lib/swagger.js
vendored
22
dist/lib/swagger.js
vendored
@@ -372,20 +372,24 @@ var SwaggerResource = function(resourceObj, api) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SwaggerResource.prototype.getAbsoluteBasePath = function(relativeBasePath) {
|
SwaggerResource.prototype.getAbsoluteBasePath = function (relativeBasePath) {
|
||||||
var parts, pos, url;
|
var pos, url;
|
||||||
url = this.api.basePath;
|
url = this.api.basePath;
|
||||||
pos = url.lastIndexOf(relativeBasePath);
|
pos = url.lastIndexOf(relativeBasePath);
|
||||||
if (pos === -1) {
|
var parts = url.split("/");
|
||||||
parts = url.split("/");
|
var rootUrl = parts[0] + "//" + parts[2];
|
||||||
url = parts[0] + "//" + parts[2];
|
//if the relative path is '/' return the root url
|
||||||
|
if (relativeBasePath === '/'){
|
||||||
|
return rootUrl
|
||||||
|
}
|
||||||
|
//if the relative path is not in the base path
|
||||||
|
else if (pos === -1 ) {
|
||||||
if (relativeBasePath.indexOf("/") === 0) {
|
if (relativeBasePath.indexOf("/") === 0) {
|
||||||
return url + relativeBasePath;
|
return url + relativeBasePath;
|
||||||
} else {
|
} else {
|
||||||
return url + "/" + relativeBasePath;
|
return url + "/" + relativeBasePath;
|
||||||
}
|
}
|
||||||
} else if (relativeBasePath === "/") {
|
//If the relative path is in the base path
|
||||||
return url.substring(0, pos);
|
|
||||||
} else {
|
} else {
|
||||||
return url.substring(0, pos) + relativeBasePath;
|
return url.substring(0, pos) + relativeBasePath;
|
||||||
}
|
}
|
||||||
@@ -1467,8 +1471,8 @@ SwaggerAuthorizations.prototype.apply = function(obj, authorizations) {
|
|||||||
var status = null;
|
var status = null;
|
||||||
var key;
|
var key;
|
||||||
|
|
||||||
if(typeof authorizations === 'undefined') {
|
// if the "authorizations" key is undefined, or has an empty array, add all keys
|
||||||
// apply all keys since no authorizations hash is defined
|
if(typeof authorizations === 'undefined' || Object.keys(authorizations).length == 0) {
|
||||||
for (key in this.authz) {
|
for (key in this.authz) {
|
||||||
value = this.authz[key];
|
value = this.authz[key];
|
||||||
result = value.apply(obj, authorizations);
|
result = value.apply(obj, authorizations);
|
||||||
|
|||||||
2
dist/swagger-ui.js
vendored
2
dist/swagger-ui.js
vendored
@@ -1,5 +1,5 @@
|
|||||||
// swagger-ui.js
|
// swagger-ui.js
|
||||||
// version 2.0.17
|
// version 2.0.18
|
||||||
$(function() {
|
$(function() {
|
||||||
|
|
||||||
// Helper function for vertically aligning DOM elements
|
// Helper function for vertically aligning DOM elements
|
||||||
|
|||||||
@@ -372,20 +372,24 @@ var SwaggerResource = function(resourceObj, api) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SwaggerResource.prototype.getAbsoluteBasePath = function(relativeBasePath) {
|
SwaggerResource.prototype.getAbsoluteBasePath = function (relativeBasePath) {
|
||||||
var parts, pos, url;
|
var pos, url;
|
||||||
url = this.api.basePath;
|
url = this.api.basePath;
|
||||||
pos = url.lastIndexOf(relativeBasePath);
|
pos = url.lastIndexOf(relativeBasePath);
|
||||||
if (pos === -1) {
|
var parts = url.split("/");
|
||||||
parts = url.split("/");
|
var rootUrl = parts[0] + "//" + parts[2];
|
||||||
url = parts[0] + "//" + parts[2];
|
//if the relative path is '/' return the root url
|
||||||
|
if (relativeBasePath === '/'){
|
||||||
|
return rootUrl
|
||||||
|
}
|
||||||
|
//if the relative path is not in the base path
|
||||||
|
else if (pos === -1 ) {
|
||||||
if (relativeBasePath.indexOf("/") === 0) {
|
if (relativeBasePath.indexOf("/") === 0) {
|
||||||
return url + relativeBasePath;
|
return url + relativeBasePath;
|
||||||
} else {
|
} else {
|
||||||
return url + "/" + relativeBasePath;
|
return url + "/" + relativeBasePath;
|
||||||
}
|
}
|
||||||
} else if (relativeBasePath === "/") {
|
//If the relative path is in the base path
|
||||||
return url.substring(0, pos);
|
|
||||||
} else {
|
} else {
|
||||||
return url.substring(0, pos) + relativeBasePath;
|
return url.substring(0, pos) + relativeBasePath;
|
||||||
}
|
}
|
||||||
@@ -1467,8 +1471,8 @@ SwaggerAuthorizations.prototype.apply = function(obj, authorizations) {
|
|||||||
var status = null;
|
var status = null;
|
||||||
var key;
|
var key;
|
||||||
|
|
||||||
if(typeof authorizations === 'undefined') {
|
// if the "authorizations" key is undefined, or has an empty array, add all keys
|
||||||
// apply all keys since no authorizations hash is defined
|
if(typeof authorizations === 'undefined' || Object.keys(authorizations).length == 0) {
|
||||||
for (key in this.authz) {
|
for (key in this.authz) {
|
||||||
value = this.authz[key];
|
value = this.authz[key];
|
||||||
result = value.apply(obj, authorizations);
|
result = value.apply(obj, authorizations);
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "swagger-ui",
|
"name": "swagger-ui",
|
||||||
"version": "2.0.17",
|
"version": "2.0.18",
|
||||||
"description": "Swagger UI is a dependency-free collection of HTML, Javascript, and CSS assets that dynamically generate beautiful documentation from a Swagger-compliant API",
|
"description": "Swagger UI is a dependency-free collection of HTML, Javascript, and CSS assets that dynamically generate beautiful documentation from a Swagger-compliant API",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "PATH=$PATH:./node_modules/.bin cake dist",
|
"build": "PATH=$PATH:./node_modules/.bin cake dist",
|
||||||
|
|||||||
Reference in New Issue
Block a user