JSON格式校验

json-schemajson

{
    "$schema":"http://json-schema.org/draft-04/schema",
    "type":"object",
    "properties":{
        "a":{
            "type":"array",
            "items":{
                "type":"object",
                "properties":{
                    "b":{
                        "type":"integer"
                    }
                }
            }
        }
    },
    "required":["a"]
}

以上规则能够校验如下的json数据ui

{
    "a":[
        {
            "b":9
        }
    ]
}
相关文章
相关标签/搜索