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

feat: remove fields not declared in template #5

Open
youen opened this issue Oct 9, 2021 · 1 comment
Open

feat: remove fields not declared in template #5

youen opened this issue Oct 9, 2021 · 1 comment

Comments

@youen
Copy link
Collaborator

youen commented Oct 9, 2021

Problem

we can't use jl command to normalize a json stream with only wanted fields.

$ jl -t '{"name": "string"}' <<EOF
{"name": "Martin", "city": "London"}
EOF
{"name":"Martin","city":"London"}

Proposal

Add --strict flag (-s for short) to filter out not declared fields.

$ jl --strict -t '{"name": "string"}' <<EOF
{"name": "Martin", "city": "London"}
EOF
{"name":"Martin"}
@adrienaury
Copy link
Member

--strict could be used to interrupt the pipeline on first error instead of logging an error and continuing to process lines.

I propose to use --discard or -d instead.

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

2 participants