Générateur et Validateur de JSON Schema (Draft-07)
Compatible hors-ligneGénérez des spécifications formelles JSON Schema (Draft-07, 2020-12) à partir de vos données JSON. Validation côté client, inférence de formats et export TypeScript.
{
"type": "object",
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "User Profile Record",
"$id": "https://api.toolsaa.com/schemas/user-profile.json",
"description": "Draft-07 validated schema specification inferred from user payload",
"properties": {
"id": {
"type": "string",
"format": "uuid",
"description": "Unique machine-readable identifier for this resource."
},
"username": {
"type": "string",
"description": "Unique account handle or username."
},
"email": {
"type": "string",
"format": "email",
"description": "Verified contact electronic mail address."
},
"isActive": {
"type": "boolean",
"description": "Boolean toggle indicating if entity is presently active."
},
"age": {
"type": "integer",
"description": "The age associated with this record."
},
"creditBalance": {
"type": "number",
"description": "The credit balance associated with this record."
},
"website": {
"type": "string",
"format": "uri",
"description": "Public web homepage or portal destination link."
},
"createdAt": {
"type": "string",
"format": "date-time",
"description": "ISO 8601 timestamp representing initial creation date."
},
"lastLoginIp": {
"type": "string",
"format": "ipv4",
"description": "The last login ip associated with this record."
},
"roles": {
"type": "array",
"description": "The roles associated with this record.",
"items": {
"type": "string",
"description": "The roles item associated with this record."
}
},
"address": {
"type": "object",
"description": "Physical geographical location or mailing destination.",
"properties": {
"street": {
"type": "string",
"description": "The street associated with this record."
},
"city": {
"type": "string",
"description": "The city associated with this record."
},
"postalCode": {
"type": "string",
"description": "The postal code associated with this record."
},
"country": {
"type": "string",
"description": "The country associated with this record."
},
"isPrimary": {
"type": "boolean",
"description": "The is primary associated with this record."
}
},
"required": [
"street",
"city",
"postalCode",
"country",
"isPrimary"
],
"additionalProperties": false
},
"metadata": {
"type": "object",
"description": "The metadata associated with this record.",
"properties": {
"department": {
"type": "string",
"description": "The department associated with this record."
},
"clearanceLevel": {
"type": "integer",
"description": "The clearance level associated with this record."
},
"onboardingCompleted": {
"type": "boolean",
"description": "The onboarding completed associated with this record."
}
},
"required": [
"department",
"clearanceLevel",
"onboardingCompleted"
],
"additionalProperties": false
}
},
"required": [
"id",
"username",
"email",
"isActive",
"age",
"creditBalance",
"website",
"createdAt",
"lastLoginIp",
"roles",
"address",
"metadata"
],
"additionalProperties": false
}Zéro violation du schéma Draft-07 détectée
Modifiez les champs à gauche ou cliquez sur les boutons ci-dessus pour injecter des erreurs de test.
export interface UserProfileRecord {
/** Unique machine-readable identifier for this resource. */
id: string;
/** Unique account handle or username. */
username: string;
/** Verified contact electronic mail address. */
email: string;
/** Boolean toggle indicating if entity is presently active. */
isActive: boolean;
/** The age associated with this record. */
age: number;
/** The credit balance associated with this record. */
creditBalance: number;
/** Public web homepage or portal destination link. */
website: string;
/** ISO 8601 timestamp representing initial creation date. */
createdAt: string;
/** The last login ip associated with this record. */
lastLoginIp: string;
/** The roles associated with this record. */
roles: string[];
/** Physical geographical location or mailing destination. */
address: Address;
/** The metadata associated with this record. */
metadata: Metadata;
}
export interface Address {
/** The street associated with this record. */
street: string;
/** The city associated with this record. */
city: string;
/** The postal code associated with this record. */
postalCode: string;
/** The country associated with this record. */
country: string;
/** The is primary associated with this record. */
isPrimary: boolean;
}
export interface Metadata {
/** The department associated with this record. */
department: string;
/** The clearance level associated with this record. */
clearanceLevel: number;
/** The onboarding completed associated with this record. */
onboardingCompleted: boolean;
}Exécution Locale Zéro-Connaissance
Tous les calculs et conversions sont exécutés exclusivement dans la mémoire de votre navigateur sans aucun transfert.
Moteur Réactif Ultra-Rapide
Pipeline de traitement sub-milliseconde offrant un rendu instantané à chaque frappe de touche sans latence.
Conformité aux Standards Officiels
Respect rigoureux des spécifications officielles de l'industrie pour une fiabilité maximale.
Générateur et Validateur de JSON Schema (Draft-07) Cheatsheet
Référence complète et moteur d'inférence pour JSON Schema Draft-07 et 2020-12 avec détection sémantique et génération d'interfaces TypeScript.
Paramètres clés et contrôles
| Paramètre | Type / Unité | Description | Par défaut |
|---|---|---|---|
| dialect | string | Dialecte de spécification (draft-07, draft-04, 2020-12). | draft-07 |
| requiredPolicy | string | Politique pour les champs obligatoires (all, none, common). | all |
| detectFormats | boolean | Détection automatique des formats date-time, email, uri, uuid. | true |
| strictAdditionalProperties | boolean | Applique additionalProperties: false de manière stricte. | false |
Conseils de pro et bonnes pratiques
Draft-07 offre la meilleure compatibilité avec Ajv, Python jsonschema et OpenAPI 3.0.
Basculez sur l'onglet TypeScript pour exporter vos interfaces de modèle.
Testez vos cas limites directement dans l'onglet Validateur interactif.
Pièges courants et dépannage
⚠️Tableaux à types multiples
Des types différents créent une union. Normalisez les éléments pour obtenir un schéma homogène.
⚠️Format de date non reconnu
Vérifiez la conformité avec le format ISO 8601 (YYYY-MM-DDTHH:mm:ssZ).
Foire aux questions (FAQ)
Quels dialectes sont pris en charge ?▼
Draft-07, Draft-04, Draft-06 et Draft 2020-12.
Le schéma est-il compatible avec Ajv ?▼
Oui, directement utilisable avec new Ajv().compile(schema).
Mes données sont-elles envoyées sur un serveur distant ?▼
Non. Tout s'exécute strictement en mémoire côté client.
Quels formats de chaîne sont inférés ?▼
date-time, email, uri, uuid, ipv4, ipv6 et entiers (integer).
Outils et utilitaires connexes
Tous les outils →Transformez les interfaces, types et commentaires JSDoc TypeScript en définitions JSON Schema standard pour API et formulaires.
Formatez, embellissez, validez et réparez vos flux JSON en ligne instantanément. Corrigez les erreurs de syntaxe, clés sans guillemets, minifiez et inspectez l'AST sans aucun transfert serveur.
Déduisez les définitions de schéma XML (XSD), les types complexes, les attributs et les règles minOccurs/maxOccurs à partir de JSON.
Déduisez et convertissez des objets JSON en schéma de table Google Cloud BigQuery avec mode RECORD, STRING, INTEGER, NUMERIC et TIMESTAMP.
Convertissez les schémas GraphQL (SDL) en JSON Schema (Draft 2020-12 / Draft-07) et OpenAPI 3.0 / 3.1 avec gestion stricte de la nullabilité et résolution des références.
Convertissez vos données JSON en interfaces ou alias de type TypeScript propres et typés, avec inférence automatique des structures imbriquées.