jsonschema
jsonschema copied to clipboard
Is there a command-line program using this library?
On my Unix box, I want to say
$ jsonschema --schemaFile person.jsonSchema --dataFile obama.json
And be told whether obama.json
is valid according to the specified schema.
I only looked briefly for you, but I find it interesting that I did not find one. You could browse the npm package's dependants list to see all NPM Packages that declare a dependency on this package, but the list is extensive.
There's also json-schema.org's implementation list, but all the validators I looked at were libraries without clearly documented cli implementations as well.
I must admit that I didn't search really hard, but it would actually be pretty easy to whip one up in a couple of hours though. That might be why there's nothing standing out in the search - developers just roll their own script if they need it.
Thanks for taking a look, and corroborating my sense that this wasn't just me being dumb.
I agree it should be pretty easy to do for someone familiar with the language and the library. Unfortunately I am neither. If someone else is, and wants to write such a driver, I hope it'll be accepted as a pull-request.
For others: https://github.com/fmahnke/jsonschema-cli
Oh wow, I'll add that to the README if not merge it in (I haven't kept up to date on best practices, if it's a good idea to ship a program and library together in the same package.)
https://github.com/wandroll/jsonschema-commandline has more recent activity, not that that strictly means anything.