<img align="right" alt="Ajv logo" width="160" src="http://epoberezkin.github.io/ajv/images/ajv_logo.png">
# Ajv: Another JSON Schema Validator
The fastest JSON Schema validator for Node.js and browser. Supports draft-04/06/07.
[![Build Status](https://travis-ci.org/epoberezkin/ajv.svg?branch=master)](https://travis-ci.org/epoberezkin/ajv)
[![npm](https://img.shields.io/npm/v/ajv.svg)](https://www.npmjs.com/package/ajv)
[![npm downloads](https://img.shields.io/npm/dm/ajv.svg)](https://www.npmjs.com/package/ajv)
[![Coverage Status](https://coveralls.io/repos/epoberezkin/ajv/badge.svg?branch=master&service=github)](https://coveralls.io/github/epoberezkin/ajv?branch=master)
[![Gitter](https://img.shields.io/gitter/room/ajv-validator/ajv.svg)](https://gitter.im/ajv-validator/ajv)
[![GitHub Sponsors](https://img.shields.io/badge/$-sponsors-brightgreen)](https://github.com/sponsors/epoberezkin)
## Please [sponsor Ajv](https://github.com/sponsors/epoberezkin)
Dear Ajv users! â¤ï¸
I ask you to support the development of Ajv with donations. ð
Since 2015 Ajv has become widely used, thanks to your help and contributions:
- **90** contributors ð
- **5,000** dependent npm packages âï¸
- **7,000** github stars, from GitHub users [all over the world](https://www.google.com/maps/d/u/0/viewer?mid=1MGRV8ciFUGIbO1l0EKFWNJGYE7iSkDxP&ll=-3.81666561775622e-14%2C4.821737100000007&z=2) âï¸
- **5,000,000** dependent repositories on GitHub ð
- **120,000,000** npm downloads per month! ð¯
Your donations will fund futher development - small and large improvements, support of the next versions of JSON Schema specification, and, possibly, the code should be migrated to TypeScript to make it more maintainable.
I will greatly appreciate anything you can help with to make it happen:
- a **personal** donation - from $2 âï¸
- your **company** donation - from $10 ð
- a **sponsorship** to get promoted on Ajv or related packages - from $50 ð°
- an **introduction** to a sponsor who would benefit from the promotion on Ajv page ð¤
| Please [make donations via my GitHub sponsors page](https://github.com/sponsors/epoberezkin)<br>â¼ï¸ **GitHub will DOUBLE them** â¼ï¸ |
|---|
#### Open Collective sponsors
<a href="https://opencollective.com/ajv"><img src="https://opencollective.com/ajv/individuals.svg?width=890"></a>
<a href="https://opencollective.com/ajv/organization/0/website"><img src="https://opencollective.com/ajv/organization/0/avatar.svg"></a>
<a href="https://opencollective.com/ajv/organization/1/website"><img src="https://opencollective.com/ajv/organization/1/avatar.svg"></a>
<a href="https://opencollective.com/ajv/organization/2/website"><img src="https://opencollective.com/ajv/organization/2/avatar.svg"></a>
<a href="https://opencollective.com/ajv/organization/3/website"><img src="https://opencollective.com/ajv/organization/3/avatar.svg"></a>
<a href="https://opencollective.com/ajv/organization/4/website"><img src="https://opencollective.com/ajv/organization/4/avatar.svg"></a>
<a href="https://opencollective.com/ajv/organization/5/website"><img src="https://opencollective.com/ajv/organization/5/avatar.svg"></a>
<a href="https://opencollective.com/ajv/organization/6/website"><img src="https://opencollective.com/ajv/organization/6/avatar.svg"></a>
<a href="https://opencollective.com/ajv/organization/7/website"><img src="https://opencollective.com/ajv/organization/7/avatar.svg"></a>
<a href="https://opencollective.com/ajv/organization/8/website"><img src="https://opencollective.com/ajv/organization/8/avatar.svg"></a>
<a href="https://opencollective.com/ajv/organization/9/website"><img src="https://opencollective.com/ajv/organization/9/avatar.svg"></a>
## Using version 6
[JSON Schema draft-07](http://json-schema.org/latest/json-schema-validation.html) is published.
[Ajv version 6.0.0](https://github.com/epoberezkin/ajv/releases/tag/v6.0.0) that supports draft-07 is released. It may require either migrating your schemas or updating your code (to continue using draft-04 and v5 schemas, draft-06 schemas will be supported without changes).
__Please note__: To use Ajv with draft-06 schemas you need to explicitly add the meta-schema to the validator instance:
```javascript
ajv.addMetaSchema(require('ajv/lib/refs/json-schema-draft-06.json'));
```
To use Ajv with draft-04 schemas in addition to explicitly adding meta-schema you also need to use option schemaId:
```javascript
var ajv = new Ajv({schemaId: 'id'});
// If you want to use both draft-04 and draft-06/07 schemas:
// var ajv = new Ajv({schemaId: 'auto'});
ajv.addMetaSchema(require('ajv/lib/refs/json-schema-draft-04.json'));
```
## Contents
- [Performance](#performance)
- [Features](#features)
- [Getting started](#getting-started)
- [Frequently Asked Questions](https://github.com/epoberezkin/ajv/blob/master/FAQ.md)
- [Using in browser](#using-in-browser)
- [Command line interface](#command-line-interface)
- Validation
- [Keywords](#validation-keywords)
- [Annotation keywords](#annotation-keywords)
- [Formats](#formats)
- [Combining schemas with $ref](#ref)
- [$data reference](#data-reference)
- NEW: [$merge and $patch keywords](#merge-and-patch-keywords)
- [Defining custom keywords](#defining-custom-keywords)
- [Asynchronous schema compilation](#asynchronous-schema-compilation)
- [Asynchronous validation](#asynchronous-validation)
- [Security considerations](#security-considerations)
- [Security contact](#security-contact)
- [Untrusted schemas](#untrusted-schemas)
- [Circular references in objects](#circular-references-in-javascript-objects)
- [Trusted schemas](#security-risks-of-trusted-schemas)
- [ReDoS attack](#redos-attack)
- Modifying data during validation
- [Filtering data](#filtering-data)
- [Assigning defaults](#assigning-defaults)
- [Coercing data types](#coercing-data-types)
- API
- [Methods](#api)
- [Options](#options)
- [Validation errors](#validation-errors)
- [Plugins](#plugins)
- [Related packages](#related-packages)
- [Some packages using Ajv](#some-packages-using-ajv)
- [Tests, Contributing, History, Support, License](#tests)
## Performance
Ajv generates code using [doT templates](https://github.com/olado/doT) to turn JSON Schemas into super-fast validation functions that are efficient for v8 optimization.
Currently Ajv is the fastest and the most standard compliant validator according to these benchmarks:
- [json-schema-benchmark](https://github.com/ebdrup/json-schema-benchmark) - 50% faster than the second place
- [jsck benchmark](https://github.com/pandastrike/jsck#benchmarks) - 20-190% faster
- [z-schema benchmark](https://rawgit.com/zaggino/z-schema/master/benchmark/results.html)
- [themis benchmark](https://cdn.rawgit.com/playlyfe/themis/master/benchmark/results.html)
Performance of different validators by [json-schema-benchmark](https://github.com/ebdrup/json-schema-benchmark):
[![performance](https://chart.googleapis.com/chart?chxt=x,y&cht=bhs&chco=76A4FB&chls=2.0&chbh=32,4,1&chs=600x416&chxl=-1:|djv|ajv|json-schema-validator-generator|jsen|is-my-json-valid|themis|z-schema|jsck|skeemas|json-schema-library|tv4&chd=t:100,98,72.1,66.8,50.1,15.1,6.1,3.8,1.2,0.7,0.2)](https://github.com/ebdrup/json-schema-benchmark/blob/master/README.md#performance)
## Features
- Ajv implements full JSON Schema [draft-06/07](http://json-schema.org/) and draft-04 standards:
- all validation keywords (see [JSON Schema validation keywords](https://github.com/epoberezkin/ajv/blob/master/KEYWORDS.md))
- full support of remote refs (remote schemas have to be added with `addSchema` or compiled to be available)
- support of circular references between schemas
- correct string lengths for strings with unicode pairs (can be turned off)
- [formats](#formats) defined by JSON Schema draft-07 standard and custom formats (can be turned off)
- [validates schemas against meta-schema](#api-validateschema)
- supports [browsers](#using
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
【资源说明】 1、该资源包括项目的全部源码,下载可以直接使用! 2、本项目适合作为计算机、数学、电子信息等专业的课程设计、期末大作业和毕设项目,作为参考资料学习借鉴。 3、本资源作为“参考资料”如果需要实现其他功能,需要能看懂代码,并且热爱钻研,自行调试。 在线答题小程序源码+项目说明(可用于内部考核,考试预约,内部评分等)(基于云开发,免服务器和域名备案).zip 在线答题小程序源码+项目说明(可用于内部考核,考试预约,内部评分等)(基于云开发,免服务器和域名备案).zip 在线答题小程序源码+项目说明(可用于内部考核,考试预约,内部评分等)(基于云开发,免服务器和域名备案).zip 在线答题小程序源码+项目说明(可用于内部考核,考试预约,内部评分等)(基于云开发,免服务器和域名备案).zip 在线答题小程序源码+项目说明(可用于内部考核,考试预约,内部评分等)(基于云开发,免服务器和域名备案).zip 在线答题小程序源码+项目说明(可用于内部考核,考试预约,内部评分等)(基于云开发,免服务器和域名备案).zip
资源推荐
资源详情
资源评论
收起资源包目录
在线答题小程序源码+项目说明(可用于内部考核,考试预约,内部评分等)(基于云开发,免服务器和域名备案).zip (2030个子文件)
qunit.css 3KB
.DS_Store 10KB
.DS_Store 10KB
.DS_Store 10KB
.DS_Store 10KB
.DS_Store 10KB
.DS_Store 10KB
.DS_Store 10KB
.DS_Store 8KB
.DS_Store 8KB
.DS_Store 8KB
.DS_Store 8KB
.DS_Store 8KB
.DS_Store 8KB
.DS_Store 8KB
.DS_Store 8KB
.DS_Store 8KB
.DS_Store 6KB
.DS_Store 6KB
.DS_Store 6KB
.DS_Store 6KB
.DS_Store 6KB
.DS_Store 6KB
.DS_Store 6KB
.DS_Store 6KB
.DS_Store 6KB
.DS_Store 6KB
.DS_Store 6KB
.DS_Store 6KB
.DS_Store 6KB
.DS_Store 6KB
test-es5-min.html 615B
test-es5.html 611B
example.html 200B
tslib.es6.html 36B
tslib.html 32B
lodash.js 528KB
bson.bundle.js 291KB
index.js 231KB
bson.browser.umd.js 195KB
bson.browser.esm.js 188KB
bson.esm.js 188KB
bluebird.js 179KB
psl.js 149KB
psl.min.js 125KB
bluebird.core.js 120KB
core.js 112KB
bluebird.min.js 80KB
lodash.min.js 72KB
bluebird.core.min.js 56KB
uri.all.js 54KB
index.js 50KB
test.js 46KB
index.js 44KB
request.js 43KB
sax.js 43KB
index.js 41KB
cookie.js 40KB
semver.js 38KB
long.js 38KB
dashdash.js 34KB
tests.js 34KB
serializer.js 32KB
virtual-websocket-client.js 32KB
debuggability.js 31KB
virtual-websocket-client.js 31KB
qunit.js 27KB
promise.js 26KB
index.js 25KB
XMLNode.js 24KB
url.js 23KB
index.js 23KB
websocket-client.js 23KB
websocket-client.js 22KB
deserializer.js 22KB
decimal128.js 22KB
uri.js 20KB
x509.js 19KB
XMLDocumentCB.js 17KB
jsprim.js 17KB
uri.all.min.js 16KB
_baseConvert.js 16KB
tests.js 15KB
XMLWriterBase.js 15KB
ec.js 15KB
punycode.js 14KB
pkcs8.js 14KB
signer.js 13KB
tslib.js 13KB
parser.js 13KB
command.js 13KB
punycode.es6.js 12KB
punycode.es6.js 12KB
core.min.js 12KB
punycode.js 12KB
punycode.js 12KB
form_data.js 12KB
command.js 12KB
promisify.js 12KB
formats.js 12KB
共 2030 条
- 1
- 2
- 3
- 4
- 5
- 6
- 21
资源评论
土豆片片
- 粉丝: 1859
- 资源: 5869
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 吐鲁番地区实验中学教育管理规章制度(汇编).doc
- 体育教学评课稿.doc
- 外研版小学英语四年级(下册)知识点总结复习资料.doc
- 微观经济学(练习试题2及答案).doc
- 我国上市公司信息披露问题的探究.doc
- 微型计算机控制技术第4章习题答案.doc
- 小学生课外阅读现状分析报告.doc
- 物价知识培训教材.doc
- 新人版小学三年级语文第四单元.doc
- 小学数学作业批改评语集锦.doc
- 学生社会实践活动报告[精选多篇].doc
- 学校食堂自查报告[精选多篇].doc
- 新人版小学五年级上册英语教学计划.doc
- 移动L1认证考试代维传输线路题库一.doc
- 易班知识竞赛题库完整.doc
- 有效教学的三条铁律.doc
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功