{"name":"ajv","description":"Another JSON Schema Validator","dist-tags":{"latest":"8.11.0"},"versions":{"8.11.0":{"name":"ajv","version":"8.11.0","description":"Another JSON Schema Validator","main":"dist/ajv.js","types":"dist/ajv.d.ts","scripts":{"eslint":"eslint \"lib/**/*.ts\" \"spec/**/*.*s\" --ignore-pattern spec/JSON-Schema-Test-Suite","prettier:write":"prettier --write \"./**/*.{json,yaml,js,ts}\"","prettier:check":"prettier --list-different \"./**/*.{json,yaml,js,ts}\"","test-spec":"cross-env TS_NODE_PROJECT=spec/tsconfig.json mocha -r ts-node/register \"spec/**/*.spec.{ts,js}\" -R dot","test-codegen":"nyc cross-env TS_NODE_PROJECT=spec/tsconfig.json mocha -r ts-node/register 'spec/codegen.spec.ts' -R spec","test-debug":"npm run test-spec -- --inspect-brk","test-cov":"nyc npm run test-spec","rollup":"rm -rf bundle && rollup -c","bundle":"rm -rf bundle && node ./scripts/bundle.js ajv ajv7 ajv7 && node ./scripts/bundle.js 2019 ajv2019 ajv2019 && node ./scripts/bundle.js 2020 ajv2020 ajv2020 && node ./scripts/bundle.js jtd ajvJTD ajvJTD","build":"rm -rf dist && tsc && cp -r lib/refs dist && rm dist/refs/json-schema-2019-09/index.ts && rm dist/refs/json-schema-2020-12/index.ts && rm dist/refs/jtd-schema.ts","json-tests":"rm -rf spec/_json/*.js && node scripts/jsontests","test-karma":"karma start","test-browser":"rm -rf .browser && npm run bundle && scripts/prepare-tests && karma start","test-all":"npm run test-cov && if-node-version 12 npm run test-browser","test":"npm run json-tests && npm run prettier:check && npm run eslint && npm link && npm link --legacy-peer-deps ajv && npm run test-cov","test-ci":"AJV_FULL_TEST=true npm test","prepublish":"npm run build","benchmark":"npm i && npm run build && npm link && cd ./benchmark && npm link --legacy-peer-deps ajv && npm i && node ./jtd","docs:dev":"./scripts/prepare-site && vuepress dev docs","docs:build":"./scripts/prepare-site && vuepress build docs"},"nyc":{"exclude":["**/spec/**","node_modules"],"reporter":["lcov","text-summary"]},"repository":{"type":"git","url":"git+https://github.com/ajv-validator/ajv.git"},"author":{"name":"Evgeny Poberezkin"},"license":"MIT","bugs":{"url":"https://github.com/ajv-validator/ajv/issues"},"runkitExampleFilename":".runkit_example.js","dependencies":{"fast-deep-equal":"^3.1.1","json-schema-traverse":"^1.0.0","require-from-string":"^2.0.2","uri-js":"^4.2.2"},"devDependencies":{"@ajv-validator/config":"^0.3.0","@rollup/plugin-commonjs":"^21.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^13.0.0","@rollup/plugin-typescript":"^8.2.1","@types/chai":"^4.2.12","@types/mocha":"^9.0.0","@types/node":"^17.0.0","@types/require-from-string":"^1.2.0","@typescript-eslint/eslint-plugin":"^3.8.0","@typescript-eslint/parser":"^3.8.0","ajv-formats":"^3.0.0-rc.0","browserify":"^17.0.0","chai":"^4.0.1","cross-env":"^7.0.2","dayjs":"^1.10.4","dayjs-plugin-utc":"^0.1.2","eslint":"^7.8.1","eslint-config-prettier":"^7.0.0","fast-uri":"^1.0.0","glob":"^7.0.0","husky":"^7.0.1","if-node-version":"^1.0.0","jimp":"^0.16.1","js-beautify":"^1.7.3","json-schema-test":"^2.0.0","karma":"^6.0.0","karma-chrome-launcher":"^3.0.0","karma-mocha":"^2.0.0","lint-staged":"^12.1.1","mocha":"^9.0.2","module-from-string":"^3.1.3","node-fetch":"^3.0.0","nyc":"^15.0.0","prettier":"^2.3.1","re2":"^1.16.0","rollup":"^2.44.0","rollup-plugin-terser":"^7.0.2","ts-node":"^10.0.0","tsify":"^5.0.2","typescript":"^4.2.0"},"collective":{"type":"opencollective","url":"https://opencollective.com/ajv"},"funding":{"type":"github","url":"https://github.com/sponsors/epoberezkin"},"prettier":"@ajv-validator/config/prettierrc.json","husky":{"hooks":{"pre-commit":"lint-staged && npm test"}},"lint-staged":{"*.{json,yaml,js,ts}":"prettier --write"},"gitHead":"c067d6d9c3285054ea4c0a2d2adbbc8b5d631935","_id":"ajv@8.11.0","_nodeVersion":"14.19.0","_npmVersion":"6.14.16","dist":{"integrity":"sha512-wGgprdCvMalC0BztXvitD2hC04YffAvtsUn93JbGXYLAtCUO4xd17mCCZQxUOItiBwZvJScWo8NIvQMQ71rdpg==","shasum":"977e91dd96ca669f54a11e23e378e33b884a565f","tarball":"http://localhost:4260/ajv/ajv-8.11.0.tgz","fileCount":466,"unpackedSize":1016907,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiOktjACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoJaxAAlaVvTQ2Odj3CLA5v+enMW0jEAGeGlyYxD0Ts+DiQAB4WfJNX\r\nVe0RbcTH/zgnFoDlDEOfcx1/1fEDGn92EfMNH4B+ltJE5qyOPaAVYZeE4+A3\r\nl7P3z01LhKtp911KBXT4DaZ1VXAwvr9rc5tubleEy5iv51Pr9Y2ytB8jNXtC\r\nUpTlwJbKlgP8xvyBs/rZLG7igxdWsA1UWSWU3o90eKBB1Bg6fL8is8ZPMabR\r\nPSINIR4L7T2dSSUlsdzs7RijmZQbu9rzc/Wzz+JR9rc7eufoMUkj0nXkMg84\r\nFP7A3zVGuRZyw0/2dOL3yqMn58DHQaVayFiHQhPDWfG2OJwpTIvDKAuMP2kE\r\nIT3215DU3aUdQvPLNCsSz2B1LnjVPJKOIwAOCRCx5AG+S6jQf2cZWs4QHBzH\r\n6LczlMxWyktXuZvW7a5EvuQGPfaWXGC/uhzXoFUQdukvyez6kR8Ud5tm2yDZ\r\n1KVRxuvq9y+7ZrtHgn4EquzXanJRny6glk5qwlNcxVY5mKPWnxoFgX2W5f4+\r\navGLINZXtGr9prKOyobeQ0kmRP6BPs7QG2NR8eCGrZXVNDD5PU0qM8qPpCoq\r\nnns6qwr7wk3reYcMXewd7ZDP1FaXED/VOmZFCLkK5DlWO12BHCcddpOfZiS5\r\n+l0dQlmSC3TBRvuzsAv2BzTSw19SeHFebto=\r\n=GDNg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBvHJRPXJkPRNoscrSJ8kMjkbE/LlkpAlxhMcZma8ljPAiEAoT5UriPgOHdP72VlfTAzIq6qQyMFATTzsNuwOhTbU1U="}]},"directories":{},"_hasShrinkwrap":false}},"readme":"\n\n \n\n# Ajv JSON schema validator\n\nThe fastest JSON validator for Node.js and browser.\n\nSupports JSON Schema draft-04/06/07/2019-09/2020-12 ([draft-04 support](https://ajv.js.org/json-schema.html#draft-04) requires ajv-draft-04 package) and JSON Type Definition [RFC8927](https://datatracker.ietf.org/doc/rfc8927/).\n\n[![build](https://github.com/ajv-validator/ajv/workflows/build/badge.svg)](https://github.com/ajv-validator/ajv/actions?query=workflow%3Abuild)\n[![npm](https://img.shields.io/npm/v/ajv.svg)](https://www.npmjs.com/package/ajv)\n[![npm downloads](https://img.shields.io/npm/dm/ajv.svg)](https://www.npmjs.com/package/ajv)\n[![Coverage Status](https://coveralls.io/repos/github/ajv-validator/ajv/badge.svg?branch=master)](https://coveralls.io/github/ajv-validator/ajv?branch=master)\n[![SimpleX](https://img.shields.io/badge/chat-on%20SimpleX-%2307b4b9)](https://simplex.chat/contact#/?v=1&smp=smp%3A%2F%2Fu2dS9sG8nMNURyZwqASV4yROM28Er0luVTx5X1CsMrU%3D%40smp4.simplex.im%2Fap4lMFzfXF8Hzmh-Vz0WNxp_1jKiOa-h%23MCowBQYDK2VuAyEAcdefddRvDfI8iAuBpztm_J3qFucj8MDZoVs_2EcMTzU%3D)\n[![Gitter](https://img.shields.io/gitter/room/ajv-validator/ajv.svg)](https://gitter.im/ajv-validator/ajv)\n[![GitHub Sponsors](https://img.shields.io/badge/$-sponsors-brightgreen)](https://github.com/sponsors/epoberezkin)\n\n## Ajv sponsors\n\n[](https://www.mozilla.org)[](https://opencollective.com/ajv)\n\n[](https://opensource.microsoft.com)[](https://opencollective.com/ajv)[](https://opencollective.com/ajv)\n\n[](https://retool.com/?utm_source=sponsor&utm_campaign=ajv)[](https://tidelift.com/subscription/pkg/npm-ajv?utm_source=npm-ajv&utm_medium=referral&utm_campaign=enterprise)[](https://github.com/simplex-chat/simplex-chat)[](https://opencollective.com/ajv)\n\n## Contributing\n\nMore 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.\n\nPlease review [Contributing guidelines](./CONTRIBUTING.md) and [Code components](https://ajv.js.org/components.html).\n\n## Documentation\n\nAll documentation is available on the [Ajv website](https://ajv.js.org).\n\nSome useful site links:\n- [Getting started](https://ajv.js.org/guide/getting-started.html)\n- [JSON Schema vs JSON Type Definition](https://ajv.js.org/guide/schema-language.html)\n- [API reference](https://ajv.js.org/api.html)\n- [Strict mode](https://ajv.js.org/strict-mode.html)\n- [Standalone validation code](https://ajv.js.org/standalone.html)\n- [Security considerations](https://ajv.js.org/security.html)\n- [Command line interface](https://ajv.js.org/packages/ajv-cli.html)\n- [Frequently Asked Questions](https://ajv.js.org/faq.html)\n\n## Please [sponsor Ajv development](https://github.com/sponsors/epoberezkin)\n\nSince I asked to support Ajv development 40 people and 6 organizations contributed via GitHub and OpenCollective - this support helped receiving the MOSS grant!\n\nYour continuing support is very important - the funds will be used to develop and maintain Ajv once the next major version is released.\n\nPlease sponsor Ajv via:\n\n- [GitHub sponsors page](https://github.com/sponsors/epoberezkin) (GitHub will match it)\n- [Ajv Open Collective️](https://opencollective.com/ajv)\n\nThank you.\n\n#### Open Collective sponsors\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n## Performance\n\nAjv generates code to turn JSON Schemas into super-fast validation functions that are efficient for v8 optimization.\n\nCurrently Ajv is the fastest and the most standard compliant validator according to these benchmarks:\n\n- [json-schema-benchmark](https://github.com/ebdrup/json-schema-benchmark) - 50% faster than the second place\n- [jsck benchmark](https://github.com/pandastrike/jsck#benchmarks) - 20-190% faster\n- [z-schema benchmark](https://rawgit.com/zaggino/z-schema/master/benchmark/results.html)\n- [themis benchmark](https://cdn.rawgit.com/playlyfe/themis/master/benchmark/results.html)\n\nPerformance of different validators by [json-schema-benchmark](https://github.com/ebdrup/json-schema-benchmark):\n\n[![performance](https://chart.googleapis.com/chart?chxt=x,y&cht=bhs&chco=76A4FB&chls=2.0&chbh=62,4,1&chs=600x416&chxl=-1:|ajv|@exodus/schemasafe|is-my-json-valid|djv|@cfworker/json-schema|jsonschema&chd=t:100,69.2,51.5,13.1,5.1,1.2)](https://github.com/ebdrup/json-schema-benchmark/blob/master/README.md#performance)\n\n## Features\n\n- Ajv implements JSON Schema [draft-06/07/2019-09/2020-12](http://json-schema.org/) standards (draft-04 is supported in v6):\n - all validation keywords (see [JSON Schema validation keywords](https://ajv.js.org/json-schema.html))\n - [OpenAPI](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.3.md) extensions:\n - NEW: keyword [discriminator](https://ajv.js.org/json-schema.html#discriminator).\n - keyword [nullable](https://ajv.js.org/json-schema.html#nullable).\n - full support of remote references (remote schemas have to be added with `addSchema` or compiled to be available)\n - support of recursive references between schemas\n - correct string lengths for strings with unicode pairs\n - JSON Schema [formats](https://ajv.js.org/guide/formats.html) (with [ajv-formats](https://github.com/ajv-validator/ajv-formats) plugin).\n - [validates schemas against meta-schema](https://ajv.js.org/api.html#api-validateschema)\n- NEW: supports [JSON Type Definition](https://datatracker.ietf.org/doc/rfc8927/):\n - all keywords (see [JSON Type Definition schema forms](https://ajv.js.org/json-type-definition.html))\n - meta-schema for JTD schemas\n - \"union\" keyword and user-defined keywords (can be used inside \"metadata\" member of the schema)\n- supports [browsers](https://ajv.js.org/guide/environments.html#browsers) and Node.js 10.x - current\n- [asynchronous loading](https://ajv.js.org/guide/managing-schemas.html#asynchronous-schema-loading) of referenced schemas during compilation\n- \"All errors\" validation mode with [option allErrors](https://ajv.js.org/options.html#allerrors)\n- [error messages with parameters](https://ajv.js.org/api.html#validation-errors) describing error reasons to allow error message generation\n- i18n error messages support with [ajv-i18n](https://github.com/ajv-validator/ajv-i18n) package\n- [removing-additional-properties](https://ajv.js.org/guide/modifying-data.html#removing-additional-properties)\n- [assigning defaults](https://ajv.js.org/guide/modifying-data.html#assigning-defaults) to missing properties and items\n- [coercing data](https://ajv.js.org/guide/modifying-data.html#coercing-data-types) to the types specified in `type` keywords\n- [user-defined keywords](https://ajv.js.org/guide/user-keywords.html)\n- additional extension keywords with [ajv-keywords](https://github.com/ajv-validator/ajv-keywords) package\n- [\\$data reference](https://ajv.js.org/guide/combining-schemas.html#data-reference) to use values from the validated data as values for the schema keywords\n- [asynchronous validation](https://ajv.js.org/guide/async-validation.html) of user-defined formats and keywords\n\n## Install\n\nTo install version 8:\n\n```\nnpm install ajv\n```\n\n## Getting started\n\nTry it in the Node.js REPL: https://runkit.com/npm/ajv\n\nIn JavaScript:\n\n```javascript\n// or ESM/TypeScript import\nimport Ajv from \"ajv\"\n// Node.js require:\nconst Ajv = require(\"ajv\")\n\nconst ajv = new Ajv() // options can be passed, e.g. {allErrors: true}\n\nconst schema = {\n type: \"object\",\n properties: {\n foo: {type: \"integer\"},\n bar: {type: \"string\"}\n },\n required: [\"foo\"],\n additionalProperties: false,\n}\n\nconst data = {\n foo: 1,\n bar: \"abc\"\n}\n\nconst validate = ajv.compile(schema)\nconst valid = validate(data)\nif (!valid) console.log(validate.errors)\n```\n\nLearn how to use Ajv and see more examples in the [Guide: getting started](https://ajv.js.org/guide/getting-started.html)\n\n## Changes history\n\nSee [https://github.com/ajv-validator/ajv/releases](https://github.com/ajv-validator/ajv/releases)\n\n**Please note**: [Changes in version 8.0.0](https://github.com/ajv-validator/ajv/releases/tag/v8.0.0)\n\n[Version 7.0.0](https://github.com/ajv-validator/ajv/releases/tag/v7.0.0)\n\n[Version 6.0.0](https://github.com/ajv-validator/ajv/releases/tag/v6.0.0).\n\n## Code of conduct\n\nPlease review and follow the [Code of conduct](./CODE_OF_CONDUCT.md).\n\nPlease report any unacceptable behaviour to ajv.validator@gmail.com - it will be reviewed by the project team.\n\n## Security contact\n\nTo report a security vulnerability, please use the\n[Tidelift security contact](https://tidelift.com/security).\nTidelift will coordinate the fix and disclosure. Please do NOT report security vulnerabilities via GitHub issues.\n\n## Open-source software support\n\nAjv is a part of [Tidelift subscription](https://tidelift.com/subscription/pkg/npm-ajv?utm_source=npm-ajv&utm_medium=referral&utm_campaign=readme) - it provides a centralised support to open-source software users, in addition to the support provided by software maintainers.\n\n## License\n\n[MIT](./LICENSE)\n","homepage":"https://ajv.js.org","repository":{"type":"git","url":"git+https://github.com/ajv-validator/ajv.git"},"author":{"name":"Evgeny Poberezkin"},"bugs":{"url":"https://github.com/ajv-validator/ajv/issues"},"license":"MIT","readmeFilename":"README.md"}