【发布时间】:2016-05-11 06:09:21
【问题描述】:
我有一个架构,我必须将其属性合并到另一个架构中。假设以下是必须包含其属性的架构:
{"$schema": "http://json-schema.org/schema#",
"title": "native",
"type": "object",
"required": ["executable"],
"properties":
{
"job_name":
{
"type":"string",
"dname": "job name"
},
"executable":
{
"type":"string",
"dname":"server",
"description": "server name"
}
}}
包含上述架构的架构为:
{"$schema": "http://json-schema.org/schema#",
"title": "application",
"type": "object",
"required": ["app_name"],
"properties":
{
"app_name":
{
"type":"string",
"dname": "app name"
}
}}
我想将第一个模式的属性合并到第二个模式中,使第二个模式看起来像:
{"$schema": "http://json-schema.org/schema#",
"title": "native",
"type": "object",
"required": ["executable","app_name"],
"properties":
{
"job_name":
{
"type":"string",
"dname": "job name"
},
"executable":
{
"type":"string",
"dname":"server",
"description": "server name"
}
"app_name":
{
"type":"string",
"dname": "app name"
}
}}
此外,“必填”字段被添加到第二个架构中。 有没有可能的方法?
【问题讨论】:
标签: json jsonschema