JSON Schema Validator
Ajv base JSON Schema validator tool
Installation
yarn add jsonschema-validator
Uses
const createValidateWithAjv = const schema = type: 'object' properties: hello: type: 'string' ; // if json data validconst mockJSON = hello: 'world' ;const validate = ;const valid = ;console //true // if json data unvalidconst mockJSON = hello: 123 ;const validate = ;const valid = ;console //falseconsole // should be string <error message from Ajv>
Examples
see all tests sample
License
MIT