2

在我的 json 模式文件中,我试图将一个引用属性 $ref 强加给用户。但是,以下不起作用

-- sampleSchema.json -- 
{
"definitions": {
    "items": {
        "type": "object",
        "properties": {
            "ref": {
                "type": "string"
            }
        }
    }
},
"properties": {
    "items" :  {
        "$ref": "#/definitions/items"
    }
}

}

所需的输出是用户必须提供参考路径的地方。

-- whatever.json -- 
{
    "$schema" :  "sampleSchema.json?reload",
    "items": {
    "$ref": "/myEntityReferenceOfChoice"
        }   
}

如果我将 $ in 留在模式文件中,则它不起作用。如果我只是为了“参考”而把它拿出来。我可以强制用户提供 $ref 吗?

我正在使用 Visual Studio 2013 ..

4

0 回答 0