Skip to content

Commit c4c2768

Browse files
committed
Updating openapi-generator to 7.12.0
1 parent a8ae868 commit c4c2768

File tree

329 files changed

+6253
-2933
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

329 files changed

+6253
-2933
lines changed

sdks/java-v2/docs/SubFormFieldRuleAction.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919

2020
| Name | Value |
2121
---- | -----
22-
| FIELD_VISIBILITY | "change-field-visibility" |
23-
| GROUP_VISIBILITY | "change-group-visibility" |
22+
| CHANGE_FIELD_VISIBILITY | "change-field-visibility" |
23+
| CHANGE_GROUP_VISIBILITY | "change-group-visibility" |
2424

2525

2626

sdks/java-v2/openapi-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ additionalProperties:
1818
groupId: com.dropbox.sign
1919
artifactId: dropbox-sign
2020
artifactName: Dropbox Sign Java SDK
21-
artifactVersion: "2.4-dev"
21+
artifactVersion: "2.4.1-dev"
2222
artifactUrl: https://github.com/hellosign/dropbox-sign-java
2323
artifactDescription: Use the Dropbox Sign Java SDK to connect your Java app to the service of Dropbox Sign in microseconds!
2424
scmConnection: scm:git:git://github.com/hellosign/dropbox-sign-java.git

sdks/java-v2/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,7 @@
334334
<artifactId>jersey-apache-connector</artifactId>
335335
<version>${jersey-version}</version>
336336
</dependency>
337+
337338
<!-- test dependencies -->
338339
<dependency>
339340
<groupId>org.junit.jupiter</groupId>

sdks/java-v2/run-build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ rm -f "${DIR}/src/main/java/com/dropbox/sign/model/"*.java
1818

1919
docker run --rm \
2020
-v "${DIR}/:/local" \
21-
openapitools/openapi-generator-cli:v7.8.0 generate \
21+
openapitools/openapi-generator-cli:v7.12.0 generate \
2222
-i "/local/openapi-sdk.yaml" \
2323
-c "/local/openapi-config.yaml" \
2424
-t "/local/templates" \

