可以从命令行运行json模式验证器吗?
是否有用于json模式验证器的jar文件?我在:
[http://mvnrepository.com/artifact/com.github.fge/json-schema-validator/2.1.8][1]但是它似乎是损坏的/不完整的/什么的(我不是Java程序员)。将java.exe应用于jar文件:
java -jar json-schema-验证器-2.1.8.jar
结果出现此错误消息:
"no main manifest attribute, in json-schema-validator-2.1.8.jar"那是什么意思?
以下是我的问题:
java -jar json-schema-验证器-2.1.8.jar instance.json schema.json
并让验证器针对schema.json验证schema.json,并在命令行上显示验证结果。
谢谢!
发布于 2014-04-11 23:12:42
好的,从2.1.10版本开始,您实际上可以这样做。指令在该项目的自述中提供。以下是当前版本的帮助:
$ java -Done-jar.silent=true -jar json-schema-validator-2.1.10-standalone.jar --help
Syntax: java -jar jsonschema.jar [options] file [file...]
Options:
-s, --brief: only show validation status (OK/NOT OK)
--help: show this help
-q, --quiet: no output; exit with the relevant return code (see below)
--syntax: check the syntax of schema(s) given as argument(s)
Exit codes:
0: validation successful;
1: exception occurred (appears on stderr)
2: command line syntax error (missing argument, etc)
100: one or more file(s) failed validation
101: one or more schema(s) is/are invalid发布于 2016-04-14 16:05:50
您还可以尝试构建和安装C++ https://bitbucket.org/gallen/libvariant工具,以解决您的问题。
Cli命令- varsh
https://stackoverflow.com/questions/22867521
复制相似问题