我有一个JSON模式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'
}
}
}
}
}
}
}
我试图在孩子财产表达的是,它是对象的数组用完全相同的架构。这是描述它的正确方法吗?
你为什么要使用V3的语法? '“required”'是v4中的一个数组。 – cloudfeet
你是对的。不过,我正在通过JSON.NET验证模式,因为我发现它不支持v4语法。 – William