Giter Club home page Giter Club logo

yajsv's Introduction

yajsv

CI

Yet Another JSON-Schema Validator. Command line tool for validating JSON and/or YAML documents against provided schemas.

The real credit goes to xeipuuv/gojsonschema which does the heavy lifting behind this CLI.

Installation

Simply use go get to install

go get neilpa.me/yajsv

There are also pre-built static binaries for Windows, Mac and Linux on the releases tab.

Usage

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
  • error: Document is malformed, e.g. not valid JSON or YAML

The 'fail' status may be reported multiple times per-document, once for each schema validation failure.

Basic usage example

$ yajsv -s schema.json document.json
document.json: pass

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.yaml doc1.json doc2.yaml
doc1.json: pass
doc2.json: pass

Or with file globs (note the quotes to side-step shell expansion)

$ yajsv -s main.schema.json -r '*.schema.json' 'docs/*.json'
docs/a.json: pass
docs/b.json: fail: Validation failure message
...

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

yajsv's People

Contributors

fgma avatar neilpa avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.