JSON
JSON Schema Validator
Convalida di dati JSON rispetto a un JSON Schema (stile draft-07) — con percorso esatto e spiegazione per ogni violazione.
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.
Articolo su questo strumento: JSON Schema: come descrivere e validare la struttura di un JSON
Domande frequenti
A cosa serve questo validatore di JSON Schema?
Verifica se un documento JSON rispetta le regole definite in un JSON Schema (stile draft-07), segnalando il percorso esatto e la spiegazione di ogni violazione.
Cosa significa in pratica un errore di validazione?
Significa che il valore in quel percorso non soddisfa un vincolo dello schema: può essere un tipo errato, una proprietà obbligatoria mancante, un pattern non rispettato o un valore fuori intervallo.
Lo schema e i dati vengono elaborati su un server?
No, la validazione avviene interamente nel browser con JavaScript; né lo schema né i dati vengono inviati altrove.
Cosa fa additionalProperties: false?
Per impostazione predefinita, un oggetto può contenere qualsiasi campo oltre a quelli descritti in properties. additionalProperties: false vieta i campi extra — utile per intercettare un errore di battitura nel nome di una chiave o un campo di debug lasciato per errore.
Si può descrivere un campo che ammette più tipi?
Sì, con un array in type, ad esempio "type": ["string", "null"], se il campo può essere una stringa o null. Per casi più complessi si usano le parole chiave oneOf, anyOf o allOf.