sdks/java-v2/src/main/java/com/dropbox/sign/ApiClient.java

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
/**
8585
* <p>ApiClient class.</p>
8686
*/
87-
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0")
87+
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0")
8888
public class ApiClient extends JavaTimeFormatter {
8989
private static final Pattern JSON_MIME_PATTERN = Pattern.compile("(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$");
9090

@@ -853,6 +853,36 @@ public Entity<?> serialize(Object obj, Map<String, Object> formParams, String co
853853
return entity;
854854
}
855855

856+
/**
857+
* Adds the object with the provided key to the MultiPart.
858+
* Based on the object type sets Content-Disposition and Content-Type.
859+
*
860+
* @param obj Object
861+
* @param key Key of the object
862+
* @param multiPart MultiPart to add the form param to
863+
*/
864+
private void addParamToMultipart(Object value, String key, MultiPart multiPart) {
865+
if (value instanceof File) {
866+
File file = (File) value;
867+
FormDataContentDisposition contentDisp = FormDataContentDisposition.name(key)
868+
.fileName(file.getName()).size(file.length()).build();
869+
870+
// Attempt to probe the content type for the file so that the form part is more correctly
871+
// and precisely identified, but fall back to application/octet-stream if that fails.
872+
MediaType type;
873+
try {
874+
type = MediaType.valueOf(Files.probeContentType(file.toPath()));
875+
} catch (IOException | IllegalArgumentException e) {
876+
type = MediaType.APPLICATION_OCTET_STREAM_TYPE;
877+
}
878+
879+
multiPart.bodyPart(new FormDataBodyPart(contentDisp, file, type));
880+
} else {
881+
FormDataContentDisposition contentDisp = FormDataContentDisposition.name(key).build();
882+
multiPart.bodyPart(new FormDataBodyPart(contentDisp, parameterToString(value)));
883+
}
884+
}
885+
856886
/**
857887
* Serialize the given Java object into string according the given
858888
* Content-Type (only JSON, HTTP form is supported for now).
@@ -1143,7 +1173,11 @@ private Response sendRequest(String method, Invocation.Builder invocationBuilder
11431173
} else if ("PUT".equals(method)) {
11441174
response = invocationBuilder.put(entity);
11451175
} else if ("DELETE".equals(method)) {
1176+
if ("".equals(entity.getEntity())) {
1177+
response = invocationBuilder.method("DELETE");
1178+
} else {
11461179
response = invocationBuilder.method("DELETE", entity);
1180+
}
11471181
} else if ("PATCH".equals(method)) {
11481182
response = invocationBuilder.method("PATCH", entity);
11491183
} else {

sdks/java-v2/src/main/java/com/dropbox/sign/ApiException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
/**
2121
* API Exception
2222
*/
23-
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0")
23+
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0")
2424
public class ApiException extends Exception {
2525
private static final long serialVersionUID = 1L;
2626

sdks/java-v2/src/main/java/com/dropbox/sign/Configuration.java

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,29 +13,51 @@
1313

1414
package com.dropbox.sign;
1515

16-
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0")
16+
import java.util.Objects;
17+
import java.util.concurrent.atomic.AtomicReference;
18+
import java.util.function.Supplier;
19+
20+
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0")
1721
public class Configuration {
1822
public static final String VERSION = "2.4-dev";
1923

20-
private static ApiClient defaultApiClient = new ApiClient();
24+
private static final AtomicReference<ApiClient> defaultApiClient = new AtomicReference<>();
25+
private static volatile Supplier<ApiClient> apiClientFactory = ApiClient::new;
2126

2227
/**
23-
* Get the default API client, which would be used when creating API
24-
* instances without providing an API client.
28+
* Get the default API client, which would be used when creating API instances without providing an API client.
2529
*
2630
* @return Default API client
2731
*/
2832
public static ApiClient getDefaultApiClient() {
29-
return defaultApiClient;
33+
ApiClient client = defaultApiClient.get();
34+
if (client == null) {
35+
client = defaultApiClient.updateAndGet(val -> {
36+
if (val != null) { // changed by another thread
37+
return val;
38+
}
39+
return apiClientFactory.get();
40+
});
41+
}
42+
return client;
3043
}
3144

3245
/**
33-
* Set the default API client, which would be used when creating API
34-
* instances without providing an API client.
46+
* Set the default API client, which would be used when creating API instances without providing an API client.
3547
*
3648
* @param apiClient API client
3749
*/
3850
public static void setDefaultApiClient(ApiClient apiClient) {
39-
defaultApiClient = apiClient;
51+
defaultApiClient.set(apiClient);
52+
}
53+
54+
/**
55+
* set the callback used to create new ApiClient objects
56+
*/
57+
public static void setApiClientFactory(Supplier<ApiClient> factory) {
58+
apiClientFactory = Objects.requireNonNull(factory);
4059
}
60+
61+
private Configuration() {
62+
}
4163
}

sdks/java-v2/src/main/java/com/dropbox/sign/EventCallbackHelper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import org.apache.commons.codec.digest.HmacAlgorithms;
1919
import org.apache.commons.codec.digest.HmacUtils;
2020

21-
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0")
21+
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0")
2222
public class EventCallbackHelper {
2323
public static final String EVENT_TYPE_ACCOUNT_CALLBACK = "account_callback";
2424

sdks/java-v2/src/main/java/com/dropbox/sign/JSON.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
import jakarta.ws.rs.core.GenericType;
2828
import jakarta.ws.rs.ext.ContextResolver;
2929

30-
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0")
30+
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0")
3131
public class JSON implements ContextResolver<ObjectMapper> {
3232
private ObjectMapper mapper;
3333

sdks/java-v2/src/main/java/com/dropbox/sign/JavaTimeFormatter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
* Class that add parsing/formatting support for Java 8+ {@code OffsetDateTime} class.
2121
* It's generated for java clients when {@code AbstractJavaCodegen#dateLibrary} specified as {@code java8}.
2222
*/
23-
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0")
23+
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0")
2424
public class JavaTimeFormatter {
2525

2626
private DateTimeFormatter offsetDateTimeFormatter = DateTimeFormatter.ISO_OFFSET_DATE_TIME;

0 commit comments

Comments
 (0)