jp
jp copied to clipboard
Tabular output should respect missing values
Picking values for tabular display via -t should fill columns correctly regardless of whether a property is set on an object/index is available in an array.
Example:
jp --example | jp '$..[?(@.price > 10)]' | jp -t '$["title", "price"]'
Observed:
"Sword of Honour" 12.99
"The Lord of the Rings" 22.99
19.95
Expected:
"Sword of Honour" 12.99
"The Lord of the Rings" 22.99
19.95
Possible solution: JSONPath will by default drop missing fields. Extending the query library to fill in nulls instead could fulfil this requirement.