Skip to content

Commit e1576ad

Browse files
committed
Regenerate samples
1 parent 7f2a27a commit e1576ad

File tree

15 files changed

+75
-15
lines changed
  • samples/client
    • echo_api/java
      • okhttp-gson-user-defined-templates/src/main/java/org/openapitools/client
      • okhttp-gson/src/main/java/org/openapitools/client
    • others/java
      • okhttp-gson-oneOf-array/src/main/java/org/openapitools/client
      • okhttp-gson-oneOf/src/main/java/org/openapitools/client
      • okhttp-gson-streaming/src/main/java/org/openapitools/client
    • petstore/java
      • okhttp-gson-3.1-duplicated-operationid/src/main/java/org/openapitools/client
      • okhttp-gson-3.1/src/main/java/org/openapitools/client
      • okhttp-gson-awsv4signature/src/main/java/org/openapitools/client
      • okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client
      • okhttp-gson-group-parameter/src/main/java/org/openapitools/client
      • okhttp-gson-nullable-required/src/main/java/org/openapitools/client
      • okhttp-gson-parcelableModel/src/main/java/org/openapitools/client
      • okhttp-gson-swagger1/src/main/java/org/openapitools/client
      • okhttp-gson-swagger2/src/main/java/org/openapitools/client
      • okhttp-gson/src/main/java/org/openapitools/client

15 files changed

+75
-15
lines changed

samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/main/java/org/openapitools/client/ApiClient.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1043,8 +1043,12 @@ public <T> T deserialize(Response response, Type returnType) throws ApiException
10431043
try {
10441044
if (isJsonMime(contentType)) {
10451045
if (returnType.equals(String.class)) {
1046+
String respBodyString = respBody.string();
1047+
if (respBodyString.isEmpty()) {
1048+
return null;
1049+
}
10461050
// Use String-based deserialize for String return type with fallback
1047-
return JSON.deserialize(respBody.string(), returnType);
1051+
return JSON.deserialize(respBodyString, returnType);
10481052
} else {
10491053
// Use InputStream-based deserialize which supports responses > 2GB
10501054
return JSON.deserialize(respBody.byteStream(), returnType);

samples/client/echo_api/java/okhttp-gson/src/main/java/org/openapitools/client/ApiClient.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -973,8 +973,12 @@ public <T> T deserialize(Response response, Type returnType) throws ApiException
973973
try {
974974
if (isJsonMime(contentType)) {
975975
if (returnType.equals(String.class)) {
976+
String respBodyString = respBody.string();
977+
if (respBodyString.isEmpty()) {
978+
return null;
979+
}
976980
// Use String-based deserialize for String return type with fallback
977-
return JSON.deserialize(respBody.string(), returnType);
981+
return JSON.deserialize(respBodyString, returnType);
978982
} else {
979983
// Use InputStream-based deserialize which supports responses > 2GB
980984
return JSON.deserialize(respBody.byteStream(), returnType);

samples/client/others/java/okhttp-gson-oneOf-array/src/main/java/org/openapitools/client/ApiClient.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -947,8 +947,12 @@ public <T> T deserialize(Response response, Type returnType) throws ApiException
947947
try {
948948
if (isJsonMime(contentType)) {
949949
if (returnType.equals(String.class)) {
950+
String respBodyString = respBody.string();
951+
if (respBodyString.isEmpty()) {
952+
return null;
953+
}
950954
// Use String-based deserialize for String return type with fallback
951-
return JSON.deserialize(respBody.string(), returnType);
955+
return JSON.deserialize(respBodyString, returnType);
952956
} else {
953957
// Use InputStream-based deserialize which supports responses > 2GB
954958
return JSON.deserialize(respBody.byteStream(), returnType);

samples/client/others/java/okhttp-gson-oneOf/src/main/java/org/openapitools/client/ApiClient.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -947,8 +947,12 @@ public <T> T deserialize(Response response, Type returnType) throws ApiException
947947
try {
948948
if (isJsonMime(contentType)) {
949949
if (returnType.equals(String.class)) {
950+
String respBodyString = respBody.string();
951+
if (respBodyString.isEmpty()) {
952+
return null;
953+
}
950954
// Use String-based deserialize for String return type with fallback
951-
return JSON.deserialize(respBody.string(), returnType);
955+
return JSON.deserialize(respBodyString, returnType);
952956
} else {
953957
// Use InputStream-based deserialize which supports responses > 2GB
954958
return JSON.deserialize(respBody.byteStream(), returnType);

samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/ApiClient.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -947,8 +947,12 @@ public <T> T deserialize(Response response, Type returnType) throws ApiException
947947
try {
948948
if (isJsonMime(contentType)) {
949949
if (returnType.equals(String.class)) {
950+
String respBodyString = respBody.string();
951+
if (respBodyString.isEmpty()) {
952+
return null;
953+
}
950954
// Use String-based deserialize for String return type with fallback
951-
return JSON.deserialize(respBody.string(), returnType);
955+
return JSON.deserialize(respBodyString, returnType);
952956
} else {
953957
// Use InputStream-based deserialize which supports responses > 2GB
954958
return JSON.deserialize(respBody.byteStream(), returnType);

samples/client/petstore/java/okhttp-gson-3.1-duplicated-operationid/src/main/java/org/openapitools/client/ApiClient.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1043,8 +1043,12 @@ public <T> T deserialize(Response response, Type returnType) throws ApiException
10431043
try {
10441044
if (isJsonMime(contentType)) {
10451045
if (returnType.equals(String.class)) {
1046+
String respBodyString = respBody.string();
1047+
if (respBodyString.isEmpty()) {
1048+
return null;
1049+
}
10461050
// Use String-based deserialize for String return type with fallback
1047-
return JSON.deserialize(respBody.string(), returnType);
1051+
return JSON.deserialize(respBodyString, returnType);
10481052
} else {
10491053
// Use InputStream-based deserialize which supports responses > 2GB
10501054
return JSON.deserialize(respBody.byteStream(), returnType);

samples/client/petstore/java/okhttp-gson-3.1/src/main/java/org/openapitools/client/ApiClient.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1043,8 +1043,12 @@ public <T> T deserialize(Response response, Type returnType) throws ApiException
10431043
try {
10441044
if (isJsonMime(contentType)) {
10451045
if (returnType.equals(String.class)) {
1046+
String respBodyString = respBody.string();
1047+
if (respBodyString.isEmpty()) {
1048+
return null;
1049+
}
10461050
// Use String-based deserialize for String return type with fallback
1047-
return JSON.deserialize(respBody.string(), returnType);
1051+
return JSON.deserialize(respBodyString, returnType);
10481052
} else {
10491053
// Use InputStream-based deserialize which supports responses > 2GB
10501054
return JSON.deserialize(respBody.byteStream(), returnType);

samples/client/petstore/java/okhttp-gson-awsv4signature/src/main/java/org/openapitools/client/ApiClient.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1063,8 +1063,12 @@ public <T> T deserialize(Response response, Type returnType) throws ApiException
10631063
try {
10641064
if (isJsonMime(contentType)) {
10651065
if (returnType.equals(String.class)) {
1066+
String respBodyString = respBody.string();
1067+
if (respBodyString.isEmpty()) {
1068+
return null;
1069+
}
10661070
// Use String-based deserialize for String return type with fallback
1067-
return JSON.deserialize(respBody.string(), returnType);
1071+
return JSON.deserialize(respBodyString, returnType);
10681072
} else {
10691073
// Use InputStream-based deserialize which supports responses > 2GB
10701074
return JSON.deserialize(respBody.byteStream(), returnType);

samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiClient.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1048,8 +1048,12 @@ public <T> T deserialize(Response response, Type returnType) throws ApiException
10481048
try {
10491049
if (isJsonMime(contentType)) {
10501050
if (returnType.equals(String.class)) {
1051+
String respBodyString = respBody.string();
1052+
if (respBodyString.isEmpty()) {
1053+
return null;
1054+
}
10511055
// Use String-based deserialize for String return type with fallback
1052-
return JSON.deserialize(respBody.string(), returnType);
1056+
return JSON.deserialize(respBodyString, returnType);
10531057
} else {
10541058
// Use InputStream-based deserialize which supports responses > 2GB
10551059
return JSON.deserialize(respBody.byteStream(), returnType);

samples/client/petstore/java/okhttp-gson-group-parameter/src/main/java/org/openapitools/client/ApiClient.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1043,8 +1043,12 @@ public <T> T deserialize(Response response, Type returnType) throws ApiException
10431043
try {
10441044
if (isJsonMime(contentType)) {
10451045
if (returnType.equals(String.class)) {
1046+
String respBodyString = respBody.string();
1047+
if (respBodyString.isEmpty()) {
1048+
return null;
1049+
}
10461050
// Use String-based deserialize for String return type with fallback
1047-
return JSON.deserialize(respBody.string(), returnType);
1051+
return JSON.deserialize(respBodyString, returnType);
10481052
} else {
10491053
// Use InputStream-based deserialize which supports responses > 2GB
10501054
return JSON.deserialize(respBody.byteStream(), returnType);

0 commit comments

Comments
 (0)