【发布时间】:2014-01-12 05:07:39
【问题描述】:
我有一个 JSON 架构
{
'description': 'TPNode',
'type': 'object',
'id': 'tp_node',
'properties': {
'selector': {
'type': 'string',
'required': true
},
'attributes': {
'type': 'array',
'items': {
'name': 'string',
'value': 'string'
}
},
'children': {
'type': 'array',
'items': {
'type': 'object',
'$ref': '#'
}
},
'events': {
'type': 'array',
'items': {
'type': 'object',
'properties': {
'type': {
'type': 'string'
},
'handler': {
'type': 'object'
},
'dependencies': {
'type': 'array',
'items': {
'type': 'string'
}
}
}
}
}
}
}
我想在 children 属性中表达的是,它是一个具有相同模式的对象数组。这是描述它的正确方式吗?
【问题讨论】:
-
为什么使用 v3 语法?
"required"是 v4 中的一个数组。 -
你是对的。但是,我通过 JSON.NET 验证架构,我发现它不支持 v4 语法。
标签: json jsonschema