mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-11 02:02:45 +00:00
[java-jersey2] Fix empty body when form parameters supplied (#5169)
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user