JSON Schema 生成器
从 JSON 示例生成 JSON Schema,自动推断类型、对象、数组和必填字段。
输入
结果
使用方法
Generating a schema
Paste a representative JSON document and press Generate. The tool infers a type for every value, merges the items of arrays and marks each property present in the sample as required.
- Paste a JSON sample.
- Press Generate.
- Adjust required fields and descriptions in the result.
常见问题
Which schema draft is produced?
The output declares the 2020-12 dialect, which is compatible with most modern validators.
How are arrays with mixed types handled?
The items schema becomes an anyOf list covering every observed type.