Quellcode durchsuchen

updated swagger-js

bubble
Tony Tam vor 9 Jahren
Ursprung
Commit
2c4f4a6331
4 geänderte Dateien mit 33 neuen und 9 gelöschten Zeilen
  1. +9
    -3
      dist/lib/swagger.js
  2. +14
    -2
      dist/swagger-ui.js
  3. +1
    -1
      dist/swagger-ui.min.js
  4. +9
    -3
      lib/swagger.js

+ 9
- 3
dist/lib/swagger.js Datei anzeigen

@@ -139,7 +139,7 @@
url: this.url,
method: "get",
headers: {
accept: "application/json,application/json;charset=\"utf-8\",*/*"
accept: "application/json,application/json;charset=utf-8,*/*"
},
on: {
error: function (response) {
@@ -373,7 +373,7 @@
method: "get",
useJQuery: this.useJQuery,
headers: {
accept: "application/json,application/json;charset=\"utf-8\",*/*"
accept: "application/json,application/json;charset=utf-8,*/*"
},
on: {
response: function (resp) {
@@ -1503,7 +1503,13 @@
if (contentType != null) {
if (contentType.indexOf("application/json") == 0 || contentType.indexOf("+json") > 0) {
if (response.content.data && response.content.data !== "")
out.obj = JSON.parse(response.content.data);
try {
out.obj = JSON.parse(response.content.data);
}
catch () {
// do not set out.obj
log ("unable to parse JSON content");
}
else
out.obj = {}
}


+ 14
- 2
dist/swagger-ui.js Datei anzeigen

@@ -1386,6 +1386,18 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
return this.api.build();
};

SwaggerUi.prototype.collapseAll = function() {
return Docs.collapseEndpointListForResource('');
};

SwaggerUi.prototype.listAll = function() {
return Docs.collapseOperationsForResource('');
};

SwaggerUi.prototype.expandAll = function() {
return Docs.expandOperationsForResource('');
};

SwaggerUi.prototype.render = function() {
var _this = this;
this.showMessage('Finished Loading Resource Information. Rendering Swagger UI...');
@@ -1397,10 +1409,10 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
this.showMessage();
switch (this.options.docExpansion) {
case "full":
Docs.expandOperationsForResource('');
this.expandAll();
break;
case "list":
Docs.collapseOperationsForResource('');
this.listAll();
}
if (this.options.onComplete) {
this.options.onComplete(this.api, this);


+ 1
- 1
dist/swagger-ui.min.js
Datei-Diff unterdrückt, da er zu groß ist
Datei anzeigen


+ 9
- 3
lib/swagger.js Datei anzeigen

@@ -139,7 +139,7 @@
url: this.url,
method: "get",
headers: {
accept: "application/json,application/json;charset=\"utf-8\",*/*"
accept: "application/json,application/json;charset=utf-8,*/*"
},
on: {
error: function (response) {
@@ -373,7 +373,7 @@
method: "get",
useJQuery: this.useJQuery,
headers: {
accept: "application/json,application/json;charset=\"utf-8\",*/*"
accept: "application/json,application/json;charset=utf-8,*/*"
},
on: {
response: function (resp) {
@@ -1503,7 +1503,13 @@
if (contentType != null) {
if (contentType.indexOf("application/json") == 0 || contentType.indexOf("+json") > 0) {
if (response.content.data && response.content.data !== "")
out.obj = JSON.parse(response.content.data);
try {
out.obj = JSON.parse(response.content.data);
}
catch () {
// do not set out.obj
log ("unable to parse JSON content");
}
else
out.obj = {}
}


Laden…
Abbrechen
Speichern