<img align="right" alt="Ajv logo" width="160" src="https://ajv.js.org/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/ajv-validator/ajv.svg?branch=master)](https://travis-ci.org/ajv-validator/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/github/ajv-validator/ajv/badge.svg?branch=master)](https://coveralls.io/github/ajv-validator/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 development](https://github.com/sponsors/epoberezkin)
I will get straight to the point - I need your support to ensure that the development of Ajv continues.
I have developed Ajv for 5 years in my free time, but it is not sustainable. I'd appreciate if you consider supporting its further development with donations:
- [GitHub sponsors page](https://github.com/sponsors/epoberezkin) (GitHub will match it)
- [Ajv Open Collectiveï¸](https://opencollective.com/ajv)
There are many small and large improvements that are long due, including the support of the next versions of JSON Schema specification, improving website and documentation, and making Ajv more modular and maintainable to address its limitations - what Ajv needs to evolve is much more than what I can contribute in my free time.
I would also really appreciate any advice you could give on how to raise funds for Ajv development - whether some suitable open-source fund I could apply to or some sponsor I should approach.
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! ð¯
I believe it would benefit all Ajv users to help put together the fund that will be used for its further development - it would allow to bring some additional maintainers to the project.
Thank you
#### 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/ajv-validator/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/ajv-validator/ajv/blob/master/FAQ.md)
- [Using in browser](#using-in-browser)
- [Ajv and Content Security Policies (CSP)](#ajv-and-content-security-policies-csp)
- [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, Changes history](#tests)
- [Support, Code of conduct, License](#open-source-software-support)
## 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](http
没有合适的资源?快使用搜索试试~ 我知道了~
校友小程序,云开发,前后端,MVVM模式
共2000个文件
js:2015个
ts:555个
md:310个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
5星 · 超过95%的资源 1 下载量 66 浏览量
2022-06-14
09:27:17
上传
评论
收藏 7.29MB ZIP 举报
温馨提示
校友平台小程序,采用云开发技术,操作简单,类似博客,功能齐全,可进行发布帖子,相册,可以查看其它校友信息,分享等,可以进行后台管理员端登录操作。环境基于Node,云函数采用JavaScript,前后端代码分离。
资源推荐
资源详情
资源评论
收起资源包目录
校友小程序,云开发,前后端,MVVM模式 (2000个子文件)
site.slate.css 153KB
site.amelia.css 149KB
site.cyborg.css 145KB
site.superhero.css 142KB
site.darkstrap.css 140KB
site.flatly.css 140KB
site.spacelab.css 137KB
site.cosmo.css 136KB
site.spruce.css 136KB
site.cerulean.css 136KB
site.simplex.css 134KB
site.journal.css 133KB
site.united.css 130KB
site.readable.css 126KB
darkstrap.css 24KB
sunlight.dark.css 8KB
sunlight.default.css 8KB
jsdoc-default.css 5KB
qunit.css 3KB
prettify-tomorrow.css 2KB
prettify-jsdoc.css 1KB
Date.html 94KB
date-utils.js.html 33KB
index.html 5KB
classes.list.html 4KB
test-es5-min.html 615B
test-es5.html 611B
example.html 200B
tslib.es6.html 36B
tslib.html 32B
lodash.js 530KB
docstrap.lib.js 305KB
bson.bundle.js 291KB
protobuf.js 268KB
source-map.debug.js 266KB
ajv.bundle.js 264KB
index.js 237KB
protobuf.js 224KB
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
ajv.min.js 118KB
core.js 112KB
source-map.js 104KB
jquery.min.js 81KB
bluebird.min.js 80KB
protobuf.js 78KB
lodash.min.js 71KB
protobuf.min.js 70KB
nacl-fast.js 61KB
protobuf.min.js 61KB
bluebird.core.min.js 56KB
uri.all.js 54KB
browser-source-map-support.js 52KB
date-utils.js 52KB
index.js 50KB
merge.js 49KB
index.js 48KB
diff.js 47KB
test.js 46KB
URI.js 46KB
index.js 44KB
request.js 43KB
sax.js 43KB
index.es6.js 42KB
index.js 41KB
cookie.js 40KB
source-map-consumer.js 40KB
long.js 39KB
semver.js 38KB
date-validate-test.js 38KB
index.js 35KB
dashdash.js 34KB
tests.js 34KB
sunlight.js 34KB
we-cropper.js 32KB
serializer.js 32KB
nacl.js 32KB
virtual-websocket-client.js 32KB
virtual-websocket-client.js 32KB
nacl-fast.min.js 32KB
debuggability.js 31KB
virtual-websocket-client.js 31KB
virtual-websocket-client.js 31KB
ccmini_mock.js 30KB
base.js 30KB
index.js 29KB
qunit.js 28KB
index.spec.js 28KB
static.js 27KB
source-map.min.js 26KB
promise.js 26KB
index.js 25KB
index.js 25KB
node-esm-resolve-implementation.js 24KB
XMLNode.js 24KB
共 2000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 20
资源评论
- 小YI在努力变强2023-01-18非常有用的资源,可以直接使用,对我很有用,果断支持!
CoderRobin10
- 粉丝: 1
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功