Skip to content

Commit

Permalink
CAMEL-16389 - Remove json-smart
Browse files Browse the repository at this point in the history
  • Loading branch information
coheigea authored and oscerd committed Mar 24, 2021
1 parent 64c3abf commit b59a96d
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 10 deletions.
1 change: 0 additions & 1 deletion camel-dependencies/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,6 @@
<json-path-version>2.4.0</json-path-version>
<json-schema-validator-version>2.2.14</json-schema-validator-version>
<json-simple-version>1.1.1</json-simple-version>
<json-smart-version>2.3</json-smart-version>
<jsonassert-version>1.5.0</jsonassert-version>
<jsonata4java-version>1.5.0</jsonata4java-version>
<jsoup-version>1.13.1</jsoup-version>
Expand Down
5 changes: 0 additions & 5 deletions components/camel-chunk/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,6 @@
<artifactId>chunk-templates</artifactId>
<version>${chunk-templates-version}</version>
</dependency>
<dependency>
<groupId>net.minidev</groupId>
<artifactId>json-smart</artifactId>
<version>${json-smart-version}</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
Expand Down
9 changes: 7 additions & 2 deletions components/camel-jsonpath/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

<properties>
<camel.osgi.import>
com.fasterxml.jackson.databind;resolution:=optional,
com.fasterxml.jackson.databind,
com.fasterxml.jackson.module.jaxb;resolution:=optional,
*
</camel.osgi.import>
Expand All @@ -55,11 +55,16 @@
<groupId>com.jayway.jsonpath</groupId>
<artifactId>json-path</artifactId>
<version>${json-path-version}</version>
<exclusions>
<exclusion>
<groupId>net.minidev</groupId>
<artifactId>json-smart</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.module</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
import com.jayway.jsonpath.Configuration;
import com.jayway.jsonpath.JsonPath;
import com.jayway.jsonpath.Option;
import com.jayway.jsonpath.spi.json.JacksonJsonProvider;
import com.jayway.jsonpath.spi.mapper.JacksonMappingProvider;
import org.apache.camel.CamelExchangeException;
import org.apache.camel.Exchange;
import org.apache.camel.Expression;
Expand Down Expand Up @@ -72,6 +74,8 @@ public JsonPathEngine(String expression, boolean writeAsString, boolean suppress
if (options != null) {
builder.options(options);
}
builder.jsonProvider(new JacksonJsonProvider());
builder.mappingProvider(new JacksonMappingProvider());
if (suppressExceptions) {
builder.options(SUPPRESS_EXCEPTIONS);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
import java.util.Map;

import com.jayway.jsonpath.Configuration;
import com.jayway.jsonpath.spi.json.JacksonJsonProvider;
import com.jayway.jsonpath.spi.mapper.JacksonMappingProvider;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.test.junit5.CamelTestSupport;
import org.junit.jupiter.api.Test;
Expand All @@ -47,7 +49,10 @@ public void testAuthors() throws Exception {
getMockEndpoint("mock:authors").expectedMessageCount(1);

// should be a map
Object document = Configuration.defaultConfiguration().jsonProvider()
Configuration.ConfigurationBuilder builder = Configuration.builder();
builder.jsonProvider(new JacksonJsonProvider());
builder.mappingProvider(new JacksonMappingProvider());
Object document = builder.build().jsonProvider()
.parse(new FileInputStream("src/test/resources/books.json"), "utf-8");
assertIsInstanceOf(Map.class, document);

Expand Down
1 change: 0 additions & 1 deletion parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,6 @@
<jsonassert-version>1.5.0</jsonassert-version>
<json-path-version>2.4.0</json-path-version>
<json-simple-version>1.1.1</json-simple-version>
<json-smart-version>2.3</json-smart-version>
<jsonata4java-version>1.5.0</jsonata4java-version>
<json-schema-validator-version>2.2.14</json-schema-validator-version>
<jsoup-version>1.13.1</jsoup-version>
Expand Down

0 comments on commit b59a96d

Please sign in to comment.