json-schema-eval - A command-line interface to JSON::Schema::Modern::evaluate()
version 0.538
json-schema-eval \ [ --specification_version|version <version> ] \ [ --output_format <format> ] \ [ --short_circuit ] \ [ --max_traversal_depth <depth> ] \ [ --validate_formats ] \ [ --validate_content_schemas ] \ [ --collect_annotations ] \ [ --annotate_unknown_keywords ] \ [ --data <filename> ] \ [ --schema <filename> ]
A command-line interface to "evaluate" in JSON::Schema::Modern.
data.json contains:
{"hello": 42}
schema.json contains:
{"type": ["string", "number"]}
Run:
json-schema-eval --data data.json --schema schema.json
produces output:
{ "valid": false, "errors": [ { "instanceLocation": "", "keywordLocation": "/type", "error": "wrong type (expected one of string, number)" } ] }
The exit value ($?) is 0 when the result is valid, 1 when it is invalid, and some other non-zero value if an exception occurred.
$?
All boolean and string options in JSON::Schema::Modern are available.
Additionally, --data is used to provide the filename containing a json-encoded data instance, and --schema provides the filename containing a json-encoded schema.
--data
--schema
If either or both of these are not provided, STDIN is used as input.
Only JSON-encoded data and schemas are supported at this time.
You can also find me on the JSON Schema Slack server and OpenAPI Slack server, which are also great resources for finding help.
Bugs may be submitted through https://github.com/karenetheridge/JSON-Schema-Modern/issues.
I am also usually active on irc, as 'ether' at irc.perl.org and irc.libera.chat.
irc.perl.org
irc.libera.chat
Karen Etheridge <ether@cpan.org>
This software is copyright (c) 2020 by Karen Etheridge.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install JSON::Schema::Modern, copy and paste the appropriate command in to your terminal.
cpanm
cpanm JSON::Schema::Modern
CPAN shell
perl -MCPAN -e shell install JSON::Schema::Modern
For more information on module installation, please visit the detailed CPAN module installation guide.