Skip to content

Commit 8aa46e2

Browse files
authored
Merge pull request #189 from xdev-software/develop
Release
2 parents ae5bcb7 + aa8423f commit 8aa46e2

File tree

18 files changed

+142
-223
lines changed

18 files changed

+142
-223
lines changed

.github/workflows/broken-links.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919

2020
- name: Link Checker
2121
id: lychee
22-
uses: lycheeverse/lychee-action@82202e5e9c2f4ef1a55a3d02563e1cb6041e5332 # v2
22+
uses: lycheeverse/lychee-action@5c4ee84814c983aa7164eaee476f014e53ff3963 # v2
2323
with:
2424
fail: false # Don't fail on broken links, create an issue instead
2525

@@ -31,13 +31,13 @@ jobs:
3131
GH_TOKEN: ${{ github.token }}
3232

3333
- name: Close issue if everything is fine
34-
if: env.lychee_exit_code == 0 && steps.find-issue.outputs.number != ''
34+
if: steps.lychee.outputs.exit_code == 0 && steps.find-issue.outputs.number != ''
3535
run: gh issue close -r 'not planned' ${{ steps.find-issue.outputs.number }}
3636
env:
3737
GH_TOKEN: ${{ github.token }}
3838

3939
- name: Create Issue From File
40-
if: env.lychee_exit_code != 0
40+
if: steps.lychee.outputs.exit_code != 0
4141
uses: peter-evans/create-issue-from-file@e8ef132d6df98ed982188e460ebb3b5d4ef3a9cd # v5
4242
with:
4343
issue-number: ${{ steps.find-issue.outputs.number }}

.github/workflows/check-build.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ on:
2020
- 'assets/**'
2121

2222
env:
23-
PRIMARY_MAVEN_MODULE: ${{ github.event.repository.name }}
2423
DEMO_MAVEN_MODULE: ${{ github.event.repository.name }}-demo
2524

2625
jobs:

.github/workflows/release.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,6 @@ jobs:
104104
runs-on: ubuntu-latest
105105
needs: [prepare-release]
106106
timeout-minutes: 60
107-
permissions:
108-
contents: read
109-
packages: write
110107
steps:
111108
- uses: actions/checkout@v4
112109

@@ -121,15 +118,17 @@ jobs:
121118
with: # running setup-java overwrites the settings.xml
122119
distribution: 'temurin'
123120
java-version: '17'
121+
server-id: github-central
122+
server-password: PACKAGES_CENTRAL_TOKEN
124123
gpg-passphrase: MAVEN_GPG_PASSPHRASE
125124
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Only import once
126125

127-
- name: Publish to Central Portal
128-
run: ../mvnw -B deploy -P publish -DskipTests -DaltDeploymentRepository=github::https://maven.pkg.github.com/${{ github.repository }}
126+
- name: Publish to GitHub Packages Central
127+
run: ../mvnw -B deploy -P publish -DskipTests -DaltDeploymentRepository=github-central::https://maven.pkg.github.com/xdev-software/central
128+
working-directory: ${{ env.PRIMARY_MAVEN_MODULE }}
129129
env:
130-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
130+
PACKAGES_CENTRAL_TOKEN: ${{ secrets.PACKAGES_CENTRAL_TOKEN }}
131131
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
132-
working-directory: ${{ env.PRIMARY_MAVEN_MODULE }}
133132

134133
- name: Set up JDK
135134
uses: actions/setup-java@v4

.github/workflows/test-deploy.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ jobs:
1010
publish-maven:
1111
runs-on: ubuntu-latest
1212
timeout-minutes: 60
13-
permissions:
14-
contents: read
15-
packages: write
1613
steps:
1714
- uses: actions/checkout@v4
1815

@@ -21,14 +18,16 @@ jobs:
2118
with: # running setup-java overwrites the settings.xml
2219
distribution: 'temurin'
2320
java-version: '17'
21+
server-id: github-central
22+
server-password: PACKAGES_CENTRAL_TOKEN
2423
gpg-passphrase: MAVEN_GPG_PASSPHRASE
2524
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Only import once
2625

27-
- name: Publish to GitHub Packages
28-
run: ../mvnw -B deploy -P publish -DskipTests -DaltDeploymentRepository=github::https://maven.pkg.github.com/${{ github.repository }}
26+
- name: Publish to GitHub Packages Central
27+
run: ../mvnw -B deploy -P publish -DskipTests -DaltDeploymentRepository=github-central::https://maven.pkg.github.com/xdev-software/central
2928
working-directory: ${{ env.PRIMARY_MAVEN_MODULE }}
3029
env:
31-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30+
PACKAGES_CENTRAL_TOKEN: ${{ secrets.PACKAGES_CENTRAL_TOKEN }}
3231
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
3332

3433
- name: Set up JDK

