Skip to content

CLI: Read JSON instances one to a line from stdin. #211

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 Mar 24, 2015

This lets you mass-validate JSON by piping instances into stdin, instead of having to put them in separate files and say -i file.json... for every one. Each instance has to be on one line. You use it like this:

python -m jsonschema schema.json < instances.json

You may want to do things differently, but this shows how it could be done.

@Julian
Copy link
Member

Julian commented Mar 30, 2015

Hi!

Thanks so much for the PR.

This certainly seems useful -- as implemented though it breaks backwards compatibility -- maybe it'd be useful to have as a new command line flag (or alternatively, read from stdin if no instances were provided).

It'd also be nice to have a test for the new functionality.

Does that sound reasonable?

@jkleint
Copy link
Author

jkleint commented Apr 1, 2015

You're welcome. I was thinking a --filter option that passed through valid instances and logged invalid ones to stderr would be useful. May be a while before I can get to it.

@jkleint
Copy link
Author

jkleint commented Apr 2, 2015

Implemented this in #213, let me know what you think.

@jkleint jkleint closed this Apr 2, 2015
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