Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

The fastest JSON schema Validator. Supports JSON Schema draft-04/06/07/2019-09/2020-12 and JSON Type Definition (RFC8927)

License

NotificationsYou must be signed in to change notification settings

ajv-validator/ajv

Repository files navigation

Ajv logo

 

Ajv JSON schema validator

The fastest JSON validator for Node.js and browser.

Supports JSON Schema draft-04/06/07/2019-09/2020-12 (draft-04 support requires ajv-draft-04 package) and JSON Type DefinitionRFC8927.

buildnpmnpm downloadsCoverage StatusSimpleXGitterGitHub Sponsors

Ajv sponsors

Mozilla

Microsoft

RetoolTideliftSimpleX

Contributing

More than 100 people contributed to Ajv, and we would love to have you join the development. We welcome implementing new features that will benefit many users and ideas to improve our documentation.

Please reviewContributing guidelines andCode components.

Documentation

All documentation is available on theAjv website.

Some useful site links:

Since I asked to support Ajv development 40 people and 6 organizations contributed via GitHub and OpenCollective - this support helped receiving the MOSS grant!

Your continuing support is very important - the funds will be used to develop and maintain Ajv once the next major version is released.

Please sponsor Ajv via:

Thank you.

Open Collective sponsors

Performance

Ajv generates code 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:

Performance of different validators byjson-schema-benchmark:

performance

Features

Install

To install version 8:

npm install ajv

Getting started

Try it in the Node.js REPL:https://runkit.com/npm/ajv

In #"auto" data-snippet-clipboard-copy-content="// or ESM/TypeScript importimport Ajv from "ajv"// Node.js require:const Ajv = require("ajv")const ajv = new Ajv() // options can be passed, e.g. {allErrors: true}const schema = { type: "object", properties: { foo: {type: "integer"}, bar: {type: "string"}, }, required: ["foo"], additionalProperties: false,}const data = { foo: 1, bar: "abc",}const validate = ajv.compile(schema)const valid = validate(data)if (!valid) console.log(validate.errors)">

// or ESM/TypeScript importimportAjvfrom"ajv"// Node.js require:constAjv=require("ajv")constajv=newAjv()// options can be passed, e.g. {allErrors: true}constschema={type:"object",properties:{foo:{type:"integer"},bar:{type:"string"},},required:["foo"],additionalProperties:false,}constdata={foo:1,bar:"abc",}constvalidate=ajv.compile(schema)constvalid=validate(data)if(!valid)console.log(validate.errors)

Learn how to use Ajv and see more examples in theGuide: getting started

Changes history

Seehttps://github.com/ajv-validator/ajv/releases

Please note:Changes in version 8.0.0

Version 7.0.0

Version 6.0.0.

Code of conduct

Please review and follow theCode of conduct.

Please report any unacceptable behaviour toajv.validator@gmail.com - it will be reviewed by the project team.

Security contact

To report a security vulnerability, please use theTidelift security contact.Tidelift will coordinate the fix and disclosure. Please do NOT report security vulnerabilities via GitHub issues.

Open-source software support

Ajv is a part ofTidelift subscription - it provides a centralised support to open-source software users, in addition to the support provided by software maintainers.

License

MIT

About

The fastest JSON schema Validator. Supports JSON Schema draft-04/06/07/2019-09/2020-12 and JSON Type Definition (RFC8927)

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks


[8]ページ先頭

©2009-2025 Movatter.jp