forked from loafle/openapi-generator-original
[java-jersey2] Fix empty body when form parameters supplied (#5169)
This commit is contained in:
parent
b36b65964f
commit
fbcb8e0c7e
@ -573,7 +573,7 @@ public class ApiClient {
|
||||
entity = Entity.entity(form, MediaType.APPLICATION_FORM_URLENCODED_TYPE);
|
||||
} else {
|
||||
// We let jersey handle the serialization
|
||||
entity = Entity.entity(obj, contentType);
|
||||
entity = Entity.entity(obj == null ? Entity.text("") : obj, contentType);
|
||||
}
|
||||
return entity;
|
||||
}
|
||||
@ -732,7 +732,7 @@ public class ApiClient {
|
||||
}
|
||||
}
|
||||
|
||||
Entity<?> entity = (body == null) ? Entity.json("") : serialize(body, formParams, contentType);
|
||||
Entity<?> entity = serialize(body, formParams, contentType);
|
||||
|
||||
Response response = null;
|
||||
|
||||
|
@ -562,7 +562,7 @@ public class ApiClient {
|
||||
entity = Entity.entity(form, MediaType.APPLICATION_FORM_URLENCODED_TYPE);
|
||||
} else {
|
||||
// We let jersey handle the serialization
|
||||
entity = Entity.entity(obj, contentType);
|
||||
entity = Entity.entity(obj == null ? Entity.text("") : obj, contentType);
|
||||
}
|
||||
return entity;
|
||||
}
|
||||
@ -716,7 +716,7 @@ public class ApiClient {
|
||||
}
|
||||
}
|
||||
|
||||
Entity<?> entity = (body == null) ? Entity.json("") : serialize(body, formParams, contentType);
|
||||
Entity<?> entity = serialize(body, formParams, contentType);
|
||||
|
||||
Response response = null;
|
||||
|
||||
|
@ -563,7 +563,7 @@ public class ApiClient {
|
||||
entity = Entity.entity(form, MediaType.APPLICATION_FORM_URLENCODED_TYPE);
|
||||
} else {
|
||||
// We let jersey handle the serialization
|
||||
entity = Entity.entity(obj, contentType);
|
||||
entity = Entity.entity(obj == null ? Entity.text("") : obj, contentType);
|
||||
}
|
||||
return entity;
|
||||
}
|
||||
@ -716,7 +716,7 @@ public class ApiClient {
|
||||
}
|
||||
}
|
||||
|
||||
Entity<?> entity = (body == null) ? Entity.json("") : serialize(body, formParams, contentType);
|
||||
Entity<?> entity = serialize(body, formParams, contentType);
|
||||
|
||||
Response response = null;
|
||||
|
||||
|
@ -563,7 +563,7 @@ public class ApiClient {
|
||||
entity = Entity.entity(form, MediaType.APPLICATION_FORM_URLENCODED_TYPE);
|
||||
} else {
|
||||
// We let jersey handle the serialization
|
||||
entity = Entity.entity(obj, contentType);
|
||||
entity = Entity.entity(obj == null ? Entity.text("") : obj, contentType);
|
||||
}
|
||||
return entity;
|
||||
}
|
||||
@ -716,7 +716,7 @@ public class ApiClient {
|
||||
}
|
||||
}
|
||||
|
||||
Entity<?> entity = (body == null) ? Entity.json("") : serialize(body, formParams, contentType);
|
||||
Entity<?> entity = serialize(body, formParams, contentType);
|
||||
|
||||
Response response = null;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user