csvjson

JSON Schema Validator

Paste a JSON Schema and a JSON document to validate them against each other. All errors are shown with the field path, error message, and failing keyword. Uses AJV with Draft-07 support.

Common schema keywords

The most-used JSON Schema Draft-07 keywords

KeywordDescription
typeConstrain the value type: "string", "number", "integer", "boolean", "array", "object", "null".
requiredArray of property names that must be present in the object.
propertiesDefine the schema for each named property. Properties not listed are allowed by default.
additionalPropertiesSet to false to reject any properties not listed in 'properties'. Set to a schema to constrain them.
enumValue must be one of the listed values exactly.
minimum / maximumNumeric range constraints (inclusive). Use exclusiveMinimum / exclusiveMaximum for strict bounds.
minLength / maxLengthString length constraints.
patternString must match this regex (ECMA 262 syntax).
itemsSchema that every element of an array must satisfy.
minItems / maxItemsArray length constraints.
$refReference another schema definition. Use with $defs or definitions for reusable sub-schemas.

Common use cases

API contract validation

Define a schema for request/response bodies and validate incoming data before processing. Catch missing fields and wrong types at the boundary.

Config file validation

Validate JSON configuration files (package.json, tsconfig.json, .eslintrc) against a schema before the application loads them.

CI pipeline data checks

Add a validation step to your CI pipeline to ensure data exports, fixtures, or seed files match the expected schema before they're deployed.

Webhook payload testing

Paste a webhook payload and your expected schema to verify the structure matches before writing integration code.

Frequently asked questions

What is JSON Schema?

JSON Schema is a vocabulary for describing and validating the structure of JSON documents. A schema defines the expected types, required fields, value ranges, and formats. It's used for API request/response validation, configuration file validation, and data contract enforcement.

Which JSON Schema draft does this support?

This tool uses AJV (Another JSON Validator) with Draft-07 support. Draft-07 is the most widely adopted version and covers all common use cases. Draft 2019-09 and Draft 2020-12 introduced new keywords (unevaluatedProperties, $vocabulary) that are not supported here.

What does additionalProperties: false do?

It rejects any JSON object that contains a property not listed in the 'properties' keyword. Without it, JSON Schema allows extra properties by default. Use additionalProperties: false when you want a strict contract — any unexpected field will fail validation.

How do I validate an array of objects?

Use type: "array" at the top level with an items keyword pointing to the object schema: { "type": "array", "items": { "type": "object", "properties": { ... } } }. Every element in the array will be validated against the items schema.

What is the difference between minimum and exclusiveMinimum?

minimum: 0 allows 0 and any larger number. exclusiveMinimum: 0 allows any number strictly greater than 0 — 0 itself fails. In Draft-07, exclusiveMinimum is a number. In older drafts it was a boolean paired with minimum.