Skip to content
Snippets Groups Projects
Unverified Commit 50710192 authored by Neil Pankey's avatar Neil Pankey Committed by GitHub
Browse files

readme: Minor cleanup

parent bb09bb6f
Branches
Tags
No related merge requests found
......@@ -2,7 +2,7 @@
[![CI](https://github.com/neilpa/yajsv/workflows/CI/badge.svg)](https://github.com/neilpa/yajsv/actions/)
Yet Another [JSON-Schema](https://json-schema.org) Validator. Command line tool for validating JSON and YAML documents against provided schemas.
Yet Another [JSON-Schema](https://json-schema.org) Validator. Command line tool for validating JSON and/or YAML documents against provided schemas.
The real credit goes to [xeipuuv/gojsonschema](https://github.com/xeipuuv/gojsonschema) which does the heavy lifting behind this CLI.
......@@ -11,14 +11,14 @@ The real credit goes to [xeipuuv/gojsonschema](https://github.com/xeipuuv/gojson
Simply use `go get` to install
```
go get github.com/neilpa/yajsv
go get neilpa.me/yajsv
```
There are also pre-built static binaries for Windows, Mac and Linux on the [releases tab](https://github.com/neilpa/yajsv/releases/latest).
## Usage
yajsv validates JSON and YAML documents against a schema, providing a status per document:
Yajsv validates JSON (and/or YAML) documents against a JSON-Schema, providing a status per document:
* pass: Document is valid relative to the schema
* fail: Document is invalid relative to the schema
......@@ -26,11 +26,6 @@ yajsv validates JSON and YAML documents against a schema, providing a status per
The 'fail' status may be reported multiple times per-document, once for each schema validation failure.
Basic usage
Any combination can be used for schema and document. For example you can use a JSON schema to validate a YAML document.
Basic usage example
```
......@@ -38,18 +33,17 @@ $ yajsv -s schema.json document.json
document.json: pass
```
Basic usage example with YAML schema and document:
Or with both schema and doc in YAML.
```
$ yajsv -s schema.yml document.yml
document.yml: pass
```
With multiple schema files and docs
```
$ yajsv -s schema.json -r foo.json -r bar.json doc1.json doc2.json
$ yajsv -s schema.json -r foo.json -r bar.yaml doc1.json doc2.yaml
doc1.json: pass
doc2.json: pass
```
......@@ -63,7 +57,11 @@ docs/b.json: fail: Validation failure message
...
```
Note that each of the referenced schema is assumed to be a path on the local filesystem. These are not
URI references to either local or external schemas and documents.
Note that each referenced schema is assumed to be a path on the local filesystem. These are not
URI references to either local or external files.
See `yajsv -h` for more details
## Licence
[MIT](/LICENSE)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment