forked from loafle/openapi-generator-original
* 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);
|
Entity<?> entity = serialize(body, formParams, contentType);
|
||||||
|
|
||||||
Response response;
|
Response response = null;
|
||||||
|
|
||||||
|
try {
|
||||||
if ("GET".equals(method)) {
|
if ("GET".equals(method)) {
|
||||||
response = invocationBuilder.get();
|
response = invocationBuilder.get();
|
||||||
} else if ("POST".equals(method)) {
|
} else if ("POST".equals(method)) {
|
||||||
@ -725,6 +726,13 @@ public class ApiClient {
|
|||||||
buildResponseHeaders(response),
|
buildResponseHeaders(response),
|
||||||
respBody);
|
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);
|
Entity<?> entity = serialize(body, formParams, contentType);
|
||||||
|
|
||||||
Response response;
|
Response response = null;
|
||||||
|
|
||||||
|
try {
|
||||||
if ("GET".equals(method)) {
|
if ("GET".equals(method)) {
|
||||||
response = invocationBuilder.get();
|
response = invocationBuilder.get();
|
||||||
} else if ("POST".equals(method)) {
|
} else if ("POST".equals(method)) {
|
||||||
@ -714,6 +715,13 @@ public class ApiClient {
|
|||||||
buildResponseHeaders(response),
|
buildResponseHeaders(response),
|
||||||
respBody);
|
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