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