Jq: validation failure: not reporting incomplete JSON as invalid

Created on 8 Jan 2017  路  4Comments  路  Source: stedolan/jq

The json input file "}" produces an error; the input "{" does not.

bug fixed in master

Most helpful comment

1.5 has this problem.

All 4 comments

  1. When reporting a problem, please indicate the jq version number and some details about the environment. A short transcript illustrating the problem is usually helpful.

  2. The problem you describe may already have been resolved. Consider:

$ echo '}' | jq1.3 .
parse error: Unmatched '}' at line 1, column 1

$ echo '{' | jq1.3 .
parse error: Unfinished JSON term

$ /usr/local/bin/jq -V
jq-1.4

$ echo '{' | /usr/local/bin/jq .
parse error: Unfinished JSON term

$ echo '}' | /usr/local/bin/jq .
parse error: Unmatched '}' at line 1, column 1

1.5 has this problem.

1.5 has this problem, but this is fixed on master.

$ ./jq -V
jq-1.5rc2-174-g597c1f6 # read as: commit hash 597c1f6, which is 174 commits ahead of tag jq-1.5rc2.
$ echo '{' | ./jq .
parse error: Unfinished JSON term at EOF at line 2, column 0
$ echo '}' | ./jq .
parse error: Unmatched '}' at line 1, column 1
$ echo -n '}' | ./jq .
parse error: Unmatched '}' at line 1, column 1
$ echo -n '{' | ./jq .
parse error: Unfinished JSON term at EOF at line 1, column 1

Is there an ETA of the next release?

Was this page helpful?
0 / 5 - 0 ratings