Ajv

Ajv

ajv.js.org

2

About this website

Ajv (Another JSON Schema Validator) is the fastest and most feature-complete JSON Schema validator for JavaScript and TypeScript, created and maintained by Evgeny Poberezkin. It has become the de facto standard JSON Schema validation library in the JavaScript ecosystem, used by major projects including Express.js middleware (express-json-validator), OpenAPI/Swagger validation, Fastify (as the built-in serializer and validator), React Hook Form (for schema-based form validation), and thousands of other libraries and applications. In benchmarks, Ajv consistently outperforms other JSON Schema validators by 2x to 10x, compiling schemas into highly optimized validation functions that execute at near-native JavaScript speeds. Key features include: support for JSON Schema draft-04, draft-06, draft-07, draft 2019-09, and draft 2020-12 standards; TypeScript type generation from JSON Schema definitions, providing compile-time type safety that matches runtime validation; support for OpenAPI 3.0 and 3.1 schemas; format validation for strings (date-time, email, uri, uuid, ipv4, ipv6, and over 30 other built-in formats); support for custom keywords and macros for extending the schema vocabulary; asynchronous validation for schemas that require external lookups or database queries; schema compilation with code generation (compiling a schema once into a validation function and reusing it for all subsequent validations); strict mode for detecting schema issues like extra properties, typos, and potentially incorrect constraints; and support for $data references (using data values from the validated instance as schema values). The library has zero runtime dependencies in its core module and supports both Node.js and browser environments. As of 2026, Ajv has over 14,000 GitHub stars and over 40 million weekly npm downloads.

Statistics

2
Views
0
Clicks
0
Like
0
Dislike

Comments

Log In to post a comment

No comments yet. Be the first!