How to Validate JSON Data Against a JSON Schema
Enter the JSON data and its JSON Schema in their separate fields, run the check, and review the validity details. A successful operation status only means the check completed; inspect validity to see whether the data passed.
What this JSON Schema check is for
If an application accepts JSON configuration, API payloads, or event data, checking that data against a JSON Schema can reveal structural problems before the data moves to the next stage. JSON Schema Validator compares JSON data with a schema and reports whether the data is valid, along with applicable validation details. It accepts the data and schema as separate text inputs, so you can review or adjust either one without combining them first.
Use the validator when you want to check declared types, required properties, additional-property rules, array items, or scalar limits such as enum membership, numeric minimums and maximums, and string length. The checks apply recursively to nested values where the relevant rules are declared. The tool does not establish complete coverage of every JSON Schema feature, so treat the result as a check of the supported rules rather than proof that a document satisfies every possible standard feature.
How to validate JSON data against a schema
-
Prepare two text documents. In the JSON data field, enter the value you want to check. In the JSON Schema field, enter the schema that describes the expected structure. Both fields are optional, but leaving either one empty or entering only whitespace produces a not-valid result identifying the missing JSON or schema.
-
Make sure both documents are valid JSON before checking them. The validator parses the data and the schema first. A parsing failure produces a not-valid outcome with a parse-error description, so inspect punctuation, quotation marks, commas, brackets, and braces if the input cannot be parsed.
-
Run the validation. The schema can declare string, number, integer, boolean, object, and array types. For objects, it can check present declared properties, required properties, and, when configured, undeclared properties. For arrays, an items rule can validate each item recursively. You can also include supported enum, numeric minimum and maximum, and string minimum and maximum length rules.
-
Review the validity result and its details. If the data fails, use the reported rule or location to compare the value with the schema. Correct either the JSON data or the schema, then run the check again. Keep the schema and data as separate inputs so it remains clear which document defines the expectation and which document is being tested.
How to read the result
A valid result means the parsed data passed the checks applied by the supplied schema. For example, a declared string property is checked as a string, while an integer subject to a minimum can fail when its value is below that minimum. A missing required property, an undeclared property when additional properties are disabled, an array item that fails its item schema, or a value outside a declared enum or range can make the data not valid.
Keep the operation status separate from validity. The reviewed behavior reports a successful operation status for missing input, parse failures, valid data, and data that fails validation. That status indicates that the check completed; it does not mean that the JSON data passed.
The result should be interpreted within the rules the validator implements. Do not use it as evidence that references, composition, formats, pattern rules, or every other JSON Schema capability has been enforced. If your schema depends on such features, confirm them with a validator that explicitly supports them or test those requirements separately.
Worked example
A developer checks an event payload before accepting it into a processing workflow.
Suppose an event payload contains an integer order count, while its schema declares that property as an integer with a minimum of zero. Enter the payload in the JSON data field, enter the schema in the schema field, and run the validation. Then review whether the validity outcome passes or identifies the value as below the declared minimum.
The result should report whether the data is valid and provide applicable validation details, such as a failed type, required-property, or numeric-minimum check when one applies.
Limitations
- The runtime contract declares network access as false, but that fact does not establish a browser-only deployment, privacy or storage behavior, account requirements, or confidentiality guarantees.
- Validation is limited to the checks implemented for the supplied schema. The reviewed behavior does not establish support for references, composition, formats, pattern rules, complete JSON Schema standards coverage, or universal schema compatibility.
Common errors
- A frequent mistake is pasting malformed JSON into either field. Correct the syntax in the data and schema separately, then run the check again; a parse failure is reported as not valid with a parse-error description.
FAQ
Can the validator find a missing required property?
Yes, when the schema declares the property as required. A missing required property is reported as not valid.
What happens if my JSON or schema has a syntax error?
It parses both text fields before validation. If either document cannot be parsed as JSON, the result is not valid and includes a parse-error description.
Does this validate every JSON Schema feature?
It checks declared string, number, integer, boolean, object, and array types, including nested values where the rules apply. It does not prove support for every JSON Schema feature, such as references, composition, formats, or pattern rules.