forked from loafle/openapi-generator-original
fix null payload in java jersey2 (#6933)
This commit is contained in:
parent
38368c9bda
commit
cef1bec466
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user