JSON
JSON Schema Validator
Validasi data JSON terhadap JSON Schema (gaya draft-07) — dengan jalur pasti dan penjelasan untuk setiap pelanggaran.
JSON Schema describes the expected structure of a JSON document — which fields are required, what type they are, and what constraints apply to their values. This tool checks actual data against a schema and shows the exact path to every violation.
How to use it
- Paste a JSON Schema into one field and the data to validate into the other.
- The result lists each violation separately: the exact path to the problem field and a plain-language explanation of why it doesn't match the schema.
- Valid data is immediately flagged as fully compliant with the schema.
Common uses
- Checking a third-party API response against its documented schema before integrating with it.
- Debugging your own JSON Schema — figuring out why seemingly valid data gets rejected.
- Validating a configuration file against a schema before deploying.
Things to keep in mind
JSON Schema has several versions (draft-07, 2019-09, 2020-12) with small syntax differences — check which version your production validator actually expects.
required only checks that a field is present, not its value — an empty string or null still counts as "present" if the type allows it.
Artikel tentang alat ini: JSON Schema: cara mendeskripsikan dan memvalidasi struktur JSON
Pertanyaan yang sering diajukan
Apa sebenarnya yang diperiksa saat memvalidasi terhadap JSON Schema?
Ini memeriksa apakah data JSON Anda cocok dengan aturan yang ditentukan dalam skema — field wajib, tipe data, rentang nilai, pola string, dan lainnya — bukan hanya memeriksa apakah JSON itu sendiri valid secara sintaksis.
Draft JSON Schema mana yang didukung alat ini?
Alat ini memvalidasi terhadap draft-07, salah satu versi yang paling banyak diadopsi — skema yang ditulis untuk draft lain mungkin menggunakan kata kunci yang tidak dikenali di sini.
Apakah skema atau data saya dikirim ke suatu tempat untuk validasi?
Tidak. Validasi berjalan sepenuhnya di browser Anda menggunakan pustaka JavaScript — tidak ada yang diunggah ke server.
Apa fungsi additionalProperties: false?
Secara default, sebuah objek boleh berisi field apa pun di luar yang dideskripsikan di properties. additionalProperties: false melarang field ekstra — berguna untuk menangkap salah ketik pada nama kunci atau field debug yang tidak sengaja tertinggal.
Bisakah sebuah field diperbolehkan memiliki beberapa tipe?
Bisa, melalui array di type, misalnya "type": ["string", "null"], jika field boleh berupa string atau null. Untuk kasus yang lebih kompleks, gunakan kata kunci oneOf, anyOf, atau allOf.