How to use JSON Schema Validator and Sample Generator
- Choose Validate document, Generate a validated sample, or Generate schema from JSON sample.
- For validation, enter a supported schema and a JSON document, or choose a UTF-8 document file. A selected file replaces the document text. For sample generation, enter the schema.
- For schema inference, enter your sample in JSON document to validate, or choose its file. This mode observes the sample and does not use the schema input.
- Read validation findings, the rechecked generated example or the inferred rules. Download the JSON result if needed, then review it against the intended consumer’s requirements.
Example: JSON Schema Validator and Sample Generator
Check a required name and an optional nonnegative integer age against the supported schema rules.
Options
- Validation and sample generation
- Validation checks the entered document against the supported constraints. Sample generation searches a bounded set of candidates and validates the chosen one with the same checks. Failure to generate does not prove that every possible document is invalid.
- Schema inference
- The inference mode records observed types and properties. It does not infer required keys, permitted values or business constraints from one example. Review mixed arrays and unusual structures before reusing the generated rules.
- Supported keywords
- The subset accepts $schema for the stated 2020-12 dialect, title, description, default, examples, type, enum, const, properties, required, additionalProperties, items, minItems, maxItems, minLength, maxLength, minimum, maximum, exclusiveMinimum, exclusiveMaximum, allOf, anyOf and oneOf. Boolean schemas are also supported. References, patterns, format and other keywords are refused.
Supported inputs and limits
- A bounded 2020-12-compatible subset, not full draft conformance.
- Schema input is limited to 100,000 UTF-8 bytes, 500 schema nodes and 12 schema levels.
- Document input is limited to 1,000,000 UTF-8 bytes, 20,000 nodes and 32 levels; repeated object keys are refused.
- Schema inference has a tighter 1,000-value and 12-level limit.
- Validation caps findings at 200 and work at 50,000 operations.
More details
Sample generation uses at most 256 candidate steps and 200,000 cumulative validation operations; contradictory or difficult combinations can fail.
JSON numbers use JavaScript finite-number comparisons.
No reference URL is fetched and no API schema connection occurs.
Where your input is processed
This tool does not upload your inputs. See the limits for anything saved on your device.
A passing sample is only one allowed case
A generated example does not show every valid document or establish that a complete JSON Schema implementation would accept the schema. Check required fields, additional properties and numeric/string limits against the consumer’s needs. Contradictory constraints can prevent sample generation even when the input text is valid JSON.
Questions about JSON Schema Validator and Sample Generator
Does a result certify full JSON Schema compliance?
No. Only the supported keywords are checked. Unknown keywords are refused.
Are remote references downloaded?
No. References are unsupported and no schema URL is fetched.
Can every valid schema produce a sample?
No. Generation has a bounded search and can refuse contradictory or difficult supported combinations.