JSON Schema Validator
Paste a schema and your data to see every rule that fails, where it fails and why, check a whole export line by line, and start from a schema inferred from sample data.
Berjalan dalam pelayar anda. Fail anda tidak pernah meninggalkan peranti. Lihat cara menyemaknya
…
Cara melakukannya
- 1Paste the schema
Add your JSON Schema, open a .json file or tap Sample.
- 2Paste the data
Add one document, an array of records or JSON Lines.
- 3Choose the mode
Pick the draft and whether to validate one document, each item or each line.
- 4Read the errors
Open each document to see the path, keyword, message and schema path of every error.
- 5Fix and re-check
Edit the data or schema; results update as you type, with undo if needed.
- 6Export the report
Download the errors as CSV or the full report as JSON.
Tentang alat ini
JSON Schema is the common way to describe what a valid JSON document looks like: which properties are required, what type each one has, which values are allowed and how nested objects are shaped. OpenAPI descriptions, configuration files, VS Code settings, data contracts between teams and the structured output of language models all use it. When a request is rejected with a vague validation error, or a nightly import fails on one record out of ten thousand, you need to know exactly which value broke which rule. This validator gives that answer for every document you paste. Each error shows the instance path, such as /address/country, the keyword that failed, a plain message such as Does not match the pattern ^[A-Z]{2}$, and the schema path, such as #/$defs/address/properties/country/pattern, so you can find the rule in a long schema. All errors are listed, not just the first, so one run is enough to fix a document.
Supported keywords
Types and enumerations: type, enum and const. Numbers: minimum, maximum, exclusiveMinimum and exclusiveMaximum in both the newer number form and the draft 4 boolean form, and multipleOf. Strings: minLength and maxLength counted in Unicode characters, pattern with Unicode regular expressions, and format checks for date, time, date-time, email, hostname, ipv4, ipv6, uri, uuid, regex, json-pointer and duration. Arrays: items, prefixItems, additionalItems for older drafts, contains with minContains and maxContains, minItems, maxItems and uniqueItems. Objects: properties, patternProperties, additionalProperties, propertyNames, required, minProperties, maxProperties, dependentRequired, dependentSchemas and the older dependencies. Combinations: allOf, anyOf, oneOf, not and if, then and else. In 2019-09 and 2020-12, unevaluatedProperties and unevaluatedItems see properties covered by subschemas.
References and drafts
$ref works with pointers into the same schema such as #/$defs/address, with $anchor names and with $id values defined inside the schema. The draft is read from $schema, and you can override it. In draft 7 and earlier, $ref ignores sibling keywords, as those drafts require; from 2019-09 on, siblings are evaluated too.
Batch checks
When the data is an array and the schema does not describe an array, each item is validated on its own and labelled item 0, item 1 and so on. JSON Lines input is checked line by line with line numbers. The summary counts invalid documents and errors, and both an error CSV and a full JSON report can be downloaded for a ticket or a data quality log.
Limits
References to other files or URLs are not fetched, because the tool works offline; paste referenced definitions into $defs instead. Format checks follow the common syntax rules and do not look up whether an email address or host really exists. Custom vocabularies, $dynamicRef edge cases and content keywords such as contentMediaType are not validated. Results should match mainstream validators for typical schemas, but this is not a certified implementation.
Contoh berselesaian
A team checks three customer records against a 2020-12 schema that requires id, email and plan, limits plan to free, pro or team, requires seats when plan is team and forbids extra properties. Item 0 passes. Item 1 has id 0, email not-an-email, plan team without seats and country bd, and gets 4 errors: minimum at /id, format at /email, required seats from the then branch, and pattern at /address/country. Item 2 gets 3 errors: plan gold is not in the enum, tags has two identical items, and phone is not an allowed property. The summary shows 2 invalid of 3 checked with 7 errors in total, and the CSV report lists all 7 with their paths.
Ringkasnya
- Kategori: Pembangun & data
- Berjalan dalam pelayar, tanpa pendaftaran, tanpa muat naik.
- Maklumat yang anda masukkan kekal pada peranti anda.
- Tersedia dalam bahasa Inggeris.
- Kandungan disemak kali terakhir:
- Sumber rasmi: JSON Schema 2020-12 Core and Validation specifications (json-schema.org)
Soalan lazim
Which draft does it use?
The one named in $schema, or 2020-12 when there is none. You can force draft 2019-09, 7, 6 or 4 with the Draft menu.
Can it validate many records at once?
Yes. An array of records is checked item by item, and JSON Lines input is checked line by line. Choose Whole input as one document when the array itself is what the schema describes.
Why are there errors from anyOf or oneOf branches?
When no branch matches, the tool reports the anyOf or oneOf failure and adds the errors of the closest branch, which is usually the one you meant.
Does it load $ref from a URL?
No. Only references inside the pasted schema are resolved. Copy external definitions into $defs and point to them with #/$defs/name.
Can it write a schema for me?
Schema from data builds a starting schema from your sample: types, nested properties, required fields present in every record and formats it recognises. Review and tighten it before using it as a contract.
Is my data uploaded?
No. Validation runs in your browser and the inputs are kept only in this browser's local storage.
