Skip to content

Commit

Permalink
Merge branch 'release/1.0.0-preview.20191208' into master/1.x
Browse files Browse the repository at this point in the history
  • Loading branch information
eiiches committed Dec 8, 2019
2 parents 26094bd + 87640b8 commit 87a7931
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 21 deletions.
27 changes: 14 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@ jackson-jq

[jq](http://stedolan.github.io/jq/) for Jackson JSON Processor

[![GitHub Actions](/eiiches/jackson-jq/workflows/test/badge.svg)](/eiiches/jackson-jq/actions)
[![GitHub Actions](https://github.com/eiiches/jackson-jq/workflows/test/badge.svg)](https://github.com/eiiches/jackson-jq/actions)


*You are currently viewing the develop/1.x branch. Some of the features may not be released yet.*

Usage
-----

First, you need Java 8 or later.

If you use Maven, add the following snippet to the `<dependencies>` section of your POM. For instructions for other build tools (Gradle, etc.), visit [jackson-jq](https://search.maven.org/artifact/net.thisptr/jackson-jq/1.0.0-preview.20190925/jar) on search.maven.org.
If you use Maven, add the following snippet to the `<dependencies>` section of your POM. For instructions for other build tools (Gradle, etc.), visit [jackson-jq](https://search.maven.org/artifact/net.thisptr/jackson-jq/1.0.0-preview.20191208/jar) on search.maven.org.

```xml
<dependency>
<groupId>net.thisptr</groupId>
<artifactId>jackson-jq</artifactId>
<version>1.0.0-preview.20190925</version>
<version>1.0.0-preview.20191208</version>
</dependency>
```

Expand All @@ -30,29 +30,29 @@ Using a jackson-jq command line tool
To test a query quickly, we provide jackson-jq CLI.

```sh
$ curl -LO https://repo1.maven.org/maven2/net/thisptr/jackson-jq-cli/1.0.0-preview.20190925/jackson-jq-cli-1.0.0-preview.20190925.jar
$ curl -LO https://repo1.maven.org/maven2/net/thisptr/jackson-jq-cli/1.0.0-preview.20191208/jackson-jq-cli-1.0.0-preview.20191208.jar

$ java -jar jackson-jq-cli-1.0.0-preview.20190925.jar --help
$ java -jar jackson-jq-cli-1.0.0-preview.20191208.jar --help
usage: jackson-jq [OPTIONS...] QUERY
-c,--compact compact instead of pretty-printed output
-h,--help print this message
--jq <arg> specify jq version
-n,--null-input use `null` as the single input value
-r,--raw output raw strings, not JSON texts

$ java -jar jackson-jq-cli-1.0.0-preview.20190925.jar '.foo'
$ java -jar jackson-jq-cli-1.0.0-preview.20191208.jar '.foo'
{"foo": 42}
42
```

To test a query with a specific jq version,

```sh
$ java -jar jackson-jq-cli-1.0.0-preview.20190925.jar --jq 1.5 'join("-")'
$ java -jar jackson-jq-cli-1.0.0-preview.20191208.jar --jq 1.5 'join("-")'
["1", 2]
jq: error: string ("-") and number (2) cannot be added

$ java -jar jackson-jq-cli-1.0.0-preview.20190925.jar --jq 1.6 'join("-")' # jq-1.6 can join any values, not only strings
$ java -jar jackson-jq-cli-1.0.0-preview.20191208.jar --jq 1.6 'join("-")' # jq-1.6 can join any values, not only strings
["1", 2]
"1-2"
```
Expand All @@ -64,14 +64,14 @@ Branches and versioning

There are currently two development branches.

* `develop/1.x`: This branch (you are viewing), which is currently under development for the future 1.0 release. The API is **not** stable yet. You can find preview releases (not stable, not recommended for production) at [Releases](/eiiches/jackson-jq/releases) page (tags: `1.0.0-preview.yyyyMMdd`).
* `develop/0.x`: The development branch for 0.x versions. Features that need breaking API changes will no longer be added. Go to [Releases](/eiiches/jackson-jq/releases) and find the latest 0.x.y version.
* `develop/1.x`: This branch (you are viewing), which is currently under development for the future 1.0 release. The API is **not** stable yet. You can find preview releases (not stable, not recommended for production) at [Releases](https://github.com/eiiches/jackson-jq/releases) page (tags: `1.0.0-preview.yyyyMMdd`).
* `develop/0.x`: The development branch for 0.x versions. Features that need breaking API changes will no longer be added. Go to [Releases](https://github.com/eiiches/jackson-jq/releases) and find the latest 0.x.y version.

PRs can be sent to any of the develop/\* branches. The patch will be ported to the other branch(es) if necessary.

We use [Semantic Versioning 2.0.0](https://semver.org/) for Java API versioning, 1.0.0 onwards. A jq behavior fix (even if it may possibly affect users) will not be considered a major change if the fix is to make the bahavior compatible with ./jq; these kind of incompatible changes are documented in the release note.

If you get different results between ./jq and jackson-jq, please [file an issue](/eiiches/jackson-jq/issues). That is a bug on jackson-jq side.
If you get different results between ./jq and jackson-jq, please [file an issue](https://github.com/eiiches/jackson-jq/issues). That is a bug on jackson-jq side.

Implementation status and current limitations
---------------------------------------------
Expand Down Expand Up @@ -174,6 +174,7 @@ This table illustrates which features (picked from jq-1.5 manual) are supported
| &nbsp;&nbsp;&nbsp;&nbsp;&bull; [`gsub(regex; string)`, `gsub(regex; string; flags)`](https://stedolan.github.io/jq/manual/v1.5/#gsub&#40;regex&#59;string&#41;&#44;gsub&#40;regex&#59;string&#59;flags&#41;) ||
| [Advanced features](https://stedolan.github.io/jq/manual/v1.5/#Advancedfeatures) ||
| &nbsp;&nbsp;&nbsp;&nbsp;&bull; [Variables](https://stedolan.github.io/jq/manual/v1.5/#Variables) ||
| &nbsp;&nbsp;&nbsp;&nbsp;&bull; [Destructuring Alternative Operator: ?//](https://stedolan.github.io/jq/manual/v1.6/#DestructuringAlternativeOperator:?//) | ✕ (#44) |
| &nbsp;&nbsp;&nbsp;&nbsp;&bull; [Defining Functions](https://stedolan.github.io/jq/manual/v1.5/#DefiningFunctions) | ○<sup>*3</sup> |
| &nbsp;&nbsp;&nbsp;&nbsp;&bull; [Reduce](https://stedolan.github.io/jq/manual/v1.5/#Reduce) ||
| &nbsp;&nbsp;&nbsp;&nbsp;&bull; [`limit(n; exp)`](https://stedolan.github.io/jq/manual/v1.5/#limit&#40;n&#59;exp&#41;) ||
Expand Down Expand Up @@ -232,7 +233,7 @@ Using jackson-jq-extra module
<dependency>
<groupId>net.thisptr</groupId>
<artifactId>jackson-jq-extra</artifactId>
<version>1.0.0-preview.20190925</version>
<version>1.0.0-preview.20191208</version>
</dependency>
```

Expand Down
4 changes: 2 additions & 2 deletions jackson-jq-cli/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
<parent>
<groupId>net.thisptr</groupId>
<artifactId>jackson-jq-parent</artifactId>
<version>1.0.0-preview.20190925</version>
<version>1.0.0-preview.20191208</version>
</parent>

<dependencies>
<dependency>
<groupId>net.thisptr</groupId>
<artifactId>jackson-jq-extra</artifactId>
<version>1.0.0-preview.20190925</version>
<version>1.0.0-preview.20191208</version>
</dependency>
<dependency>
<groupId>commons-cli</groupId>
Expand Down
4 changes: 2 additions & 2 deletions jackson-jq-extra/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
<parent>
<groupId>net.thisptr</groupId>
<artifactId>jackson-jq-parent</artifactId>
<version>1.0.0-preview.20190925</version>
<version>1.0.0-preview.20191208</version>
</parent>

<dependencies>
<dependency>
<groupId>net.thisptr</groupId>
<artifactId>jackson-jq</artifactId>
<version>1.0.0-preview.20190925</version>
<version>1.0.0-preview.20191208</version>
</dependency>
</dependencies>

Expand Down
2 changes: 1 addition & 1 deletion jackson-jq/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<parent>
<groupId>net.thisptr</groupId>
<artifactId>jackson-jq-parent</artifactId>
<version>1.0.0-preview.20190925</version>
<version>1.0.0-preview.20191208</version>
</parent>

<dependencies>
Expand Down
1 change: 1 addition & 0 deletions jackson-jq/src/main/javacc/json-query.jj
Original file line number Diff line number Diff line change
Expand Up @@ -1017,6 +1017,7 @@ Expression StringInterpolation():
case 'r': builder.append((char) 0x0d); break;
case 't': builder.append((char) 0x09); break;
case 'n': builder.append((char) 0x0a); break;
case '/': builder.append('/'); break;
default: {
throw new IllegalStateException("Unexpected escape char: " + c);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@
- q: 'try (path("path: \([1,2][])")) catch .'
out:
- "Invalid path expression with result \"path: 1\""
- q: '"\/"'
out:
- "/"
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<groupId>net.thisptr</groupId>
<artifactId>jackson-jq-parent</artifactId>
<packaging>pom</packaging>
<version>1.0.0-preview.20190925</version>
<version>1.0.0-preview.20191208</version>
<name>${project.groupId}:${project.artifactId}</name>
<description>jq for Jackson JSON Processor</description>
<url>https://github.com/eiiches/jackson-jq</url>
Expand All @@ -28,7 +28,7 @@
<connection>scm:git:git@github.com:eiiches/jackson-jq.git</connection>
<developerConnection>scm:git:git@github.com:eiiches/jackson-jq.git</developerConnection>
<url>git@github.com:juven/git-demo.git</url>
<tag>1.0.0-preview.20190925</tag>
<tag>1.0.0-preview.20191208</tag>
</scm>

<modules>
Expand All @@ -47,7 +47,7 @@
<properties>
<org.slf4j-version>1.7.28</org.slf4j-version>
<com.fasterxml.jackson-version>2.9.10</com.fasterxml.jackson-version>
<com.fasterxml.jackson.databind-version>2.9.10</com.fasterxml.jackson.databind-version>
<com.fasterxml.jackson.databind-version>2.9.10.1</com.fasterxml.jackson.databind-version>
<com.google.auto.service-version>1.0-rc6</com.google.auto.service-version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
Expand Down
1 change: 1 addition & 0 deletions scripts/update-version-refs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ sed -i "s;<version>[0-9a-z.-]*</version>;<version>$version</version>;" README.md
sed -i "s;https://search.maven.org/artifact/net.thisptr/jackson-jq/[0-9a-z.-]*/;https://search.maven.org/artifact/net.thisptr/jackson-jq/$version/;" README.md
sed -i "s;jackson-jq-cli-[0-9a-z.-]*.jar;jackson-jq-cli-$version.jar;" README.md
sed -i "s;https://repo1.maven.org/maven2/net/thisptr/jackson-jq-cli/[0-9a-z.-]*/;https://repo1.maven.org/maven2/net/thisptr/jackson-jq-cli/$version/;" README.md
sed -i "s;*You are currently viewing the .* branch. Some of the features may not be released yet.*;;" README.md

0 comments on commit 87a7931

Please sign in to comment.