Infer un JSON Schéma de sample données
Générer a JSON Schema that describes the structure of a JSON instance, for validation and documentation.
- 1
A JSON Schema describes the shape of JSON data — required fields, types, formats, constraints. Inferring a schema from sample data gives you a validation contract and documentation without hand-writing the schema.
- 2 Générateur de schémas JSON →
Paste a JSON instance (ideally with all fields populated). The tool infers types, required properties, array item types, and emits a JSON Schema (draft 2020-12).
- 3 Validateur JSON →
Valider other instances against the generated schema to confirm they conform. Mismatches reveal fields that are missing, extra, or wrong-typed.
Questions fréquentes
- The schema is too permissive — how do I add constraints?
- Inferred schemas capture observed types but not business rules. Manually add constraints: string format (date-time, email), number minimum/maximum, string minLength/maxLength, enum values, and additionalProperties: false to reject unknown fields.
- Should I infer from one sample or many?
- Many. A single sample misses optional fields (fields absent in that instance become required) and union types (a field that is sometimes null). Provide multiple instances or manually mark fields optional after inference.
Workflows résolvant cette tâche
Convertir la casse de nommage et valider en JSON
Convertir les identifiants en convention de nommage cible, puis valider le résultat en JSON pour confirmer la structure. PIPELINE
Formater JS et valider JSON
Formater le code JS puis valider en JSON. PIPELINE
Minifier et valider JSON
Formater JSON pour inspection et valider sa correction syntaxique en une passe. PIPELINE
Générer JSON Schema et valider
Générer un JSON Schema à partir de données d'exemple puis valider par rapport à lui. PIPELINE
Valider et formater YAML
Convertir YAML en JSON pour valider sa structure, puis confirmer que le JSON est bien forme. PIPELINE
Outils associés
Générateur de schémas JSON
Generate JSON Schema from JSON data. Gratuit, privé, 100% côté client. OUTIL
Validateur JSON
Validate JSON and pinpoint syntax errors by line and column. Gratuit, privé et 100% côté client. OUTIL
Formateur JSON
Format, minify, or sort JSON online. Gratuit, privé et 100% côté client. OUTIL