-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Not expected implicit cast of 000 to 0 #1404
Comments
Thanks. This can't really be seen as a jq-specific JSON extension. It has to be fixed. |
Can I take this? I think checking literal before sending to jvp_strtod. |
It is covered in the FAQ
I was, too, under impression that this incompatible behaviour should be fixed. But over time I got to thinking that it does make sense to use dedicated tools if one wants to validate JSON. At the end, let me just mention that this specific limitation of JSON doesn't make too much sense as well, as it come out of a specific ECMAScript syntax where leading zero was denoting an octal literal. This is not used anywhere else and also deprecated in java script. This answer covers the topic, the comments as also helpful https://stackoverflow.com/a/27361596/5171225 |
According to what you said, it is unnecessary to fix this behavior. But what is bad about fixing this? |
technically, it shouldn't be fixed, since it's a documented feature. Changing this behaviour will break backward compatibility. However adding a program switch to enable Still, the final decision here is on the maintainer's shoulders. |
Similarily:
This is more than just unexpected, not documented in the manual page, and in the absence of a strict option makes jq catastrophically violate the JSON spec. JSON can only function if everyone adheres to the spec. Forwarded from https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=878091 |
I didn't expect the following behavior:
I expect jq behave for example like this:
I didn't know that jq cannot be used to validate JSON.
The text was updated successfully, but these errors were encountered: