Skip to content

Commit 32765b5

Browse files
shuyckalyx-dbjtreminio-dropbox
authored
Updating openapi generator for java-v1 to 7.12.0 (#480)
Co-authored-by: Monica Auriemma <reta@dropbox.com> Co-authored-by: Juan Treminio <juantreminio@dropbox.com>
1 parent 316c18a commit 32765b5

333 files changed

Lines changed: 6903 additions & 4157 deletions

File tree

Some content is hidden

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

sdks/java-v1/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ Add this dependency to your project's POM:
5555
<dependency>
5656
<groupId>com.dropbox.sign</groupId>
5757
<artifactId>dropbox-sign</artifactId>
58-
<version>1.8-dev</version>
58+
<version>1.8.1-dev</version>
5959
<scope>compile</scope>
6060
</dependency>
6161
```
@@ -71,7 +71,7 @@ Add this dependency to your project's build file:
7171
}
7272
7373
dependencies {
74-
implementation "com.dropbox.sign:dropbox-sign:1.8-dev"
74+
implementation "com.dropbox.sign:dropbox-sign:1.8.1-dev"
7575
}
7676
```
7777

@@ -85,7 +85,7 @@ mvn clean package
8585

8686
Then manually install the following JARs:
8787

88-
- `target/dropbox-sign-1.8-dev.jar`
88+
- `target/dropbox-sign-1.8.1-dev.jar`
8989
- `target/lib/*.jar`
9090

9191
## Getting Started
@@ -476,7 +476,7 @@ apisupport@hellosign.com
476476
This Java package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
477477

478478
- API version: `3.0.0`
479-
- Package version: `1.8-dev`
479+
- Package version: `1.8.1-dev`
480480
- Build package: `org.openapitools.codegen.languages.JavaClientCodegen`
481481

482482

sdks/java-v1/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.8-dev
1+
1.8.1-dev
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
#!/usr/bin/env php
2+
<?php
3+
4+
require_once __DIR__ . '/../vendor/autoload.php';
5+
6+
ini_set('display_errors', 1);
7+
ini_set('display_startup_errors', 1);
8+
error_reporting(E_ALL);
9+
10+
set_error_handler(function ($level, $msg) {
11+
echo "Error: {$msg}";
12+
exit(1);
13+
});
14+
15+
/**
16+
* Between openapi-generator v7.8.0 and v7.12.0 a change was made to the way
17+
* a few generators create constant names from values. The original way was
18+
* actually broken. For example "change-field-visibility" would generate a
19+
* constant name of "TYPE_FIELD_VISIBILITY", dropping the "change" part.
20+
*
21+
* The fix now generates the correct name, "TYPE_CHANGE_FIELD_VISIBILITY".
22+
* However, the fix also gets rid of the previous (incorrect) constant names,
23+
* making the fix a BC break.
24+
*
25+
* This simple script just adds the old constant names back, alongside the new
26+
* ones.
27+
*/
28+
class CopyConstants
29+
{
30+
public function run(): void
31+
{
32+
$file = __DIR__ . '/../src/main/java/com/dropbox/sign/model/SubFormFieldRuleAction.java';
33+
$contents = file_get_contents($file);
34+
35+
$constant_1 = ' CHANGE_FIELD_VISIBILITY(String.valueOf("change-field-visibility")),';
36+
$replace_1 = implode("\n", [
37+
$constant_1,
38+
' FIELD_VISIBILITY(String.valueOf("change-field-visibility")),',
39+
]);
40+
41+
$constant_2 = ' CHANGE_GROUP_VISIBILITY(String.valueOf("change-group-visibility"));';
42+
$replace_2 = implode("\n", [
43+
' CHANGE_GROUP_VISIBILITY(String.valueOf("change-group-visibility")),',
44+
' GROUP_VISIBILITY(String.valueOf("change-group-visibility"));',
45+
]);
46+
47+
$contents = str_replace(
48+
$constant_1,
49+
$replace_1,
50+
$contents,
51+
);
52+
53+
$contents = str_replace(
54+
$constant_2,
55+
$replace_2,
56+
$contents,
57+
);
58+
59+
file_put_contents($file, $contents);
60+
}
61+
}
62+
63+
$copier = new CopyConstants();
64+
$copier->run();

sdks/java-v1/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ apply plugin: 'signing'
2121

2222
group = 'com.dropbox.sign'
2323
archivesBaseName = 'dropbox-sign'
24-
version = '1.8-dev'
24+
version = '1.8.1-dev'
2525
sourceCompatibility = JavaVersion.VERSION_1_8
2626
targetCompatibility = JavaVersion.VERSION_1_8
2727

sdks/java-v1/build.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ lazy val root = (project in file(".")).
22
settings(
33
organization := "com.dropbox.sign",
44
name := "dropbox-sign",
5-
version := "1.8-dev",
5+
version := "1.8.1-dev",
66
scalaVersion := "2.11.4",
77
scalacOptions ++= Seq("-feature"),
88
Compile / javacOptions ++= Seq("-Xlint:deprecation"),

sdks/java-v1/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 | &quot;change-field-visibility&quot; |
23-
| GROUP_VISIBILITY | &quot;change-group-visibility&quot; |
22+
| CHANGE_FIELD_VISIBILITY | &quot;change-field-visibility&quot; |
23+
| CHANGE_GROUP_VISIBILITY | &quot;change-group-visibility&quot; |
2424

2525

2626

sdks/java-v1/gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#target = android
77
GROUP=com.dropbox.sign
88
POM_ARTIFACT_ID=dropbox-sign
9-
VERSION_NAME=1.8-dev
9+
VERSION_NAME=1.8.1-dev
1010

1111
POM_NAME=Dropbox Sign Java SDK
1212
POM_DESCRIPTION=Use the Dropbox Sign Java SDK to connect your Java app to the service of Dropbox Sign in microseconds!

sdks/java-v1/openapi-config.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ additionalProperties:
1616
groupId: com.dropbox.sign
1717
artifactId: dropbox-sign
1818
artifactName: Dropbox Sign Java SDK
19-
artifactVersion: "1.8-dev"
19+
artifactVersion: "1.8.1-dev"
2020
artifactUrl: https://github.com/hellosign/dropbox-sign-java
2121
artifactDescription: Use the Dropbox Sign Java SDK to connect your Java app to the service of Dropbox Sign in microseconds!
2222
scmConnection: scm:git:git://github.com/hellosign/dropbox-sign-java.git
@@ -26,6 +26,7 @@ additionalProperties:
2626
licenseUrl: https://www.opensource.org/licenses/mit-license.php
2727
useCustomTemplateCode: true
2828
licenseCopyrightYear: 2024
29+
failOnUnknownProperties: false
2930
files:
3031
dropbox-EventCallbackHelper.mustache:
3132
templateType: SupportingFiles

sdks/java-v1/pom.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<artifactId>dropbox-sign</artifactId>
66
<packaging>jar</packaging>
77
<name>dropbox-sign</name>
8-
<version>1.8-dev</version>
8+
<version>1.8.1-dev</version>
99
<url>https://github.com/hellosign/dropbox-sign-java</url>
1010
<description>Use the Dropbox Sign Java SDK to connect your Java app to the service of Dropbox Sign in microseconds!</description>
1111
<scm>
@@ -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>
@@ -355,6 +356,7 @@
355356
<jackson-databind-version>2.17.1</jackson-databind-version>
356357
<jackson-databind-nullable-version>0.2.6</jackson-databind-nullable-version>
357358
<jakarta-annotation-version>1.3.5</jakarta-annotation-version>
359+
<beanvalidation-version>2.0.2</beanvalidation-version>
358360
<junit-version>5.10.0</junit-version>
359361
<spotless.version>2.21.0</spotless.version>
360362
<mockito.version>3.12.4</mockito.version>

sdks/java-v1/run-build

Lines changed: 4 additions & 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" \
@@ -47,6 +47,9 @@ docker run --rm \
4747
-w "${WORKING_DIR}" \
4848
perl bash ./bin/scan_for
4949

50+
printf "Adding old-style constant names ...\n"
51+
bash "${DIR}/bin/php" ./bin/copy-constants.php
52+
5053
# avoid docker messing with permissions
5154
if [[ -z "$GITHUB_ACTIONS" ]]; then
5255
chmod 644 "${DIR}/README.md"

0 commit comments

Comments
 (0)