data-check
Convenience API/CLI to dereference a json-schema and validate data
Last updated 2 years ago by sramam .
Apache-2.0 · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install data-check 
SYNC missed versions from official npm registry.

data-check

npm license travis status Build status Coverage Status David David Commitizen friendly
NPM

Convenience method to wrap json-schema validation into a single function.

The single API method exported: isValid(schema, data), does three things:

  1. Dereference the schema to resolve all external references
  2. Validate the resulting fullSchema
  3. Validate the data against the fullSchema.

Usage

API

/**
 * Provides a convenience interface to validate a data object
 * against a dereferenced schema object.
 *
 * Throws a SchemaError if either the schema or data is not valid.
 * SchemaError provides an `errors` property, detailing individual
 * violations.
 *
 * @async
 * @param schema schema to validate data against
 * @param data data to validate
 * @returns Promise<boolean>
 */
export declare const isValid: (schema: any, data?: any) => Promise<boolean>;

CLI

  Usage: data-check [options]


  Options:

    -V, --version          output the version number
    -d, --data <data>      data to validate {json, yaml}
    -s, --schema <schema>  schema to use for validation {json, yaml}
    -h, --help             output usage information

Development Tooling

License

Apache-2.0

Code of Conduct

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

Support

Bugs, PRs, comments, suggestions welcomed!

Current Tags

  • 1.2.0                                ...           latest (2 years ago)

6 Versions

  • 1.2.0                                ...           2 years ago
  • 1.1.0                                ...           2 years ago
  • 1.0.3                                ...           2 years ago
  • 1.0.2                                ...           2 years ago
  • 1.0.1                                ...           2 years ago
  • 1.0.0                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (10)
Dev Dependencies (23)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |