yuloh/json-guard-cli

This package is abandoned and no longer maintained. No replacement package was suggested.

A CLI tool for json-guard

0.3.0 2017-04-30 14:20 UTC

This package is auto-updated.

Last update: 2022-02-01 12:58:14 UTC


README

Latest Version on Packagist Software License Build Status Coverage Status Quality Score Total Downloads

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.

json-guard-cli-screenshot

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.