JSOND Validator
node.js and browser module for validating JSON definitions
A validator for JSON definitions according to the JSOND specification with the following exceptions:
- Array items are matched only against the first array definition in the schema (see
test/data/array.js
for missing test cases)
http://avaly.github.io/jsond-validator
yarn add jsond-validator
OR
npm install jsond-validator
Then:
const validator = require('jsond-validator');
The package also ships with two UMD bundles:
dist/jsond-validator.js
dist/jsond-validator.min.js
A simple script is shipped with this module to verify a JSON file against a JSON schema:
validate-jsond INPUT_FILE SCHEMA_FILE
npm run test
npm run test-client
Copyright (c) 2015-2017, Valentin Agachi (http://agachi.name)
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.