forked from loafle/openapi-generator-original
[Java][jersey2] Allow setting serverIndex to null (#6321)
This commit is contained in:
parent
c81359304d
commit
66948e6570
@ -251,7 +251,9 @@ public class ApiClient {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void updateBasePath() {
|
private void updateBasePath() {
|
||||||
setBasePath(servers.get(serverIndex).URL(serverVariables));
|
if (serverIndex != null) {
|
||||||
|
setBasePath(servers.get(serverIndex).URL(serverVariables));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
{{#hasOAuthMethods}}
|
{{#hasOAuthMethods}}
|
||||||
@ -1030,7 +1032,7 @@ public class ApiClient {
|
|||||||
// Not using `.target(targetURL).path(path)` below,
|
// Not using `.target(targetURL).path(path)` below,
|
||||||
// to support (constant) query string in `path`, e.g. "/posts?draft=1"
|
// to support (constant) query string in `path`, e.g. "/posts?draft=1"
|
||||||
String targetURL;
|
String targetURL;
|
||||||
if (operationServers.containsKey(operation)) {
|
if (serverIndex != null && operationServers.containsKey(operation)) {
|
||||||
Integer index = operationServerIndex.containsKey(operation) ? operationServerIndex.get(operation) : serverIndex;
|
Integer index = operationServerIndex.containsKey(operation) ? operationServerIndex.get(operation) : serverIndex;
|
||||||
Map<String, String> variables = operationServerVariables.containsKey(operation) ?
|
Map<String, String> variables = operationServerVariables.containsKey(operation) ?
|
||||||
operationServerVariables.get(operation) : serverVariables;
|
operationServerVariables.get(operation) : serverVariables;
|
||||||
|
@ -168,7 +168,9 @@ public class ApiClient {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void updateBasePath() {
|
private void updateBasePath() {
|
||||||
setBasePath(servers.get(serverIndex).URL(serverVariables));
|
if (serverIndex != null) {
|
||||||
|
setBasePath(servers.get(serverIndex).URL(serverVariables));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setOauthBasePath(String basePath) {
|
private void setOauthBasePath(String basePath) {
|
||||||
@ -937,7 +939,7 @@ public class ApiClient {
|
|||||||
// Not using `.target(targetURL).path(path)` below,
|
// Not using `.target(targetURL).path(path)` below,
|
||||||
// to support (constant) query string in `path`, e.g. "/posts?draft=1"
|
// to support (constant) query string in `path`, e.g. "/posts?draft=1"
|
||||||
String targetURL;
|
String targetURL;
|
||||||
if (operationServers.containsKey(operation)) {
|
if (serverIndex != null && operationServers.containsKey(operation)) {
|
||||||
Integer index = operationServerIndex.containsKey(operation) ? operationServerIndex.get(operation) : serverIndex;
|
Integer index = operationServerIndex.containsKey(operation) ? operationServerIndex.get(operation) : serverIndex;
|
||||||
Map<String, String> variables = operationServerVariables.containsKey(operation) ?
|
Map<String, String> variables = operationServerVariables.containsKey(operation) ?
|
||||||
operationServerVariables.get(operation) : serverVariables;
|
operationServerVariables.get(operation) : serverVariables;
|
||||||
|
@ -168,7 +168,9 @@ public class ApiClient {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void updateBasePath() {
|
private void updateBasePath() {
|
||||||
setBasePath(servers.get(serverIndex).URL(serverVariables));
|
if (serverIndex != null) {
|
||||||
|
setBasePath(servers.get(serverIndex).URL(serverVariables));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setOauthBasePath(String basePath) {
|
private void setOauthBasePath(String basePath) {
|
||||||
@ -937,7 +939,7 @@ public class ApiClient {
|
|||||||
// Not using `.target(targetURL).path(path)` below,
|
// Not using `.target(targetURL).path(path)` below,
|
||||||
// to support (constant) query string in `path`, e.g. "/posts?draft=1"
|
// to support (constant) query string in `path`, e.g. "/posts?draft=1"
|
||||||
String targetURL;
|
String targetURL;
|
||||||
if (operationServers.containsKey(operation)) {
|
if (serverIndex != null && operationServers.containsKey(operation)) {
|
||||||
Integer index = operationServerIndex.containsKey(operation) ? operationServerIndex.get(operation) : serverIndex;
|
Integer index = operationServerIndex.containsKey(operation) ? operationServerIndex.get(operation) : serverIndex;
|
||||||
Map<String, String> variables = operationServerVariables.containsKey(operation) ?
|
Map<String, String> variables = operationServerVariables.containsKey(operation) ?
|
||||||
operationServerVariables.get(operation) : serverVariables;
|
operationServerVariables.get(operation) : serverVariables;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user