我想要一个模式,它描述了一个值,它本身就是一个 JSON 模式,例如
{
"title": "Schema modification event",
"description": "Describes and event of modification of another (arbitrary) JSON schema",
"type": "object",
"properties": {
"field_name": {
"type": "string",
"format": "json-pointer",
"description": "Location where change occurred"
},
"field_schema": {
"$ref": "https://json-schema.org/draft-07/schema",
"description": "New schema of the location"
}
},
"required": [
"field_name",
"field_schema"
]
}
模式没有类型,但是您对
field_schema
所做的工作应该可以确保 field_schema
是一个 JSON 模式。
您将无法在同一操作中处理
field_name
usingfield_schema
中的架构。你必须分几个步骤来做:
field_name
指向的任何地方和field_schema
处的模式提取新数据。field_schema
模式验证新数据。