Skip to content

Commit 75ca50f

Browse files
committed
fix for #234
1 parent 3a3b26c commit 75ca50f

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

lib/swagger-client.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2822,7 +2822,7 @@ JQueryHttpClient.prototype.execute = function(obj) {
28222822
if(contentType) {
28232823
if(contentType.indexOf("application/json") === 0 || contentType.indexOf("+json") > 0) {
28242824
try {
2825-
out.obj = response.responseJSON || {};
2825+
out.obj = response.responseJSON || JSON.parse(out.data) || {};
28262826
} catch (ex) {
28272827
// do not set out.obj
28282828
log("unable to parse JSON content");

lib/swagger-client.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "swagger-client",
33
"author": "Tony Tam <[email protected]>",
44
"description": "swagger.js is a javascript client for use with swaggering APIs.",
5-
"version": "2.1.3-M1",
5+
"version": "2.1.4-M1",
66
"homepage": "http://swagger.io",
77
"repository": {
88
"type": "git",

src/js/swaggerHttp.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ JQueryHttpClient.prototype.execute = function(obj) {
101101
if(contentType) {
102102
if(contentType.indexOf("application/json") === 0 || contentType.indexOf("+json") > 0) {
103103
try {
104-
out.obj = response.responseJSON || {};
104+
out.obj = response.responseJSON || JSON.parse(out.data) || {};
105105
} catch (ex) {
106106
// do not set out.obj
107107
log("unable to parse JSON content");

0 commit comments

Comments
 (0)