This package is a CLI client for JSON Guard, a JSON Schema validator. You can easily validate data against a schema or check your schema itself.
Installation uses Composer.
$ composer require yuloh/json-guard-cli
If you don't want to install this per project, you can install it globally and use it anywhere. If you aren't familiar with Composer's global install functionality, this tutorial should get you up and running.
$ composer global require yuloh/json-guard-cli
Validate Data Against a Schema.
Usage:
$ json-guard validate [<data>] [<schema>]
Arguments:
- data: The data to validate.
- schema: The schema to use.
Examples:
# Using files
$ json-guard validate my-data.json my-schema.json
# Using JSON strings
$ json-guard validate \
'{ "id": "https://json-guard.dev/schema#" }' \
'{ "properties": { "id": { "type": "string", "format": "uri" } } }'
# Loading Schema with a Loader
$ json-guard validate my-data.json 'http://json-schema.org/draft-04/schema#'
Check that a JSON Schema is valid.
Usage:
$ json-guard check [<schema>]
Arguments:
- schema: The schema to check.
Examples:
$ json-guard check my-schema.json
All commands can load the JSON as a string, from a loader path, from a local file path, or from STDIN.
Please see CHANGELOG for more information what has changed recently.
$ composer test
Please see CONTRIBUTING and CONDUCT for details.
The MIT License (MIT). Please see License File for more information.