,例如,我有一个带有值3的“ foo”属性的文档。我想确保“ bar”属性是至少3
的字符串 samplejson
{
"foo": 3,
"bar": "111"
}
json模式
{
"properties" : {
"foo": {
"type": "integer",
"minimum": 1
}
"bar": {
"type": "string",
"minLength": "{$foo}"
}
}
}
有一个v5
关键字的proposal,它将“ wallow schemas使用来自数据的值,使用JSON Pointers或相对JSON POINTERS指定的值”。