Skip to content

Commit

Permalink
Merge pull request #760 from commercetools/SUPPORT-29621-jackson-2-18…
Browse files Browse the repository at this point in the history
…-fix

[SUPPORT-29621] fix regression with jackson 2.18.x
  • Loading branch information
jenschude authored Nov 20, 2024
2 parents b98089c + e7f2827 commit b8a9fcf
Show file tree
Hide file tree
Showing 22 changed files with 100 additions and 79 deletions.
5 changes: 5 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,11 @@ subprojects { project ->
languageVersion = JavaLanguageVersion.of(17)
}
}
compileIntegrationTestJava {
javaCompiler = javaToolchains.compilerFor {
languageVersion = JavaLanguageVersion.of(17)
}
}
compileTestJava {
javaCompiler = javaToolchains.compilerFor {
languageVersion = JavaLanguageVersion.of(17)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import java.time.*;
import java.util.*;

import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.*;
Expand All @@ -23,7 +24,7 @@ public class LocalizedStringImpl implements LocalizedString, ModelBase {
private Map<String, String> values;

@JsonCreator
LocalizedStringImpl(@JsonProperty("values") final Map<String, String> values) {
LocalizedStringImpl(@JsonAnySetter @JsonProperty("values") final Map<String, String> values) {
this.values = values;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

package com.commercetools;

import static com.commercetools.TestUtils.stringFromResource;
import static java.lang.String.format;
import static java.util.Arrays.asList;
import static java.util.Collections.singletonList;
Expand All @@ -12,6 +13,7 @@

import com.commercetools.api.models.common.LocalizedString;
import com.commercetools.api.models.common.LocalizedStringEntry;
import com.commercetools.api.models.product.ProductData;

import io.vrap.rmf.base.client.utils.json.JsonUtils;

Expand Down Expand Up @@ -370,4 +372,12 @@ public void ofStringToStringMap() {
.plus(Locale.ITALIAN, "Giacche");
assertThat(actual).isEqualTo(expected);
}

public static final String DEFAULT_LOCALE = "en-US";

@Test
public void getLocale() {
ProductData p = JsonUtils.fromJsonString(stringFromResource("product-data.json"), ProductData.class);
assertThat(p.getName().get(DEFAULT_LOCALE)).isEqualTo("Hoodie");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": {
"en-US": "Hoodie"
}
}
8 changes: 4 additions & 4 deletions gradle-scripts/extensions.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ ext {
]

jackson_core = [
annotations: 'com.fasterxml.jackson.core:jackson-annotations:2.17.1',
databind: 'com.fasterxml.jackson.core:jackson-databind:2.17.1',
core: 'com.fasterxml.jackson.core:jackson-core:2.17.1',
datatype: 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.17.1',
annotations: 'com.fasterxml.jackson.core:jackson-annotations:2.18.1',
databind: 'com.fasterxml.jackson.core:jackson-databind:2.18.1',
core: 'com.fasterxml.jackson.core:jackson-core:2.18.1',
datatype: 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.18.1',
]

google = [
Expand Down
8 changes: 4 additions & 4 deletions licenses/commercetools-apachehttp-client/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"dependencies": [
{
"moduleName": "com.fasterxml.jackson.core:jackson-annotations",
"moduleVersion": "2.17.1",
"moduleVersion": "2.18.1",
"moduleUrls": [
"https://github.com/FasterXML/jackson"
],
Expand All @@ -15,7 +15,7 @@
},
{
"moduleName": "com.fasterxml.jackson.core:jackson-core",
"moduleVersion": "2.17.1",
"moduleVersion": "2.18.1",
"moduleUrls": [
"https://github.com/FasterXML/jackson-core"
],
Expand All @@ -28,7 +28,7 @@
},
{
"moduleName": "com.fasterxml.jackson.core:jackson-databind",
"moduleVersion": "2.17.1",
"moduleVersion": "2.18.1",
"moduleUrls": [
"https://github.com/FasterXML/jackson"
],
Expand All @@ -41,7 +41,7 @@
},
{
"moduleName": "com.fasterxml.jackson.datatype:jackson-datatype-jsr310",
"moduleVersion": "2.17.1",
"moduleVersion": "2.18.1",
"moduleUrls": [
"https://github.com/FasterXML/jackson-modules-java8/jackson-datatype-jsr310"
],
Expand Down
8 changes: 4 additions & 4 deletions licenses/commercetools-async-http-client/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"dependencies": [
{
"moduleName": "com.fasterxml.jackson.core:jackson-annotations",
"moduleVersion": "2.17.1",
"moduleVersion": "2.18.1",
"moduleUrls": [
"https://github.com/FasterXML/jackson"
],
Expand All @@ -15,7 +15,7 @@
},
{
"moduleName": "com.fasterxml.jackson.core:jackson-core",
"moduleVersion": "2.17.1",
"moduleVersion": "2.18.1",
"moduleUrls": [
"https://github.com/FasterXML/jackson-core"
],
Expand All @@ -28,7 +28,7 @@
},
{
"moduleName": "com.fasterxml.jackson.core:jackson-databind",
"moduleVersion": "2.17.1",
"moduleVersion": "2.18.1",
"moduleUrls": [
"https://github.com/FasterXML/jackson"
],
Expand All @@ -41,7 +41,7 @@
},
{
"moduleName": "com.fasterxml.jackson.datatype:jackson-datatype-jsr310",
"moduleVersion": "2.17.1",
"moduleVersion": "2.18.1",
"moduleUrls": [
"https://github.com/FasterXML/jackson-modules-java8/jackson-datatype-jsr310"
],
Expand Down
8 changes: 4 additions & 4 deletions licenses/commercetools-graphql-api/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"dependencies": [
{
"moduleName": "com.fasterxml.jackson.core:jackson-annotations",
"moduleVersion": "2.17.1",
"moduleVersion": "2.18.1",
"moduleUrls": [
"https://github.com/FasterXML/jackson"
],
Expand All @@ -15,7 +15,7 @@
},
{
"moduleName": "com.fasterxml.jackson.core:jackson-core",
"moduleVersion": "2.17.1",
"moduleVersion": "2.18.1",
"moduleUrls": [
"https://github.com/FasterXML/jackson-core"
],
Expand All @@ -28,7 +28,7 @@
},
{
"moduleName": "com.fasterxml.jackson.core:jackson-databind",
"moduleVersion": "2.17.1",
"moduleVersion": "2.18.1",
"moduleUrls": [
"https://github.com/FasterXML/jackson"
],
Expand All @@ -41,7 +41,7 @@
},
{
"moduleName": "com.fasterxml.jackson.datatype:jackson-datatype-jsr310",
"moduleVersion": "2.17.1",
"moduleVersion": "2.18.1",
"moduleUrls": [
"https://github.com/FasterXML/jackson-modules-java8/jackson-datatype-jsr310"
],
Expand Down
8 changes: 4 additions & 4 deletions licenses/commercetools-http-client/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"dependencies": [
{
"moduleName": "com.fasterxml.jackson.core:jackson-annotations",
"moduleVersion": "2.17.1",
"moduleVersion": "2.18.1",
"moduleUrls": [
"https://github.com/FasterXML/jackson"
],
Expand All @@ -15,7 +15,7 @@
},
{
"moduleName": "com.fasterxml.jackson.core:jackson-core",
"moduleVersion": "2.17.1",
"moduleVersion": "2.18.1",
"moduleUrls": [
"https://github.com/FasterXML/jackson-core"
],
Expand All @@ -28,7 +28,7 @@
},
{
"moduleName": "com.fasterxml.jackson.core:jackson-databind",
"moduleVersion": "2.17.1",
"moduleVersion": "2.18.1",
"moduleUrls": [
"https://github.com/FasterXML/jackson"
],
Expand All @@ -41,7 +41,7 @@
},
{
"moduleName": "com.fasterxml.jackson.datatype:jackson-datatype-jsr310",
"moduleVersion": "2.17.1",
"moduleVersion": "2.18.1",
"moduleUrls": [
"https://github.com/FasterXML/jackson-modules-java8/jackson-datatype-jsr310"
],
Expand Down
8 changes: 4 additions & 4 deletions licenses/commercetools-javanet-client/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"dependencies": [
{
"moduleName": "com.fasterxml.jackson.core:jackson-annotations",
"moduleVersion": "2.17.1",
"moduleVersion": "2.18.1",
"moduleUrls": [
"https://github.com/FasterXML/jackson"
],
Expand All @@ -15,7 +15,7 @@
},
{
"moduleName": "com.fasterxml.jackson.core:jackson-core",
"moduleVersion": "2.17.1",
"moduleVersion": "2.18.1",
"moduleUrls": [
"https://github.com/FasterXML/jackson-core"
],
Expand All @@ -28,7 +28,7 @@
},
{
"moduleName": "com.fasterxml.jackson.core:jackson-databind",
"moduleVersion": "2.17.1",
"moduleVersion": "2.18.1",
"moduleUrls": [
"https://github.com/FasterXML/jackson"
],
Expand All @@ -41,7 +41,7 @@
},
{
"moduleName": "com.fasterxml.jackson.datatype:jackson-datatype-jsr310",
"moduleVersion": "2.17.1",
"moduleVersion": "2.18.1",
"moduleUrls": [
"https://github.com/FasterXML/jackson-modules-java8/jackson-datatype-jsr310"
],
Expand Down
10 changes: 5 additions & 5 deletions licenses/commercetools-monitoring-datadog/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
},
{
"moduleName": "com.fasterxml.jackson.core:jackson-annotations",
"moduleVersion": "2.17.1",
"moduleVersion": "2.18.1",
"moduleUrls": [
"https://github.com/FasterXML/jackson"
],
Expand All @@ -45,7 +45,7 @@
},
{
"moduleName": "com.fasterxml.jackson.core:jackson-core",
"moduleVersion": "2.17.1",
"moduleVersion": "2.18.1",
"moduleUrls": [
"https://github.com/FasterXML/jackson-core"
],
Expand All @@ -58,7 +58,7 @@
},
{
"moduleName": "com.fasterxml.jackson.core:jackson-databind",
"moduleVersion": "2.17.1",
"moduleVersion": "2.18.1",
"moduleUrls": [
"https://github.com/FasterXML/jackson"
],
Expand All @@ -71,7 +71,7 @@
},
{
"moduleName": "com.fasterxml.jackson.datatype:jackson-datatype-jsr310",
"moduleVersion": "2.17.1",
"moduleVersion": "2.18.1",
"moduleUrls": [
"https://github.com/FasterXML/jackson-modules-java8/jackson-datatype-jsr310"
],
Expand All @@ -84,7 +84,7 @@
},
{
"moduleName": "com.fasterxml.jackson.module:jackson-module-jakarta-xmlbind-annotations",
"moduleVersion": "2.17.1",
"moduleVersion": "2.18.1",
"moduleUrls": [
"https://github.com/FasterXML/jackson-modules-base"
],
Expand Down
8 changes: 4 additions & 4 deletions licenses/commercetools-monitoring-newrelic/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"dependencies": [
{
"moduleName": "com.fasterxml.jackson.core:jackson-annotations",
"moduleVersion": "2.17.1",
"moduleVersion": "2.18.1",
"moduleUrls": [
"https://github.com/FasterXML/jackson"
],
Expand All @@ -15,7 +15,7 @@
},
{
"moduleName": "com.fasterxml.jackson.core:jackson-core",
"moduleVersion": "2.17.1",
"moduleVersion": "2.18.1",
"moduleUrls": [
"https://github.com/FasterXML/jackson-core"
],
Expand All @@ -28,7 +28,7 @@
},
{
"moduleName": "com.fasterxml.jackson.core:jackson-databind",
"moduleVersion": "2.17.1",
"moduleVersion": "2.18.1",
"moduleUrls": [
"https://github.com/FasterXML/jackson"
],
Expand All @@ -41,7 +41,7 @@
},
{
"moduleName": "com.fasterxml.jackson.datatype:jackson-datatype-jsr310",
"moduleVersion": "2.17.1",
"moduleVersion": "2.18.1",
"moduleUrls": [
"https://github.com/FasterXML/jackson-modules-java8/jackson-datatype-jsr310"
],
Expand Down
8 changes: 4 additions & 4 deletions licenses/commercetools-monitoring-opentelemetry/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"dependencies": [
{
"moduleName": "com.fasterxml.jackson.core:jackson-annotations",
"moduleVersion": "2.17.1",
"moduleVersion": "2.18.1",
"moduleUrls": [
"https://github.com/FasterXML/jackson"
],
Expand All @@ -15,7 +15,7 @@
},
{
"moduleName": "com.fasterxml.jackson.core:jackson-core",
"moduleVersion": "2.17.1",
"moduleVersion": "2.18.1",
"moduleUrls": [
"https://github.com/FasterXML/jackson-core"
],
Expand All @@ -28,7 +28,7 @@
},
{
"moduleName": "com.fasterxml.jackson.core:jackson-databind",
"moduleVersion": "2.17.1",
"moduleVersion": "2.18.1",
"moduleUrls": [
"https://github.com/FasterXML/jackson"
],
Expand All @@ -41,7 +41,7 @@
},
{
"moduleName": "com.fasterxml.jackson.datatype:jackson-datatype-jsr310",
"moduleVersion": "2.17.1",
"moduleVersion": "2.18.1",
"moduleUrls": [
"https://github.com/FasterXML/jackson-modules-java8/jackson-datatype-jsr310"
],
Expand Down
Loading

0 comments on commit b8a9fcf

Please sign in to comment.