.idea/checkstyle-idea.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# 1.1.1
2+
* Fixed some incorrectly generated classes for ``additionalProperties: oneOf: ...`` #181
3+
14
# 1.1.0
25
* Updated generated code from Brevo's openapi.yml
36
* Updated references to "new" official Brevo client #

brevo-java-client-demo/src/main/java/software/xdev/Application.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import org.slf4j.Logger;
1010
import org.slf4j.LoggerFactory;
1111

12+
import software.xdev.brevo.IdentifierType;
1213
import software.xdev.brevo.api.ContactsApi;
1314
import software.xdev.brevo.client.ApiClient;
1415
import software.xdev.brevo.client.ApiException;
@@ -42,7 +43,7 @@ public static void main(final String[] args)
4243
new GetContactInfoIdentifierStringParameter(email);
4344
final GetExtendedContactDetails contactInfo = contactsApi.getContactInfo(
4445
identifier,
45-
null,
46+
IdentifierType.EMAIL,
4647
null,
4748
null);
4849
LOG.info("Got contact[email={},listIds={}]", contactInfo.getEmail(), contactInfo.getListIds());
@@ -51,7 +52,7 @@ public static void main(final String[] args)
5152
contactsApi.updateContact(
5253
identifier,
5354
new UpdateContact().listIds(List.of(listId)),
54-
null);
55+
IdentifierType.EMAIL);
5556
LOG.info("Updated contact to include listId={}", listId);
5657
}
5758
}

brevo-java-client/pom.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
<dependency>
6262
<groupId>com.fasterxml.jackson</groupId>
6363
<artifactId>jackson-bom</artifactId>
64-
<version>2.19.1</version>
64+
<version>2.19.2</version>
6565
<type>pom</type>
6666
<scope>import</scope>
6767
</dependency>
@@ -223,7 +223,7 @@
223223
<plugin>
224224
<groupId>org.codehaus.mojo</groupId>
225225
<artifactId>flatten-maven-plugin</artifactId>
226-
<version>1.7.1</version>
226+
<version>1.7.2</version>
227227
<configuration>
228228
<flattenMode>ossrh</flattenMode>
229229
</configuration>
@@ -449,7 +449,7 @@
449449
<dependency>
450450
<groupId>com.puppycrawl.tools</groupId>
451451
<artifactId>checkstyle</artifactId>
452-
<version>10.26.1</version>
452+
<version>11.0.0</version>
453453
</dependency>
454454
</dependencies>
455455
<configuration>
@@ -490,12 +490,12 @@
490490
<dependency>
491491
<groupId>net.sourceforge.pmd</groupId>
492492
<artifactId>pmd-core</artifactId>
493-
<version>7.15.0</version>
493+
<version>7.16.0</version>
494494
</dependency>
495495
<dependency>
496496
<groupId>net.sourceforge.pmd</groupId>
497497
<artifactId>pmd-java</artifactId>
498-
<version>7.15.0</version>
498+
<version>7.16.0</version>
499499
</dependency>
500500
</dependencies>
501501
</plugin>

brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateContact.java

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import java.util.HashMap;
2626
import java.util.List;
2727
import java.util.Map;
28-
import software.xdev.brevo.model.CreateDoiContactAttributesValue;
2928
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
3029
import com.fasterxml.jackson.annotation.JsonTypeName;
3130
import java.io.UnsupportedEncodingException;
@@ -57,7 +56,7 @@ public class CreateContact {
5756

5857
public static final String JSON_PROPERTY_ATTRIBUTES = "attributes";
5958
@jakarta.annotation.Nullable
60-
private Map<String, CreateDoiContactAttributesValue> attributes = new HashMap<>();
59+
private Map<String, Object> attributes = new HashMap<>();
6160

6261
public static final String JSON_PROPERTY_EMAIL_BLACKLISTED = "emailBlacklisted";
6362
@jakarta.annotation.Nullable
@@ -132,13 +131,13 @@ public void setExtId(@jakarta.annotation.Nullable String extId) {
132131
this.extId = extId;
133132
}
134133

135-
public CreateContact attributes(@jakarta.annotation.Nullable Map<String, CreateDoiContactAttributesValue> attributes) {
134+
public CreateContact attributes(@jakarta.annotation.Nullable Map<String, Object> attributes) {
136135

137136
this.attributes = attributes;
138137
return this;
139138
}
140139

141-
public CreateContact putAttributesItem(String key, CreateDoiContactAttributesValue attributesItem) {
140+
public CreateContact putAttributesItem(String key, Object attributesItem) {
142141
if (this.attributes == null) {
143142
this.attributes = new HashMap<>();
144143
}
@@ -152,16 +151,16 @@ public CreateContact putAttributesItem(String key, CreateDoiContactAttributesVal
152151
*/
153152
@jakarta.annotation.Nullable
154153
@JsonProperty(JSON_PROPERTY_ATTRIBUTES)
155-
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
154+
@JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS)
156155

157-
public Map<String, CreateDoiContactAttributesValue> getAttributes() {
156+
public Map<String, Object> getAttributes() {
158157
return attributes;
159158
}
160159

161160

162161
@JsonProperty(JSON_PROPERTY_ATTRIBUTES)
163-
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
164-
public void setAttributes(@jakarta.annotation.Nullable Map<String, CreateDoiContactAttributesValue> attributes) {
162+
@JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS)
163+
public void setAttributes(@jakarta.annotation.Nullable Map<String, Object> attributes) {
165164
this.attributes = attributes;
166165
}
167166

@@ -412,9 +411,13 @@ public String toUrlQueryString(String prefix) {
412411
// add `attributes` to the URL query string
413412
if (getAttributes() != null) {
414413
for (String _key : getAttributes().keySet()) {
415-
if (getAttributes().get(_key) != null) {
416-
joiner.add(getAttributes().get(_key).toUrlQueryString(String.format("%sattributes%s%s", prefix, suffix,
417-
"".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix))));
414+
try {
415+
joiner.add(String.format("%sattributes%s%s=%s", prefix, suffix,
416+
"".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix),
417+
getAttributes().get(_key), URLEncoder.encode(String.valueOf(getAttributes().get(_key)), "UTF-8").replaceAll("\\+", "%20")));
418+
} catch (UnsupportedEncodingException e) {
419+
// Should never happen, UTF-8 is always supported
420+
throw new RuntimeException(e);
418421
}
419422
}
420423
}

brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateDoiContact.java

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import java.util.HashMap;
2626
import java.util.List;
2727
import java.util.Map;
28-
import software.xdev.brevo.model.CreateDoiContactAttributesValue;
2928
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
3029
import com.fasterxml.jackson.annotation.JsonTypeName;
3130
import java.io.UnsupportedEncodingException;
@@ -51,7 +50,7 @@ public class CreateDoiContact {
5150

5251
public static final String JSON_PROPERTY_ATTRIBUTES = "attributes";
5352
@jakarta.annotation.Nullable
54-
private Map<String, CreateDoiContactAttributesValue> attributes = new HashMap<>();
53+
private Map<String, Object> attributes = new HashMap<>();
5554

5655
public static final String JSON_PROPERTY_INCLUDE_LIST_IDS = "includeListIds";
5756
@jakarta.annotation.Nonnull
@@ -97,13 +96,13 @@ public void setEmail(@jakarta.annotation.Nonnull String email) {
9796
this.email = email;
9897
}
9998

100-
public CreateDoiContact attributes(@jakarta.annotation.Nullable Map<String, CreateDoiContactAttributesValue> attributes) {
99+
public CreateDoiContact attributes(@jakarta.annotation.Nullable Map<String, Object> attributes) {
101100

102101
this.attributes = attributes;
103102
return this;
104103
}
105104

106-
public CreateDoiContact putAttributesItem(String key, CreateDoiContactAttributesValue attributesItem) {
105+
public CreateDoiContact putAttributesItem(String key, Object attributesItem) {
107106
if (this.attributes == null) {
108107
this.attributes = new HashMap<>();
109108
}
@@ -117,16 +116,16 @@ public CreateDoiContact putAttributesItem(String key, CreateDoiContactAttributes
117116
*/
118117
@jakarta.annotation.Nullable
119118
@JsonProperty(JSON_PROPERTY_ATTRIBUTES)
120-
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
119+
@JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS)
121120

122-
public Map<String, CreateDoiContactAttributesValue> getAttributes() {
121+
public Map<String, Object> getAttributes() {
123122
return attributes;
124123
}
125124

126125

127126
@JsonProperty(JSON_PROPERTY_ATTRIBUTES)
128-
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
129-
public void setAttributes(@jakarta.annotation.Nullable Map<String, CreateDoiContactAttributesValue> attributes) {
127+
@JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS)
128+
public void setAttributes(@jakarta.annotation.Nullable Map<String, Object> attributes) {
130129
this.attributes = attributes;
131130
}
132131

@@ -338,9 +337,13 @@ public String toUrlQueryString(String prefix) {
338337
// add `attributes` to the URL query string
339338
if (getAttributes() != null) {
340339
for (String _key : getAttributes().keySet()) {
341-
if (getAttributes().get(_key) != null) {
342-
joiner.add(getAttributes().get(_key).toUrlQueryString(String.format("%sattributes%s%s", prefix, suffix,
343-
"".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix))));
340+
try {
341+
joiner.add(String.format("%sattributes%s%s=%s", prefix, suffix,
342+
"".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix),
343+
getAttributes().get(_key), URLEncoder.encode(String.valueOf(getAttributes().get(_key)), "UTF-8").replaceAll("\\+", "%20")));
344+
} catch (UnsupportedEncodingException e) {
345+
// Should never happen, UTF-8 is always supported
346+
throw new RuntimeException(e);
344347
}
345348
}
346349
}

0 commit comments

Comments
 (0)