Json Schema参考资产

时间:2014-11-01 07:49:22

标签: json jsonschema json-schema-validator

在我的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 ..

0 个答案:

没有答案
相关问题