1

注意!我不想针对 JSON Schema 验证 JSON!

我有 2 个 JSON 文件:

1. JSON Schema 文件:

{
    "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 Schema,我想验证它们。

例如:

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

2) James Newton-Kings 的回答

不走运,我如何验证 JSON Schema 本身?

4

0 回答 0