Skip to content

Commit

Permalink
Fix wrong json object mapper configuration (#1139)
Browse files Browse the repository at this point in the history
* Fix wrong json object mapper configuration

* Release v10.0.4
  • Loading branch information
lojzatran authored Jan 9, 2024
1 parent 8438e3e commit fbded7b
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 18 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# commercetools sync java
[![CI](https://github.com/commercetools/commercetools-sync-java/workflows/CI/badge.svg)](https://github.com/commercetools/commercetools-sync-java/actions?query=workflow%3ACI)
[![codecov](https://codecov.io/gh/commercetools/commercetools-sync-java/branch/master/graph/badge.svg)](https://codecov.io/gh/commercetools/commercetools-sync-java)
[![Javadoc](https://javadoc.io/badge2/com.commercetools/commercetools-sync-java/javadoc.svg?label=Javadoc)](https://commercetools.github.io/commercetools-sync-java/v/10.0.3/)
[![Javadoc](https://javadoc.io/badge2/com.commercetools/commercetools-sync-java/javadoc.svg?label=Javadoc)](https://commercetools.github.io/commercetools-sync-java/v/10.0.4/)
[![Known Vulnerabilities](https://snyk.io/test/github/commercetools/commercetools-sync-java/4b2e26113d591bda158217c5dc1cf80a88665646/badge.svg)](https://snyk.io/test/github/commercetools/commercetools-sync-java/4b2e26113d591bda158217c5dc1cf80a88665646)


Expand Down Expand Up @@ -60,26 +60,26 @@ Here are the most popular ones:
<dependency>
<groupId>com.commercetools</groupId>
<artifactId>commercetools-sync-java</artifactId>
<version>10.0.3</version>
<version>10.0.4</version>
</dependency>
````

#### Gradle

````groovy
implementation 'com.commercetools:commercetools-sync-java:10.0.3'
implementation 'com.commercetools:commercetools-sync-java:10.0.4'
````

#### SBT

````
libraryDependencies += "com.commercetools" % "commercetools-sync-java" % "10.0.3"
libraryDependencies += "com.commercetools" % "commercetools-sync-java" % "10.0.4"
````

#### Ivy

````xml
<dependency org="com.commercetools" name="commercetools-sync-java" rev="10.0.3"/>
<dependency org="com.commercetools" name="commercetools-sync-java" rev="10.0.4"/>
````

**Note**: To avoid `commercetools JVM SDK` libraries version mismatch between projects.
Expand Down
14 changes: 7 additions & 7 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
# commercetools sync
[![CI](https://github.com/commercetools/commercetools-sync-java/workflows/CI/badge.svg)](https://github.com/commercetools/commercetools-sync-java/actions?query=workflow%3ACI)
[![codecov](https://codecov.io/gh/commercetools/commercetools-sync-java/branch/master/graph/badge.svg)](https://codecov.io/gh/commercetools/commercetools-sync-java)
[![Benchmarks 10.0.3](https://img.shields.io/badge/Benchmarks-10.0.3-orange.svg)](https://commercetools.github.io/commercetools-sync-java/benchmarks/)
[![Download from Maven Central](https://img.shields.io/badge/Maven_Central-10.0.3-blue.svg)](https://search.maven.org/artifact/com.commercetools/commercetools-sync-java/10.0.3/jar)
[![Javadoc](https://javadoc.io/badge2/com.commercetools/commercetools-sync-java/javadoc.svg?label=Javadoc)](https://commercetools.github.io/commercetools-sync-java/v/10.0.3/)
[![Benchmarks 10.0.4](https://img.shields.io/badge/Benchmarks-10.0.4-orange.svg)](https://commercetools.github.io/commercetools-sync-java/benchmarks/)
[![Download from Maven Central](https://img.shields.io/badge/Maven_Central-10.0.4-blue.svg)](https://search.maven.org/artifact/com.commercetools/commercetools-sync-java/10.0.4/jar)
[![Javadoc](https://javadoc.io/badge2/com.commercetools/commercetools-sync-java/javadoc.svg?label=Javadoc)](https://commercetools.github.io/commercetools-sync-java/v/10.0.4/)
[![Known Vulnerabilities](https://snyk.io/test/github/commercetools/commercetools-sync-java/4b2e26113d591bda158217c5dc1cf80a88665646/badge.svg)](https://snyk.io/test/github/commercetools/commercetools-sync-java/4b2e26113d591bda158217c5dc1cf80a88665646)


Expand Down Expand Up @@ -40,18 +40,18 @@ Here are the most popular ones:
<dependency>
<groupId>com.commercetools</groupId>
<artifactId>commercetools-sync-java</artifactId>
<version>10.0.3</version>
<version>10.0.4</version>
</dependency>
````
#### Gradle
````groovy
implementation 'com.commercetools:commercetools-sync-java:10.0.3'
implementation 'com.commercetools:commercetools-sync-java:10.0.4'
````
#### SBT
````
libraryDependencies += "com.commercetools" % "commercetools-sync-java" % "10.0.3"
libraryDependencies += "com.commercetools" % "commercetools-sync-java" % "10.0.4"
````
#### Ivy
````xml
<dependency org="com.commercetools" name="commercetools-sync-java" rev="10.0.3"/>
<dependency org="com.commercetools" name="commercetools-sync-java" rev="10.0.4"/>
````
7 changes: 7 additions & 0 deletions docs/RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@
7. Add Migration guide section which specifies explicitly if there are breaking changes and how to tackle them.
-->

### 10.0.4 - Jan 9, 2024
[Commits](https://github.com/commercetools/commercetools-sync-java/compare/10.0.3...10.0.4) |
[Javadoc](https://commercetools.github.io/commercetools-sync-java/v/10.0.4/) |
[Jar](https://search.maven.org/artifact/com.commercetools/commercetools-sync-java/10.0.4/jar)
- 🐞 **Bug Fixes** (1)
- Fix getting a wrong JSON Object mapper (https://github.com/commercetools/commercetools-sync-java/issues/1138)

### 10.0.3 - Dec 21, 2023
[Commits](https://github.com/commercetools/commercetools-sync-java/compare/10.0.2...10.0.3) |
[Javadoc](https://commercetools.github.io/commercetools-sync-java/v/10.0.3/) |
Expand Down
4 changes: 2 additions & 2 deletions docs/usage/QUICK_START.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
<dependency>
<groupId>com.commercetools</groupId>
<artifactId>commercetools-sync-java</artifactId>
<version>10.0.3</version>
<version>10.0.4</version>
</dependency>
````
- For Gradle users:
````groovy
// Add commercetools-sync-java dependency.
implementation 'com.commercetools:commercetools-sync-java:10.0.3'
implementation 'com.commercetools:commercetools-sync-java:10.0.4'
````

### 2. Setup Syncing Options
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ public CompletionStage<Map<String, String>> cacheKeysToIdsUsingGraphQl(
.filter(Objects::nonNull)
.forEach(
data -> {
ObjectMapper objectMapper = JsonUtils.getConfiguredObjectMapper();
final ObjectMapper objectMapper = JsonUtils.getConfiguredObjectMapper();
final JsonNode jsonNode = objectMapper.convertValue(data, JsonNode.class);
final Iterator<JsonNode> elements =
jsonNode.get(queryResource.getName()).get("results").elements();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
import com.commercetools.sync.commons.models.WaitingToBeResolved;
import com.commercetools.sync.commons.utils.ChunkUtils;
import com.commercetools.sync.services.UnresolvedReferencesService;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import io.vrap.rmf.base.client.utils.json.JsonUtils;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
Expand All @@ -31,8 +31,7 @@ public class UnresolvedReferencesServiceImpl<WaitingToBeResolvedT extends Waitin

private final BaseSyncOptions syncOptions;

private static final ObjectMapper OBJECT_MAPPER =
new ObjectMapper().configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
private static final ObjectMapper OBJECT_MAPPER = JsonUtils.getConfiguredObjectMapper();

private static final String SAVE_FAILED =
"Failed to save CustomObject with key: '%s' (hash of product key: '%s').";
Expand Down

0 comments on commit fbded7b

Please sign in to comment.