我有一个 JSONSchema 将有一些项目。现在定义这些项目的模式需要在主模式中引用吗?
* one schema that you reference:
{
"id": "http://some.where/sub/schema#",
"type": "object",
"properties": {
"p1": {
"type": "integer",
"minimum": 12
}
}
}
--- * the main schema: ----
{
"id": "http://path.to/base/schema#",
"type": "array",
"items": {
"extends": {
"$ref": "http://some.where/sub/schema#/properties/p1"
},
"divisibleBy": 5
}
}
另请注意,我将在该项目中有多个项目。我在 api 中看不到这样做的方法。api 也不允许我添加自定义属性。我怎样才能做到这一点?我正在使用JSON.net。