Hello,
On Fri, Apr 4, 2014 at 5:48 PM, Roger Costello <
roger.c...@gmail.com> wrote:
> Hi Folks,
>
> Is it possible to run the json-schema-validator from the command line?
>
Currently, no. There is a proposal to add a Gradle app support as a
pull request:
https://github.com/fge/json-schema-validator/pull/81
Unfortunately I haven't had the time to delve into it. Also, my
requests for documentation were left unanswered ;)
The difficulty also resides in the number of dependencies required;
there is an option to create a fatjar which WOULD make a manifest with
"Main-Class" actually useful. But I have yet to test this scenario.
This kind of answers your question below:
> Is there a jar file for json-schema-validator? I found a jar at:
>
>
>
http://mvnrepository.com/artifact/com.github.fge/json-schema-validator/2.1.8
>
> but it appears to be corrupt/incomplete/something (I'm not a Java
> programmer). Applying java.exe to the jar file:
>
> java -jar json-schema-validator-2.1.8.jar
>
> results in this error message:
>
> "no main manifest attribute, in json-schema-validator-2.1.8.jar"
>
> What does that mean?
>
1. for a jar to be "executable", you need to have a file named
META-INF/MANIFEST.MF with it with a Main-Class entry "poiting" to a
class with a main() in it; the current jar doesn't have that;
2. even if it had, it wouldn't run since this jar by itself doesn't
include all dependencies.
> Here are my questions:
>
> 1. Where can I obtain the correct jar file for json-schema-validator?
>
> 2. Once I obtain the jar file, how do I use it on a command line to validate
> a json file against a json-schema file? That is, on the command line I would
> like to type this:
>
> java -jar json-schema-validator-2.1.8.jar instance.json schema.json
>
> and have the validator validate instance.json against schema.json and
> display the results of the validation on the command line.
>
Well, as I explained above, right now, can't do... But I think this
would be a good thing to have. Care to open a feature request?
(yeah, I know, the issues are a little messy right now, I've had to
step aside this project for a while but now I'm back on it; 2.2 is in
the pipe and I'll see to it that such a command line tool is included)
--
Francis Galiegue,
fgal...@gmail.com
JSON Schema in Java:
http://json-schema-validator.herokuapp.com