Skip to content
This repository has been archived by the owner on Nov 7, 2021. It is now read-only.

matt-allan/json-guard-cli

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

json-guard-cli

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.

About

A PHP CLI tool for JSON Schema

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages