在线工具集
正在加载,请稍候…
正在加载,请稍候…
从 JSON 样本推断字段类型、必填项与嵌套结构,生成规范的 JSON Schema Draft 2020-12 定义。
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "User",
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"name": {
"type": "string"
},
"age": {
"type": "integer"
},
"active": {
"type": "boolean"
},
"tags": {
"type": "array",
"items": {
"type": "string"
}
},
"address": {
"type": "object",
"properties": {
"city": {
"type": "string"
},
"zipcode": {
"type": "string"
}
},
"required": [
"city",
"zipcode"
]
}
},
"required": [
"id",
"name",
"age",
"active",
"tags",
"address"
]
}说明