Skip to content
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

Tabular output should respect missing values #1

Open
cburgmer opened this issue Mar 16, 2020 · 0 comments
Open

Tabular output should respect missing values #1

cburgmer opened this issue Mar 16, 2020 · 0 comments

Comments

@cburgmer
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant