相关疑难解决方法(0)

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'
                        }
                     }
                 }
            }
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

我想在children属性中表达的是它是一个具有相同精确模式的对象数组.这是描述它的正确方法吗?

json jsonschema

17
推荐指数
4
解决办法
1万
查看次数

标签 统计

json ×1

jsonschema ×1