Merge remote-tracking branch 'origin' into 7.0.x

This commit is contained in:
William Cheng
2023-03-03 21:52:50 +08:00
10595 changed files with 418520 additions and 73194 deletions

View File

@@ -114,7 +114,7 @@ dependencies {
implementation 'io.gsonfire:gson-fire:1.8.5'
implementation 'javax.ws.rs:jsr311-api:1.1.1'
implementation 'javax.ws.rs:javax.ws.rs-api:2.1.1'
implementation 'org.openapitools:jackson-databind-nullable:0.2.4'
implementation 'org.openapitools:jackson-databind-nullable:0.2.6'
implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0'
implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version"
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.1'

View File

@@ -16,7 +16,7 @@ lazy val root = (project in file(".")).
"org.apache.commons" % "commons-lang3" % "3.12.0",
"javax.ws.rs" % "jsr311-api" % "1.1.1",
"javax.ws.rs" % "javax.ws.rs-api" % "2.1.1",
"org.openapitools" % "jackson-databind-nullable" % "0.2.4",
"org.openapitools" % "jackson-databind-nullable" % "0.2.6",
"io.gsonfire" % "gson-fire" % "1.8.5" % "compile",
"jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile",
"com.google.code.findbugs" % "jsr305" % "3.0.2" % "compile",

View File

@@ -258,11 +258,6 @@
</profiles>
<dependencies>
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-annotations</artifactId>
<version>${swagger-core-version}</version>
</dependency>
<!-- @Nullable annotation -->
<dependency>
<groupId>com.google.code.findbugs</groupId>
@@ -305,6 +300,7 @@
<artifactId>jackson-databind-nullable</artifactId>
<version>${jackson-databind-nullable-version}</version>
</dependency>
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>jsr311-api</artifactId>
@@ -340,11 +336,11 @@
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<gson-fire-version>1.8.5</gson-fire-version>
<swagger-core-version>1.6.5</swagger-core-version>
<swagger-annotations-version>1.6.6</swagger-annotations-version>
<okhttp-version>4.10.0</okhttp-version>
<gson-version>2.9.1</gson-version>
<commons-lang3-version>3.12.0</commons-lang3-version>
<jackson-databind-nullable-version>0.2.4</jackson-databind-nullable-version>
<jackson-databind-nullable-version>0.2.6</jackson-databind-nullable-version>
<jakarta-annotation-version>1.3.5</jakarta-annotation-version>
<junit-version>5.9.1</junit-version>
<junit-platform-runner.version>1.9.1</junit-platform-runner.version>

View File

@@ -61,6 +61,15 @@ import org.openapitools.client.auth.ApiKeyAuth;
public class ApiClient {
private String basePath = "http://localhost:8082";
protected List<ServerConfiguration> servers = new ArrayList<ServerConfiguration>(Arrays.asList(
new ServerConfiguration(
"http://localhost:8082",
"No description provided",
new HashMap<String, ServerVariable>()
)
));
protected Integer serverIndex = 0;
protected Map<String, String> serverVariables = null;
private boolean debugging = false;
private Map<String, String> defaultHeaderMap = new HashMap<String, String>();
private Map<String, String> defaultCookieMap = new HashMap<String, String>();
@@ -151,6 +160,34 @@ public class ApiClient {
*/
public ApiClient setBasePath(String basePath) {
this.basePath = basePath;
this.serverIndex = null;
return this;
}
public List<ServerConfiguration> getServers() {
return servers;
}
public ApiClient setServers(List<ServerConfiguration> servers) {
this.servers = servers;
return this;
}
public Integer getServerIndex() {
return serverIndex;
}
public ApiClient setServerIndex(Integer serverIndex) {
this.serverIndex = serverIndex;
return this;
}
public Map<String, String> getServerVariables() {
return serverVariables;
}
public ApiClient setServerVariables(Map<String, String> serverVariables) {
this.serverVariables = serverVariables;
return this;
}
@@ -415,6 +452,18 @@ public class ApiClient {
throw new RuntimeException("No OAuth2 authentication configured!");
}
/**
* Helper method to set credentials for AWSV4 Signature
*
* @param accessKey Access Key
* @param secretKey Secret Key
* @param region Region
* @param service Service to access to
*/
public void setAWS4Configuration(String accessKey, String secretKey, String region, String service) {
throw new RuntimeException("No AWS4 authentication configured!");
}
/**
* Set the User-Agent header's value (by adding to the default header map).
*
@@ -1196,7 +1245,18 @@ public class ApiClient {
if (baseUrl != null) {
url.append(baseUrl).append(path);
} else {
url.append(basePath).append(path);
String baseURL;
if (serverIndex != null) {
if (serverIndex < 0 || serverIndex >= servers.size()) {
throw new ArrayIndexOutOfBoundsException(String.format(
"Invalid index %d when selecting the host settings. Must be less than %d", serverIndex, servers.size()
));
}
baseURL = servers.get(serverIndex).URL(serverVariables);
} else {
baseURL = basePath;
}
url.append(baseURL).append(path);
}
if (queryParams != null && !queryParams.isEmpty()) {

View File

@@ -99,7 +99,7 @@ public class ApiException extends Exception {
* @param responseBody the response body
*/
public ApiException(int code, Map<String, List<String>> responseHeaders, String responseBody) {
this((String) null, (Throwable) null, code, responseHeaders, responseBody);
this("Response Code: " + code + " Response Body: " + responseBody, (Throwable) null, code, responseHeaders, responseBody);
}
/**

View File

@@ -20,8 +20,6 @@ import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import com.google.gson.Gson;
@@ -129,7 +127,6 @@ public class SomeObj {
* @return $type
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public TypeEnum get$Type() {
return $type;
@@ -152,7 +149,6 @@ public class SomeObj {
* @return id
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Long getId() {
return id;
@@ -175,7 +171,6 @@ public class SomeObj {
* @return name
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getName() {
return name;
@@ -198,7 +193,6 @@ public class SomeObj {
* @return active
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getActive() {
return active;
@@ -221,7 +215,6 @@ public class SomeObj {
* @return type
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getType() {
return type;

View File

@@ -18,8 +18,6 @@ import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;