Skip to content

Commit ee19963

Browse files
committed
1 parent 4ea2085 commit ee19963

File tree

4 files changed

+80
-80
lines changed

4 files changed

+80
-80
lines changed

dist/lib/swagger.js

+39-39
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// swagger.js
2-
// version 2.0.36
2+
// version 2.0.37
33

44
var __bind = function(fn, me){
55
return function(){
@@ -45,41 +45,40 @@ if (!('map' in Array.prototype)) {
4545
}
4646

4747
Object.keys = Object.keys || (function () {
48-
var hasOwnProperty = Object.prototype.hasOwnProperty,
49-
hasDontEnumBug = !{toString:null}.propertyIsEnumerable("toString"),
50-
DontEnums = [
51-
'toString',
52-
'toLocaleString',
53-
'valueOf',
54-
'hasOwnProperty',
55-
'isPrototypeOf',
56-
'propertyIsEnumerable',
57-
'constructor'
58-
],
59-
DontEnumsLength = DontEnums.length;
60-
61-
return function (o) {
62-
if (typeof o != "object" && typeof o != "function" || o === null)
63-
throw new TypeError("Object.keys called on a non-object");
64-
65-
var result = [];
66-
for (var name in o) {
67-
if (hasOwnProperty.call(o, name))
68-
result.push(name);
69-
}
48+
var hasOwnProperty = Object.prototype.hasOwnProperty,
49+
hasDontEnumBug = !{toString:null}.propertyIsEnumerable("toString"),
50+
DontEnums = [
51+
'toString',
52+
'toLocaleString',
53+
'valueOf',
54+
'hasOwnProperty',
55+
'isPrototypeOf',
56+
'propertyIsEnumerable',
57+
'constructor'
58+
],
59+
DontEnumsLength = DontEnums.length;
60+
61+
return function (o) {
62+
if (typeof o != "object" && typeof o != "function" || o === null)
63+
throw new TypeError("Object.keys called on a non-object");
64+
65+
var result = [];
66+
for (var name in o) {
67+
if (hasOwnProperty.call(o, name))
68+
result.push(name);
69+
}
7070

71-
if (hasDontEnumBug) {
72-
for (var i = 0; i < DontEnumsLength; i++) {
73-
if (hasOwnProperty.call(o, DontEnums[i]))
74-
result.push(DontEnums[i]);
75-
}
76-
}
71+
if (hasDontEnumBug) {
72+
for (var i = 0; i < DontEnumsLength; i++) {
73+
if (hasOwnProperty.call(o, DontEnums[i]))
74+
result.push(DontEnums[i]);
75+
}
76+
}
7777

78-
return result;
79-
};
78+
return result;
79+
};
8080
})();
8181

82-
8382
var SwaggerApi = function(url, options) {
8483
this.url = null;
8584
this.debug = false;
@@ -158,6 +157,7 @@ SwaggerApi.prototype.buildFromSpec = function(response) {
158157
}
159158
this.apis = {};
160159
this.apisArray = [];
160+
this.consumes = response.consumes;
161161
this.produces = response.produces;
162162
this.authSchemes = response.authorizations;
163163
if (response.info != null) {
@@ -175,13 +175,13 @@ SwaggerApi.prototype.buildFromSpec = function(response) {
175175
}
176176
}
177177
}
178-
if (response.basePath) {
178+
if (response.basePath)
179179
this.basePath = response.basePath;
180-
} else if (this.url.indexOf('?') > 0) {
180+
else if (this.url.indexOf('?') > 0)
181181
this.basePath = this.url.substring(0, this.url.lastIndexOf('?'));
182-
} else {
182+
else
183183
this.basePath = this.url;
184-
}
184+
185185
if (isApi) {
186186
var newName = response.resourcePath.replace(/\//g, '');
187187
this.resourcePath = response.resourcePath;
@@ -321,8 +321,8 @@ var SwaggerResource = function(resourceObj, api) {
321321
var _this = this;
322322
this.api = api;
323323
this.api = this.api;
324-
produces = [];
325-
consumes = [];
324+
consumes = (this.consumes | []);
325+
produces = (this.produces | []);
326326
this.path = this.api.resourcePath != null ? this.api.resourcePath : resourceObj.path;
327327
this.description = resourceObj.description;
328328

@@ -1191,7 +1191,7 @@ var SwaggerRequest = function(type, url, params, opts, successCallback, errorCal
11911191
SwaggerRequest.prototype.setHeaders = function(params, operation) {
11921192
// default type
11931193
var accepts = "application/json";
1194-
var contentType = null;
1194+
var consumes = "application/json";
11951195

11961196
var allDefinedParams = this.operation.parameters;
11971197
var definedFormParams = [];

dist/swagger-ui.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// swagger-ui.js
2-
// version 2.0.21
2+
// version 2.0.22
33
$(function() {
44

55
// Helper function for vertically aligning DOM elements

lib/swagger.js

+39-39
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// swagger.js
2-
// version 2.0.36
2+
// version 2.0.37
33

44
var __bind = function(fn, me){
55
return function(){
@@ -45,41 +45,40 @@ if (!('map' in Array.prototype)) {
4545
}
4646

4747
Object.keys = Object.keys || (function () {
48-
var hasOwnProperty = Object.prototype.hasOwnProperty,
49-
hasDontEnumBug = !{toString:null}.propertyIsEnumerable("toString"),
50-
DontEnums = [
51-
'toString',
52-
'toLocaleString',
53-
'valueOf',
54-
'hasOwnProperty',
55-
'isPrototypeOf',
56-
'propertyIsEnumerable',
57-
'constructor'
58-
],
59-
DontEnumsLength = DontEnums.length;
60-
61-
return function (o) {
62-
if (typeof o != "object" && typeof o != "function" || o === null)
63-
throw new TypeError("Object.keys called on a non-object");
64-
65-
var result = [];
66-
for (var name in o) {
67-
if (hasOwnProperty.call(o, name))
68-
result.push(name);
69-
}
48+
var hasOwnProperty = Object.prototype.hasOwnProperty,
49+
hasDontEnumBug = !{toString:null}.propertyIsEnumerable("toString"),
50+
DontEnums = [
51+
'toString',
52+
'toLocaleString',
53+
'valueOf',
54+
'hasOwnProperty',
55+
'isPrototypeOf',
56+
'propertyIsEnumerable',
57+
'constructor'
58+
],
59+
DontEnumsLength = DontEnums.length;
60+
61+
return function (o) {
62+
if (typeof o != "object" && typeof o != "function" || o === null)
63+
throw new TypeError("Object.keys called on a non-object");
64+
65+
var result = [];
66+
for (var name in o) {
67+
if (hasOwnProperty.call(o, name))
68+
result.push(name);
69+
}
7070

71-
if (hasDontEnumBug) {
72-
for (var i = 0; i < DontEnumsLength; i++) {
73-
if (hasOwnProperty.call(o, DontEnums[i]))
74-
result.push(DontEnums[i]);
75-
}
76-
}
71+
if (hasDontEnumBug) {
72+
for (var i = 0; i < DontEnumsLength; i++) {
73+
if (hasOwnProperty.call(o, DontEnums[i]))
74+
result.push(DontEnums[i]);
75+
}
76+
}
7777

78-
return result;
79-
};
78+
return result;
79+
};
8080
})();
8181

82-
8382
var SwaggerApi = function(url, options) {
8483
this.url = null;
8584
this.debug = false;
@@ -158,6 +157,7 @@ SwaggerApi.prototype.buildFromSpec = function(response) {
158157
}
159158
this.apis = {};
160159
this.apisArray = [];
160+
this.consumes = response.consumes;
161161
this.produces = response.produces;
162162
this.authSchemes = response.authorizations;
163163
if (response.info != null) {
@@ -175,13 +175,13 @@ SwaggerApi.prototype.buildFromSpec = function(response) {
175175
}
176176
}
177177
}
178-
if (response.basePath) {
178+
if (response.basePath)
179179
this.basePath = response.basePath;
180-
} else if (this.url.indexOf('?') > 0) {
180+
else if (this.url.indexOf('?') > 0)
181181
this.basePath = this.url.substring(0, this.url.lastIndexOf('?'));
182-
} else {
182+
else
183183
this.basePath = this.url;
184-
}
184+
185185
if (isApi) {
186186
var newName = response.resourcePath.replace(/\//g, '');
187187
this.resourcePath = response.resourcePath;
@@ -321,8 +321,8 @@ var SwaggerResource = function(resourceObj, api) {
321321
var _this = this;
322322
this.api = api;
323323
this.api = this.api;
324-
produces = [];
325-
consumes = [];
324+
consumes = (this.consumes | []);
325+
produces = (this.produces | []);
326326
this.path = this.api.resourcePath != null ? this.api.resourcePath : resourceObj.path;
327327
this.description = resourceObj.description;
328328

@@ -1191,7 +1191,7 @@ var SwaggerRequest = function(type, url, params, opts, successCallback, errorCal
11911191
SwaggerRequest.prototype.setHeaders = function(params, operation) {
11921192
// default type
11931193
var accepts = "application/json";
1194-
var contentType = null;
1194+
var consumes = "application/json";
11951195

11961196
var allDefinedParams = this.operation.parameters;
11971197
var definedFormParams = [];

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "swagger-ui",
3-
"version": "2.0.21",
3+
"version": "2.0.22",
44
"description": "Swagger UI is a dependency-free collection of HTML, Javascript, and CSS assets that dynamically generate beautiful documentation from a Swagger-compliant API",
55
"scripts": {
66
"build": "PATH=$PATH:./node_modules/.bin cake dist",

0 commit comments

Comments
 (0)