fix null payload in java jersey2 (#6933)

This commit is contained in:
William Cheng 2020-07-15 00:50:37 +08:00 committed by GitHub
parent 38368c9bda
commit cef1bec466
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 6 deletions

View File

@ -874,9 +874,9 @@ public class ApiClient {
} else {
// We let jersey handle the serialization
if (isBodyNullable) { // payload is nullable
entity = Entity.entity(obj == null ? Entity.text("null") : obj, contentType);
entity = Entity.entity(obj == null ? "null" : obj, contentType);
} else {
entity = Entity.entity(obj == null ? Entity.text("") : obj, contentType);
entity = Entity.entity(obj == null ? "" : obj, contentType);
}
}
return entity;

View File

@ -791,9 +791,9 @@ public class ApiClient {
} else {
// We let jersey handle the serialization
if (isBodyNullable) { // payload is nullable
entity = Entity.entity(obj == null ? Entity.text("null") : obj, contentType);
entity = Entity.entity(obj == null ? "null" : obj, contentType);
} else {
entity = Entity.entity(obj == null ? Entity.text("") : obj, contentType);
entity = Entity.entity(obj == null ? "" : obj, contentType);
}
}
return entity;

View File

@ -870,9 +870,9 @@ public class ApiClient {
} else {
// We let jersey handle the serialization
if (isBodyNullable) { // payload is nullable
entity = Entity.entity(obj == null ? Entity.text("null") : obj, contentType);
entity = Entity.entity(obj == null ? "null" : obj, contentType);
} else {
entity = Entity.entity(obj == null ? Entity.text("") : obj, contentType);
entity = Entity.entity(obj == null ? "" : obj, contentType);
}
}
return entity;