File tree Expand file tree Collapse file tree
modules/openapi-generator/src/main/resources/Java/libraries Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1299,11 +1299,9 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} {
12991299 try {
13001300 response = sendRequest(method, invocationBuilder, entity);
13011301
1302- final int statusCode = response.getStatusInfo().getStatusCode();
1303-
13041302 {{#hasOAuthMethods} }
13051303 // If OAuth is used and a status 401 is received, renew the access token and retry the request
1306- if (authNames != null && statusCode == Status.UNAUTHORIZED.getStatusCode()) {
1304+ if (authNames != null && response.getStatusInfo().getStatusCode() == Status.UNAUTHORIZED.getStatusCode()) {
13071305 for (String authName : authNames) {
13081306 Authentication authentication = authentications.get(authName);
13091307 if (authentication instanceof OAuth) {
@@ -1317,8 +1315,10 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} {
13171315 }
13181316 }
13191317 }
1320-
1318+
13211319 { {/hasOAuthMethods} }
1320+ final int statusCode = response.getStatusInfo().getStatusCode();
1321+
13221322 Map<String , List <String >> responseHeaders = buildResponseHeaders(response);
13231323
13241324 if (statusCode == Status.NO_CONTENT.getStatusCode()) {
Original file line number Diff line number Diff line change @@ -1299,11 +1299,9 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} {
12991299 try {
13001300 response = sendRequest(method, invocationBuilder, entity);
13011301
1302- final int statusCode = response.getStatusInfo().getStatusCode();
1303-
13041302 {{#hasOAuthMethods} }
13051303 // If OAuth is used and a status 401 is received, renew the access token and retry the request
1306- if (authNames != null && statusCode == Status.UNAUTHORIZED.getStatusCode()) {
1304+ if (authNames != null && response.getStatusInfo().getStatusCode() == Status.UNAUTHORIZED.getStatusCode()) {
13071305 for (String authName : authNames) {
13081306 Authentication authentication = authentications.get(authName);
13091307 if (authentication instanceof OAuth) {
@@ -1319,6 +1317,8 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} {
13191317 }
13201318
13211319 { {/hasOAuthMethods} }
1320+ final int statusCode = response.getStatusInfo().getStatusCode();
1321+
13221322 Map<String , List <String >> responseHeaders = buildResponseHeaders(response);
13231323
13241324 if (statusCode == Status.NO_CONTENT.getStatusCode()) {
You can’t perform that action at this time.
0 commit comments