1+ // swagger.js
2+ // version 2.0.13
3+
14var __bind = function ( fn , me ) {
25 return function ( ) {
36 return fn . apply ( me , arguments ) ;
@@ -940,14 +943,10 @@ var SwaggerRequest = function(type, url, params, opts, successCallback, errorCal
940943 }
941944
942945 responseContentType = null ;
943- if ( this . type === "POST" || this . type === "GET" || this . type === "PATCH" ) {
944- if ( this . opts . responseContentType ) {
945- responseContentType = this . opts . responseContentType ;
946- } else {
947- responseContentType = "application/json" ;
948- }
946+ if ( this . opts . responseContentType ) {
947+ responseContentType = this . opts . responseContentType ;
949948 } else {
950- responseContentType = null ;
949+ responseContentType = "application/json" ;
951950 }
952951 if ( responseContentType && this . operation . produces ) {
953952 if ( this . operation . produces [ responseContentType ] === 'undefined' ) {
@@ -1108,7 +1107,8 @@ JQueryHttpClient.prototype.execute = function(obj) {
11081107 headers : headers
11091108 } ;
11101109
1111- if ( response . _headers [ "Content-Type" ] && response . _headers [ "Content-Type" ] . indexOf ( "application/json" ) == 0 && response . content . data !== "" ) {
1110+ if ( response . _headers [ "Content-Type" ] && response . _headers [ "Content-Type" ] . indexOf ( "application/json" ) == 0 &&
1111+ response . content . data && response . content . data !== "" ) {
11121112 out . obj = JSON . parse ( response . responseText ) ;
11131113 }
11141114
@@ -1187,7 +1187,7 @@ ShredHttpClient.prototype.execute = function(obj) {
11871187
11881188 if ( contentType != null ) {
11891189 if ( contentType . indexOf ( "application/json" ) == 0 ) {
1190- if ( response . content . data !== "" )
1190+ if ( response . content . data && response . content . data !== "" )
11911191 out . obj = JSON . parse ( response . content . data ) ;
11921192 else
11931193 out . obj = { }
@@ -1302,4 +1302,4 @@ e.SwaggerOperation = SwaggerOperation;
13021302e . SwaggerModel = SwaggerModel ;
13031303e . SwaggerModelProperty = SwaggerModelProperty ;
13041304e . SwaggerResource = SwaggerResource ;
1305- e . SwaggerApi = SwaggerApi ;
1305+ e . SwaggerApi = SwaggerApi ;
0 commit comments