JSON から JSON Schema (Draft-07) 自動生成&検証ツール
オフライン対応JSON ペイロードから Draft-07 / 2020-12 仕様の厳格な JSON Schema を自動推論。クライアントサイド検証、セマンティックフォーマット推論、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
}Draft-07 スキーマ違反は 0 件です
左ペインのフィールドを変更するか、上のボタンでテストエラーを注入してリアルタイム検証結果を確認できます。
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;
}ゼロナレッジ・完全ローカル実行
すべてのデータ処理、解析、コード生成はお使いのブラウザ内部メモリで完結します。外部サーバーへの送信はゼロです。
超高速・即時リアクティブ演算
最適化されたクライアント側解析パイプラインにより、キーストロークと同時に遅延なくリアルタイムで結果を生成します。
公式仕様準拠・高信頼アーキテクチャ
公式仕様や構文ルールに厳密に準拠し、境界ケースの安全な処理と堅牢な出力を保証します。
JSON から JSON Schema (Draft-07) 自動生成&検証 — 技術リファレンス
JSON ペイロードから Draft-07 / 2020-12 準拠の厳格なスキーマを自動推論。セマンティックフォーマット検知、対話型バリデーション、TypeScript 型定義生成に対応。
主要パラメータと設定項目
| パラメータ | 型・単位 | 説明 | 初期値 |
|---|---|---|---|
| dialect | string | 対象となる JSON Schema 仕様方言(draft-07, draft-04, 2020-12)。 | draft-07 |
| requiredPolicy | string | 必須フィールド(required)の推論ポリシー(all, none, common)。 | all |
| detectFormats | boolean | 文字列の日時、メール、UUID、URL 等のフォーマット自動検知。 | true |
| strictAdditionalProperties | boolean | 未知のプロパティを禁止する additionalProperties: false を明示的に付与。 | false |
現場のベストプラクティス・実践Tips
Draft-07 は Ajv (Node.js)、Python jsonschema、OpenAPI 3.0 等で最も広くサポートされているため、特別な理由がない限り Draft-07 の採用を推奨します。
スキーマ生成後、「TypeScript」タブに切り替えることで、フロントエンド/バックエンド共通のインターフェース定義をワンクリック取得可能です。
「対話型バリデーター」タブにて、生成されたスキーマに対してエッジケースの JSON を流し込み、拒否・許容ルールを即座にテストできます。
よくある落とし穴とトラブルシューティング
⚠️配列内の要素で型が混在してユニオン型になる
配列内に数値と文字列が混在している場合、仕様通り ["string", "number"] が生成されます。均一な型にしたい場合は入力サンプルを統一してください。
⚠️日時文字列が date-time フォーマットとして認識されない
ISO 8601 形式(例: 2026-10-14T00:00:00Z)に準拠しているか確認してください。
よくある質問 (FAQ)
どの JSON Schema バージョンに対応していますか?▼
Draft-07(標準推奨)、Draft-04、Draft-06、および最新の Draft 2020-12 に対応しています。
生成されたスキーマは Ajv でそのまま動作しますか?▼
はい。Ajv の new Ajv().compile(schema) にそのまま渡して即座にバリデーション実行可能です。
推論処理で外部の AI API やサーバー通信は発生しますか?▼
いいえ。すべての AST 解析、型推論、スキーマ構築はブラウザ内部で 100% 完結します。
どのようなフォーマットを自動推論できますか?▼
date-time (ISO 8601)、email、uri (URL)、uuid (RFC 4122)、ipv4、ipv6、および integer (整数) を自動判別します。
関連ツール&ユーティリティ
全ツール一覧 →TypeScriptのinterface、typeエイリアス、JSDocコメントを標準JSON Schemaへ高精度変換。API仕様書やフォーム構築に最適。
不正な構文やクォート漏れのあるJSONをブラウザ上で即座に整形・検証・修復します。サーバー送信なしの完全ローカル処理で、構文チェック、圧縮、ツリー構造の可視化に対応します。
サンプルJSONからXMLスキーマ定義(XSD)の型構造、複合要素、属性、minOccurs/maxOccursルールを高精度に自動推論。
JSON オブジェクトを Google Cloud BigQuery のテーブルスキーマ JSON (RECORD、STRING、INTEGER、NUMERIC、TIMESTAMP) に自動変換。
GraphQLスキーマ定義(SDL)をJSON Schema(Draft 2020-12 / Draft-07)およびOpenAPI 3.0 / 3.1スキーマへ高速変換。厳格なNull許容性、列挙型、参照解決に対応。
JSONデータを解析し、洗練されたTypeScriptのinterfaceやtypeエイリアスへ変換。ネストされたオブジェクトや配列の型推論に対応。