We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
try
?
|=
Using try or ? on the RHS of the |= operator removes the path being updated, even if the update expression works correctly without any error handling.
I'm using jq-1.6rc1-1-g61edf3f
jq-1.6rc1-1-g61edf3f
Example program:
{"number":"1234"}|(.number|=23),(.number|=23?)
Expected output:
{ "number": 23 } { "number": 23 }
Actual output:
{ "number": 23 } {}
jq 1.5 behaves as expected.
The text was updated successfully, but these errors were encountered:
Thanks for the report.
Sorry, something went wrong.
This issue is still present in stable release jq-1.6.
jq-1.6
I've tried following test cases: {"price": "$23,000"} | .price |= (try 2 catch null) {"price": null} # expected 2
{"price": "$23,000"} | .price |= (try 2 catch null)
{"price": null} # expected 2
The output is correct If update operator or try-catch is removed: {"price": "$23,000"} | . + {price: (try 2 catch null)} { "price": 2} {"price": "$23,000"} | .price |= 2 { "price": 2}
{"price": "$23,000"} | . + {price: (try 2 catch null)}
{ "price": 2}
{"price": "$23,000"} | .price |= 2
Jq-1.5 works as expected. Is there any update on this issue? Is it related to the documented change of behavior of update operator?
Fixed by @wtlangford with e74eab8.
No branches or pull requests
Using
try
or?
on the RHS of the|=
operator removes the path being updated, even if the update expression works correctly without any error handling.I'm using
jq-1.6rc1-1-g61edf3f
Example program:
Expected output:
Actual output:
jq 1.5 behaves as expected.
The text was updated successfully, but these errors were encountered: