@@ -12,13 +12,13 @@ Usage
1212
1313First, you need Java 8 or later.
1414
15- 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.5 .0/jar ) on search.maven.org.
15+ 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.6 .0/jar ) on search.maven.org.
1616
1717``` xml
1818<dependency >
1919 <groupId >net.thisptr</groupId >
2020 <artifactId >jackson-jq</artifactId >
21- <version >1.5 .0</version >
21+ <version >1.6 .0</version >
2222</dependency >
2323```
2424
@@ -32,29 +32,29 @@ To test a query quickly, we provide jackson-jq CLI.
3232* Please note that jackson-jq is a Java library and the CLI is provided solely for debugging/testing purpose (and not for production). The command-line options might change without notice.*
3333
3434``` sh
35- $ curl -LO https://repo1.maven.org/maven2/net/thisptr/jackson-jq-cli/1.5 .0/jackson-jq-cli-1.5 .0.jar
35+ $ curl -LO https://repo1.maven.org/maven2/net/thisptr/jackson-jq-cli/1.6 .0/jackson-jq-cli-1.6 .0.jar
3636
37- $ java -jar jackson-jq-cli-1.5 .0.jar --help
37+ $ java -jar jackson-jq-cli-1.6 .0.jar --help
3838usage: jackson-jq [OPTIONS...] QUERY
3939 -c,--compact compact instead of pretty-printed output
4040 -h,--help print this message
4141 --jq < arg> specify jq version
4242 -n,--null-input use ` null` as the single input value
4343 -r,--raw output raw strings, not JSON texts
4444
45- $ java -jar jackson-jq-cli-1.5 .0.jar ' .foo'
45+ $ java -jar jackson-jq-cli-1.6 .0.jar ' .foo'
4646{" foo" : 42}
474742
4848```
4949
5050To test a query with a specific jq version,
5151
5252``` sh
53- $ java -jar jackson-jq-cli-1.5 .0.jar --jq 1.5 ' join("-")'
53+ $ java -jar jackson-jq-cli-1.6 .0.jar --jq 1.5 ' join("-")'
5454[" 1" , 2]
5555jq: error: string (" -" ) and number (2) cannot be added
5656
57- $ java -jar jackson-jq-cli-1.5 .0.jar --jq 1.6 ' join("-")' # jq-1.6 can join any values, not only strings
57+ $ java -jar jackson-jq-cli-1.6 .0.jar --jq 1.6 ' join("-")' # jq-1.6 can join any values, not only strings
5858[" 1" , 2]
5959" 1-2"
6060```
@@ -236,9 +236,9 @@ $ jq -n '1 + 3 as $a | ($a * 2)' # interpreted as 1 + (3 as $a | ($a * 2))
236236whereas jackson-jq consistently interprets them as ` (1 + 3) ` whether ` as $a ` is used or not:
237237
238238``` console
239- $ java -jar jackson-jq-cli-1.5 .0.jar -n ' 1 + 3 | (. * 2)' # interpreted as (1 + 3) | (. * 2)
239+ $ java -jar jackson-jq-cli-1.6 .0.jar -n ' 1 + 3 | (. * 2)' # interpreted as (1 + 3) | (. * 2)
2402408
241- $ java -jar jackson-jq-cli-1.5 .0.jar -n ' 1 + 3 as $a | ($a * 2)' # interpreted as (1 + 3) as $a | ($a * 2)
241+ $ java -jar jackson-jq-cli-1.6 .0.jar -n ' 1 + 3 as $a | ($a * 2)' # interpreted as (1 + 3) as $a | ($a * 2)
2422428
243243```
244244
@@ -247,7 +247,7 @@ $ java -jar jackson-jq-cli-1.5.0.jar -n '1 + 3 as $a | ($a * 2)' # interpreted a
247247``` console
248248$ jq -n ' 1 + 3 as $a | ($a * 2)' # interpreted as 1 + (3 as $a | ($a * 2))
2492497
250- $ java -jar jackson-jq-cli-1.5 .0.jar -n ' 1 + 3 as $a | ($a * 2)' # interpreted as (1 + 3) as $a | ($a * 2)
250+ $ java -jar jackson-jq-cli-1.6 .0.jar -n ' 1 + 3 as $a | ($a * 2)' # interpreted as (1 + 3) as $a | ($a * 2)
2512518
252252```
253253
@@ -274,7 +274,7 @@ If the function with the same is defined more than once at the same scope, jacks
274274``` console
275275$ jq -n ' def f: 1; def g: f; def f: 2; g'
2762761
277- $ java -jar jackson-jq-cli-1.5 .0.jar -n ' def f: 1; def g: f; def f: 2; g'
277+ $ java -jar jackson-jq-cli-1.6 .0.jar -n ' def f: 1; def g: f; def f: 2; g'
2782782
279279```
280280
@@ -283,7 +283,7 @@ $ java -jar jackson-jq-cli-1.5.0.jar -n 'def f: 1; def g: f; def f: 2; g'
283283Avoid using the duplicate function name.
284284
285285``` console
286- $ java -jar jackson-jq-cli-1.5 .0.jar -n ' def f1: 1; def g: f1; def f2: 2; g'
286+ $ java -jar jackson-jq-cli-1.6 .0.jar -n ' def f1: 1; def g: f1; def f2: 2; g'
2872871
288288```
289289
@@ -353,7 +353,7 @@ jq: error: Division by zero? at <top-level>, line 1:
353353jq: 1 compile error
354354$ jq ' . / 0' <<< 0
355355jq: error (at <stdin>:1): number (0) and number (0) cannot be divided because the divisor is zero
356- $ java -jar jackson-jq-cli-1.5 .0.jar -n ' 0 / 0'
356+ $ java -jar jackson-jq-cli-1.6 .0.jar -n ' 0 / 0'
357357jq: error: number (0) and number (0) cannot be divided because the divisor is zero
358358```
359359
@@ -386,9 +386,9 @@ $ jq-1.2 -n '[1,2,3] | ((.[] | select(. > 1)) |= empty)'
386386 2,
387387 3
388388]
389- $ java -jar jackson-jq-cli-1.5 .0.jar --jq 1.6 -n ' [1,2,3] | ((.[] | select(. > 1)) |= empty)'
389+ $ java -jar jackson-jq-cli-1.6 .0.jar --jq 1.6 -n ' [1,2,3] | ((.[] | select(. > 1)) |= empty)'
390390jq: error: `|= empty` is undefined. See https://github.com/stedolan/jq/issues/897
391- $ java -jar jackson-jq-cli-1.5 .0.jar --jq 1.5 -n ' [1,2,3] | ((.[] | select(. > 1)) |= empty)'
391+ $ java -jar jackson-jq-cli-1.6 .0.jar --jq 1.5 -n ' [1,2,3] | ((.[] | select(. > 1)) |= empty)'
392392jq: error: `|= empty` is undefined. See https://github.com/stedolan/jq/issues/897
393393```
394394
@@ -397,9 +397,9 @@ jq: error: `|= empty` is undefined. See https://github.com/stedolan/jq/issues/89
397397You can use ` _modify/2 ` if you really want to the original behavior.
398398
399399``` console
400- $ java -jar jackson-jq-cli-1.5 .0.jar --jq 1.6 -n ' [1,2,3] | _modify((.[] | select(. > 1)); empty)'
400+ $ java -jar jackson-jq-cli-1.6 .0.jar --jq 1.6 -n ' [1,2,3] | _modify((.[] | select(. > 1)); empty)'
401401[ 1, 3 ]
402- $ java -jar jackson-jq-cli-1.5 .0.jar --jq 1.5 -n ' [1,2,3] | _modify((.[] | select(. > 1)); empty)'
402+ $ java -jar jackson-jq-cli-1.6 .0.jar --jq 1.5 -n ' [1,2,3] | _modify((.[] | select(. > 1)); empty)'
403403null
404404```
405405
@@ -419,7 +419,7 @@ jq 1.5
419419``` console
420420$ jq-1.5 -c ' path(.foo as $a | $a)' <<< ' {"foo": 1}'
421421["foo"]
422- $ java -jar jackson-jq-cli-1.5 .0.jar --jq 1.5 -c ' path(.foo as $a | $a)' <<< ' {"foo": 1}'
422+ $ java -jar jackson-jq-cli-1.6 .0.jar --jq 1.5 -c ' path(.foo as $a | $a)' <<< ' {"foo": 1}'
423423jq: error: Invalid path expression with result 1
424424```
425425
@@ -428,7 +428,7 @@ jq 1.6
428428``` console
429429$ jq-1.6 -c ' path(.foo as $a | $a)' <<< ' {"foo": 1}'
430430jq: error (at <stdin>:1): Invalid path expression with result 1
431- $ java -jar jackson-jq-cli-1.5 .0.jar --jq 1.6 -c ' path(.foo as $a | $a)' <<< ' {"foo": 1}'
431+ $ java -jar jackson-jq-cli-1.6 .0.jar --jq 1.6 -c ' path(.foo as $a | $a)' <<< ' {"foo": 1}'
432432jq: error: Invalid path expression with result 1
433433```
434434
@@ -452,7 +452,7 @@ $ jq -n 'label $a | label $b | try (break $b) catch .'
452452{
453453 "__jq": 1
454454}
455- $ java -jar jackson-jq-cli-1.5 .0.jar -n ' label $a | label $b | try (break $b) catch .'
455+ $ java -jar jackson-jq-cli-1.6 .0.jar -n ' label $a | label $b | try (break $b) catch .'
456456{
457457 "__jq" : 0
458458}
@@ -482,7 +482,7 @@ $ jq-1.6 -n '"x" | indices("")' # stuck in infinite loop
482482^C
483483$ jq-1.6-83-gb52fc10 -n ' "x" | indices("")'
484484[]
485- $ java -jar jackson-jq-cli-1.5 .0.jar -n ' "x" | indices("")'
485+ $ java -jar jackson-jq-cli-1.6 .0.jar -n ' "x" | indices("")'
486486[ ]
487487```
488488
@@ -499,7 +499,7 @@ To use this module, you need to add the following Maven dependency and set `Buil
499499<dependency >
500500 <groupId >net.thisptr</groupId >
501501 <artifactId >jackson-jq-extra</artifactId >
502- <version >1.5 .0</version >
502+ <version >1.6 .0</version >
503503</dependency >
504504```
505505
0 commit comments