Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: provide jackson jq extra as an independent module (#68) #69

Merged
merged 1 commit into from
Jan 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ integrate it in your Quarkus application!
Simply add the dependency to your Quarkus project:

```xml

<dependency>
<groupId>io.quarkiverse.jackson-jq</groupId>
<artifactId>quarkus-jackson-jq</artifactId>
Expand Down Expand Up @@ -45,6 +44,17 @@ public class JacksonJqResource {
}
```

## Jackson Jq Extra Module

You can also make use of the [extra module](https://github.com/eiiches/jackson-jq#using-jackson-jqextras-module) by
adding the following dependency:

```xml
<dependency>
<groupId>io.quarkiverse.jackson-jq</groupId>
<artifactId>quarkus-jackson-jq-extra</artifactId>
</dependency>
```

## Adding Custom functions

Expand Down
5 changes: 5 additions & 0 deletions deployment/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@
<artifactId>quarkus-jackson-jq</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.quarkiverse.jackson-jq</groupId>
<artifactId>quarkus-jackson-jq-extra</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-junit5-internal</artifactId>
Expand Down
5 changes: 5 additions & 0 deletions integration-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@
<artifactId>quarkus-jackson-jq</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.quarkiverse.jackson-jq</groupId>
<artifactId>quarkus-jackson-jq-extra</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-junit5</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ public void functionsTest() {
.body("$", hasItem("paths/1")) // built-in function not filtered
.body("$", hasItem("delpaths/1")) // built-in function not filtered
.body("$", hasItem("myFunction/1")) // custom function not filtered
.body("$", hasItem("myFunction/2")); // custom function not filtered
.body("$", hasItem("myFunction/2")) // custom function not filtered
.body("$", hasItem("strftime/1")) // extra function not filtered
.body("$", hasItem("strftime/2")) // extra function not filtered
.body("$", hasItem("uridecode/0")) // extra function not filtered
.body("$", hasItem("uriparse/0")) // extra function not filtered
.body("$", hasItem("strptime/1")) // extra function not filtered
.body("$", hasItem("strptime/2")) // extra function not filtered
.body("$", hasItem("timestamp/0")) // extra function not filtered
.body("$", hasItem("uuid4/0")); // extra function not filtered
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't create a new module just for testing the extra part, but those functions can only come from the extra jq module, so it should be fine IMO

}
}
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<modules>
<module>deployment</module>
<module>runtime</module>
<module>runtime-extra</module>
</modules>
<properties>
<compiler-plugin.version>3.8.1</compiler-plugin.version>
Expand Down
19 changes: 19 additions & 0 deletions runtime-extra/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>io.quarkiverse.jackson-jq</groupId>
<artifactId>quarkus-jackson-jq-parent</artifactId>
<version>1.2.0-SNAPSHOT</version>
</parent>
<artifactId>quarkus-jackson-jq-extra</artifactId>
<name>Quarkus - Jackson Jq - Runtime - Extra</name>
<dependencies>
<dependency>
<groupId>net.thisptr</groupId>
<artifactId>jackson-jq-extra</artifactId>
<type>jar</type>
<version>${jackson-jq.version}</version>
</dependency>
</dependencies>
</project>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

at this point, this only allows us to have quarkus-jackson-jq and quarkus-jackson-jq-extra pegged to the exact same version for users.