Skip to content

CLI option --filter: validate multiple instances from stdin. #213

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

Closed
wants to merge 1 commit into from

Conversation

jkleint
Copy link

@jkleint jkleint commented Apr 2, 2015

Reads JSON instances one to a line from stdin, outputs those
that validate in compact form (one to a line). Print errors
to stderr for those that do not validate.

Reads JSON instances one to a line from stdin, outputs those
that validate in compact form (one to a line).  Print errors
to stderr for those that do not validate.
@Julian
Copy link
Member

Julian commented Apr 3, 2015

Cool! Thanks so much.

So this seems useful too, but isn't there a way to make it non-exclusive with the old way?

E.g., we could add a -f / --instance-file which takes line-delimited JSON instances, and then use - for stdin to handle your case, and then a --filter=valid that shows valid instances on stdout in the collected instances passed either via -i or -f?

@jkleint
Copy link
Author

jkleint commented Apr 3, 2015

Or you can use cat to handle all of those cases, and keep it simple.

@Julian
Copy link
Member

Julian commented Apr 3, 2015

Well yes or you can use a for loop with -i and keep it even simpler :).

KISS is always relative: to existing functionality, and to how flexible you want to be, and to forward compatibility.

I'm not saying I've gotten those three exactly correct by throwing that out there, but it'd seem slightly more so than what's here, unless you feel differently.

@jkleint
Copy link
Author

jkleint commented Apr 4, 2015

I like it as is, but of course you're free to embellish.

@Julian
Copy link
Member

Julian commented Dec 25, 2016

I doubt I'll personally ever hit this, so I'm going to close for now, but if anyone else ever feels like discussing further feel free.

Thanks certainly for the submission.

@Julian Julian closed this Dec 25, 2016
Julian added a commit that referenced this pull request Apr 14, 2018
cb2b906 Merge pull request #219 from mohawk2/fix-typo
99452e4 fix typo
b242817 Merge pull request #213 from davishmcclurg/ipv6-iri-format
2146b02 Fix invalid IPv6 IRI
71843cb Merge pull request #211 from deBhal/add-complex-selection-tests
f415a88 Duplicate complex tests for anyOf,oneOf into draft6 and draft7
7c518b4 add complex types test for oneOf, anyOf
efb704f Merge pull request #212 from json-schema-org/update-ajv
a8f9f82 fix: ajv test to use id/$id correctly

git-subtree-dir: json
git-subtree-split: cb2b9069653ea2d0e90bc02ee084b08489a87dfd
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

Successfully merging this pull request may close these issues.

2 participants