我想检查语法上正确但语义上不正确的 JSON 模式本身。
例如
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "http://example.com/root.json",
"type": "object",
"required": [
"checked"
],
"properties": {
"checked": {
"$id": "#/properties/checked",
"type_invalid":"string"
}
}
}
在上面的示例中,有type_invalid键不正确,它应该是type。有什么方法可以验证 JSON 模式本身吗?
供参考:我正在使用ajv针对 JSON 模式验证 JSON。