JSON AJV Schema Validator

Validate JSON data against JSON Schema using AJV (Another JSON Validator) with support for Draft-07 and Draft 2020-12

Schema Draft:

What is JSON AJV Schema Validator?

AJV (Another JSON Validator) is the fastest JSON Schema validator for JavaScript. It supports JSON Schema Draft-07 and Draft 2020-12, providing comprehensive validation with detailed error reporting. This tool uses AJV to validate your JSON data against a JSON Schema definition, reporting all validation errors with their exact paths and keyword information.

How to Use

  1. Select the JSON Schema draft version (Draft-07 or Draft 2020-12)
  2. Paste your JSON Schema definition in the left panel
  3. Paste your JSON data in the right panel
  4. Click Validate to check data against the schema
  5. Review any validation errors with their paths, messages, and keywords
  6. Fix the data and re-validate until all errors are resolved

Why Use This Tool?

Full JSON Schema Draft-07 and Draft 2020-12 support
Comprehensive validation with all standard keywords
Detailed error messages with JSON paths
Support for formats (email, uri, date, etc.)
Support for complex schemas (allOf, anyOf, oneOf, $ref)
Fast and reliable validation powered by AJV

Tips & Best Practices

  • Use $schema property to specify the draft version explicitly
  • Draft 2020-12 supports new keywords like unevaluatedProperties
  • Use 'allErrors: true' behavior to see all validation errors at once
  • Combine with JSON Schema Generator to create schemas from sample data
  • Use $ref for reusable schema definitions and better organization

Frequently Asked Questions

What is AJV and why use it?

AJV (Another JSON Validator) is the most widely used JSON Schema validator in the JavaScript ecosystem. It's extremely fast, supports both JSON Schema Draft-07 and Draft 2020-12, and provides comprehensive validation with detailed error reporting. It's used by major projects like Ajv, Fastify, and many others.

What's the difference between Draft-07 and Draft 2020-12?

Draft 2020-12 is the latest JSON Schema specification with new features like unevaluatedProperties, dynamic references ($dynamicRef), and improved vocabulary support. Draft-07 is the previous stable version with wide tooling support. Both are fully supported by AJV.

What keywords are supported?

AJV supports all standard JSON Schema keywords: type, properties, required, items, enum, const, pattern, minLength, maxLength, minimum, maximum, exclusiveMinimum, exclusiveMaximum, multipleOf, minItems, maxItems, uniqueItems, minProperties, maxProperties, additionalProperties, allOf, anyOf, oneOf, not, if/then/else, $ref, and more.

How do I use $ref for reusable schemas?

Use $ref to reference other parts of your schema. Example: { "$ref": "#/definitions/user" } references a definition at the root. This is useful for avoiding repetition and creating modular schemas.

What formats are supported?

AJV supports built-in formats: date, time, date-time, uri, uri-reference, uri-template, email, hostname, ipv4, ipv6, uuid, json-pointer, relative-json-pointer, and regex. You can also add custom formats if needed.

How is this different from the basic JSON Schema Validator?

This tool uses AJV, a full-featured JSON Schema validator that supports all standard keywords including advanced ones like allOf, anyOf, oneOf, $ref, if/then/else, and more. The basic validator only supports a subset of keywords for simpler schemas.

Related Tools