注意!我不想针对JSON模式验证JSON!
我有2个JSON文件:
1。。JSON模式文件:
{
"title" : "SomeTitle",
"type":"object",
"properties":{
"City" : {"type" : "string", "editType" : "textarea"}
}
}
2。。JSON文件:
{
"Elements": [{
"name": "XYZ",
"cities": ["XY", "QW", "ER", "TY"]
}, {
"name": "ASD",
"cities": ["AS", "SD", "DF"]
}
]
}
我想验证这两个文件是否可以用作JSON模式。
例如:
First file -> true (Means that it can be used as JSON Schema)
Second file -> false
我已经尝试过:
1)JSchema schema = JSchema.Parse(stringSchema); // It parses without any exception, and Valid property is null
不走运,如何验证JSON模式本身?