![]() Tidelift will coordinate the fix and disclosure. To report a security vulnerability, please use the Please report any unacceptable behaviour to - it will be reviewed by the project team. Please review and follow the Code of conduct. Learn how to use Ajv and see more examples in the Guide: getting started Changes history compile ( schema ) const valid = validate ( data ) if ( ! valid ) console. or ESM/TypeScript import import Ajv from "ajv" // Node.js require: const Ajv = require ( "ajv" ) const ajv = new Ajv ( ) // options can be passed, e.g. asynchronous validation of user-defined formats and keywords. ![]() $data reference to use values from the validated data as values for the schema keywords.additional extension keywords with ajv-keywords package.coercing data to the types specified in type keywords.assigning defaults to missing properties and items.i18n error messages support with ajv-i18n package.error messages with parameters describing error reasons to allow error message generation."All errors" validation mode with option allErrors.asynchronous loading of referenced schemas during compilation.supports browsers and Node.js 10.x - current."union" keyword and user-defined keywords (can be used inside "metadata" member of the schema).all keywords (see JSON Type Definition schema forms).JSON Schema formats (with ajv-formats plugin).correct string lengths for strings with unicode pairs.support of recursive references between schemas.full support of remote references (remote schemas have to be added with addSchema or compiled to be available).all validation keywords (see JSON Schema validation keywords).Ajv implements JSON Schema draft-09/2020-12 standards (draft-04 is supported in v6):.Performance of different validators by json-schema-benchmark: json-schema-benchmark - 50% faster than the second place.GitHub sponsors page (GitHub will match it)Ījv generates code to turn JSON Schemas into super-fast validation functions that are efficient for v8 optimization.Ĭurrently Ajv is the fastest and the most standard compliant validator according to these benchmarks:.Your continuing support is very important - the funds will be used to develop and maintain Ajv once the next major version is released. Since I asked to support Ajv development 40 people and 6 organizations contributed via GitHub and OpenCollective - this support helped receiving the MOSS grant! DocumentationĪll documentation is available on the Ajv website. Please review Contributing guidelines and Code components. We welcome implementing new features that will benefit many users and ideas to improve our documentation. More than 100 people contributed to Ajv, and we would love to have you join the development. Supports JSON Schema draft-04/-09/2020-12 ( draft-04 support requires ajv-draft-04 package) and JSON Type Definition RFC8927. The fastest JSON validator for Node.js and browser.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |