The fact that you cannot have trailing commans in lists or dicts as in is one of the most infuriating design choices of all time!!!
3, at:{
"asdf": [
1,
2,
3,
]
}Yet another awk-like domain-specific language to do things from the CLI in a ridiculously short humber of character? Oh yes.
echo '[{"a": 1, "b": 2}, {"b": 3}]' | jq '.[] | select(.a) | .a'1 Articles by others on the same topic
JSON, short for JavaScript Object Notation, is a textual data interchange format used for serialization. Its values are objects, arrays, strings, numbers, Boolean values and
null. Object member names are strings; array elements are ordered. A complete JSON text may represent a single value, including a number or string.[ref]The format's syntax and an implementation's numerical precision are separate. For an original example, consider
{"n":9007199254740993}. A JavaScript call to JSON.parse produces a Number whose decimal value is 9007199254740992; the requested integer has rounded to in the double-precision floating-point format. The same input decoded by Python's default json.loads retains the integer 9007199254740993 exactly.Encoding the digits as
{"n":"9007199254740993"} preserves them as a string in both examples, but changes the represented type. Any later numerical interpretation needs an agreed rule. RFC8259 identifies the integer interval for exact agreement with commonly used numerical implementations; it does not restrict valid JSON numerals to that interval.[ref]The JavaScript Object Notation (JSON) Data Interchange Format. §6: number magnitude, precision and interoperability