yuloh / json-guard-cli
A CLI tool for json-guard
Installs: 32 844
Dependents: 2
Suggesters: 0
Security: 0
Stars: 3
Watchers: 0
Forks: 1
Open Issues: 1
Requires
- league/json-guard: ^1.0
- league/json-reference: ^1.0
- mnapoli/silly: ^1.3
- seld/jsonlint: ^1.4
Requires (Dev)
- phpunit/phpunit: 4.*
- scrutinizer/ocular: ~1.1
- squizlabs/php_codesniffer: ^2.6
This package is auto-updated.
Last update: 2022-02-01 12:58:14 UTC
README
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.
Install
Installation uses Composer.
Project Install
$ composer require yuloh/json-guard-cli
Global Install
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
Usage
Validate
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
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
Loading JSON
All commands can load the JSON as a string, from a loader path, from a local file path, or from STDIN.
Change log
Please see CHANGELOG for more information what has changed recently.
Testing
$ composer test
Contributing
Please see CONTRIBUTING and CONDUCT for details.
Credits
License
The MIT License (MIT). Please see License File for more information.