mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-06-29 12:10:54 +00:00
* Update ApiClient.mustache Fix for issue #5777 * Update ApiClient.mustache * Create ApiClient.mustache * Run java-petstore-jersey2.sh
This commit is contained in:
parent
77c14bca39
commit
f2276e5b35
@ -682,8 +682,9 @@ public class ApiClient {
|
||||
|
||||
Entity<?> entity = serialize(body, formParams, contentType);
|
||||
|
||||
Response response;
|
||||
Response response = null;
|
||||
|
||||
try {
|
||||
if ("GET".equals(method)) {
|
||||
response = invocationBuilder.get();
|
||||
} else if ("POST".equals(method)) {
|
||||
@ -725,6 +726,13 @@ public class ApiClient {
|
||||
buildResponseHeaders(response),
|
||||
respBody);
|
||||
}
|
||||
} finally {
|
||||
try {
|
||||
response.close();
|
||||
} catch (Exception e) {
|
||||
// it's not critical, since the response object is local in method invokeAPI; that's fine, just continue
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -671,8 +671,9 @@ public class ApiClient {
|
||||
|
||||
Entity<?> entity = serialize(body, formParams, contentType);
|
||||
|
||||
Response response;
|
||||
Response response = null;
|
||||
|
||||
try {
|
||||
if ("GET".equals(method)) {
|
||||
response = invocationBuilder.get();
|
||||
} else if ("POST".equals(method)) {
|
||||
@ -714,6 +715,13 @@ public class ApiClient {
|
||||
buildResponseHeaders(response),
|
||||
respBody);
|
||||
}
|
||||
} finally {
|
||||
try {
|
||||
response.close();
|
||||
} catch (Exception e) {
|
||||
// it's not critical, since the response object is local in method invokeAPI; that's fine, just continue
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user