我想在父 json 架构中引用子架构。这是名为 child.json 的子架构
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Child",
"description": "Child schema",
"type": "object",
"properties": {
"name": {"type": "string"},
"age": {"type": "integer"}
}}
这是名为 parent.json 的父模式,所有两个文件都在同一个文件夹中。我想引用子架构,我这样做:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Parent",
"description": "Parent schema",
"type": "object",
"properties": {
"allOf": [
{
"$ref": "file://child.json"
}
],
"adresse": {"type": "string"}
}}
我有一个错误说找不到文件 child.json。我已经测试了很多东西,但任何人都在工作。
谢谢你的帮助