【发布时间】:2019-06-25 08:09:12
【问题描述】:
例如,在 JSON 架构中,拥有 $ref 和其他属性是有效的。
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"title": "My schema",
"properties": {
"scripts": {
"$ref": "#/definitions/scriptsBase",
"description": "More docs.",
"minLength": 10
}
},
"definitions": {
"scriptsBase": {
"type": "string",
"description": "Base Description",
"minLength": 5
}
}
}
如果这是允许的,那么在解析$refed 和$refing 模式中定义的属性时有什么规则(在本例中为minLength 和description。但这可能会变成如果allOf 等都在两者中定义,则要复杂得多。
【问题讨论】:
标签: jsonschema jsonpath json-schema-validator jsonpointer json-ref