【发布时间】:2017-07-23 19:45:10
【问题描述】:
我正在构建要在 JSON 编辑器中使用的 JSON 模式。 在一个数组中将是一组对象。这些对象中的每一个都有一个属性“id”,它应该是一个唯一标识符。
{
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"name": {
"type": "string",
"title": "Name"
},
"brief": {
"type": "string",
"title": "Brief description"
}
},
"required": ["id", "name"]
}
}
是否可以在架构中指定 ID 应该:
- 自最后一个对象 ID 递增,或
- 设置为当前时间戳
【问题讨论】:
标签: json schema jsonschema