Merge remote-tracking branch 'origin/master' into 6.3.x

This commit is contained in:
William Cheng
2022-11-01 17:42:59 +08:00
1972 changed files with 36976 additions and 6630 deletions

View File

@@ -2037,6 +2037,7 @@ components:
status:
description: Updated status of the pet
type: string
type: object
uploadFile_request:
properties:
additionalMetadata:
@@ -2046,6 +2047,7 @@ components:
description: file to upload
format: binary
type: string
type: object
testEnumParameters_request:
properties:
enum_form_string_array:
@@ -2065,6 +2067,7 @@ components:
- -efg
- (xyz)
type: string
type: object
testEndpointParameters_request:
properties:
integer:
@@ -2137,6 +2140,7 @@ components:
- double
- number
- pattern_without_delimiter
type: object
testJsonFormData_request:
properties:
param:
@@ -2148,6 +2152,7 @@ components:
required:
- param
- param2
type: object
uploadFileWithRequiredFile_request:
properties:
additionalMetadata:
@@ -2159,6 +2164,7 @@ components:
type: string
required:
- requiredFile
type: object
Dog_allOf:
properties:
breed:

View File

@@ -99,9 +99,9 @@ if(hasProperty('target') && target == 'android') {
ext {
swagger_annotations_version = "1.6.5"
jackson_version = "2.13.2"
jackson_databind_version = "2.13.2.2"
jackson_databind_nullable_version = "0.2.3"
jackson_version = "2.13.4"
jackson_databind_version = "2.13.4.2"
jackson_databind_nullable_version = "0.2.4"
jakarta_annotation_version = "1.3.5"
jersey_version = "2.35"
junit_version = "5.8.2"

View File

@@ -18,9 +18,9 @@ lazy val root = (project in file(".")).
"org.glassfish.jersey.connectors" % "jersey-apache-connector" % "2.35",
"com.fasterxml.jackson.core" % "jackson-core" % "2.13.2" % "compile",
"com.fasterxml.jackson.core" % "jackson-annotations" % "2.13.2" % "compile",
"com.fasterxml.jackson.core" % "jackson-databind" % "2.13.2.2" % "compile",
"com.fasterxml.jackson.core" % "jackson-databind" % "2.13.4.1" % "compile",
"com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.13.2" % "compile",
"org.openapitools" % "jackson-databind-nullable" % "0.2.3" % "compile",
"org.openapitools" % "jackson-databind-nullable" % "0.2.4" % "compile",
"com.github.scribejava" % "scribejava-apis" % "8.3.1" % "compile",
"jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile",
"org.junit.jupiter" % "junit-jupiter-api" % "5.8.2" % "test"

View File

@@ -340,9 +340,9 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<swagger-annotations-version>1.6.5</swagger-annotations-version>
<jersey-version>2.35</jersey-version>
<jackson-version>2.13.2</jackson-version>
<jackson-databind-version>2.13.2.2</jackson-databind-version>
<jackson-databind-nullable-version>0.2.3</jackson-databind-nullable-version>
<jackson-version>2.13.4</jackson-version>
<jackson-databind-version>2.13.4.2</jackson-databind-version>
<jackson-databind-nullable-version>0.2.4</jackson-databind-nullable-version>
<jakarta-annotation-version>1.3.5</jakarta-annotation-version>
<junit-version>5.8.2</junit-version>
<scribejava-apis-version>8.3.1</scribejava-apis-version>

View File

@@ -446,6 +446,22 @@ public class ApiClient extends JavaTimeFormatter {
throw new RuntimeException("No OAuth2 authentication configured!");
}
/**
* Helper method to set the credentials of a public client for the first OAuth2 authentication.
*
* @param clientId the client ID
* @return a {@link org.openapitools.client.ApiClient} object.
*/
public ApiClient setOauthCredentialsForPublicClient(String clientId) {
for (Authentication auth : authentications.values()) {
if (auth instanceof OAuth) {
((OAuth) auth).setCredentialsForPublicClient(clientId, isDebugging());
return this;
}
}
throw new RuntimeException("No OAuth2 authentication configured!");
}
/**
* Helper method to set the password flow for the first OAuth2 authentication.
*

View File

@@ -42,7 +42,7 @@ public class ServerConfiguration {
throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + ".");
}
}
url = url.replaceAll("\\{" + name + "\\}", value);
url = url.replace("{" + name + "}", value);
}
return url;
}

View File

@@ -169,6 +169,19 @@ public class OAuth implements Authentication {
return this;
}
public OAuth setCredentialsForPublicClient(String clientId, Boolean debug) {
if (Boolean.TRUE.equals(debug)) {
service = new ServiceBuilder(clientId)
.apiSecretIsEmptyStringUnsafe().debug()
.build(authApi);
} else {
service = new ServiceBuilder(clientId)
.apiSecretIsEmptyStringUnsafe()
.build(authApi);
}
return this;
}
public OAuth usePasswordFlow(String username, String password) {
this.flow = OAuthFlow.PASSWORD;
this.username = username;