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 {
|
} else {
|
||||||
// We let jersey handle the serialization
|
// We let jersey handle the serialization
|
||||||
if (isBodyNullable) { // payload is nullable
|
if (isBodyNullable) { // payload is nullable
|
||||||
entity = Entity.entity(obj == null ? Entity.text("null") : obj, contentType);
|
entity = Entity.entity(obj == null ? "null" : obj, contentType);
|
||||||
} else {
|
} else {
|
||||||
entity = Entity.entity(obj == null ? Entity.text("") : obj, contentType);
|
entity = Entity.entity(obj == null ? "" : obj, contentType);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return entity;
|
return entity;
|
||||||
|
@ -791,9 +791,9 @@ public class ApiClient {
|
|||||||
} else {
|
} else {
|
||||||
// We let jersey handle the serialization
|
// We let jersey handle the serialization
|
||||||
if (isBodyNullable) { // payload is nullable
|
if (isBodyNullable) { // payload is nullable
|
||||||
entity = Entity.entity(obj == null ? Entity.text("null") : obj, contentType);
|
entity = Entity.entity(obj == null ? "null" : obj, contentType);
|
||||||
} else {
|
} else {
|
||||||
entity = Entity.entity(obj == null ? Entity.text("") : obj, contentType);
|
entity = Entity.entity(obj == null ? "" : obj, contentType);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return entity;
|
return entity;
|
||||||
|
@ -870,9 +870,9 @@ public class ApiClient {
|
|||||||
} else {
|
} else {
|
||||||
// We let jersey handle the serialization
|
// We let jersey handle the serialization
|
||||||
if (isBodyNullable) { // payload is nullable
|
if (isBodyNullable) { // payload is nullable
|
||||||
entity = Entity.entity(obj == null ? Entity.text("null") : obj, contentType);
|
entity = Entity.entity(obj == null ? "null" : obj, contentType);
|
||||||
} else {
|
} else {
|
||||||
entity = Entity.entity(obj == null ? Entity.text("") : obj, contentType);
|
entity = Entity.entity(obj == null ? "" : obj, contentType);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return entity;
|
return entity;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user