【发布时间】:2020-06-16 23:23:34
【问题描述】:
有什么方法可以让我从父级继承另一个 JSON 模式并覆盖 feedbackperson 模式中的名字和姓氏
我的场景 我有一个人模式,我想用 FeedbackPerson 模式复制它,但使用继承。
例如:
//人物架构
{
"$schema": "http://json-schema.org/draft-06/schema",
"description": "Personal and contact details of a customer",
"type": "object",
"required": [
"salutationAndTitle",
"firstName",
"lastName"
],
"properties": {
"salutationAndTitle": {
"$ref": "../abcfd.json"
},
"firstName": {
"$ref": "../FirstName.json"
},
"middleName": {
"description": "Middle name",
"type": "string",
"maxLength": 31,
"autocomplete": "additional-name",
"x-faker": "name.firstName",
"example": "abc"
},
"lastName": {
"$ref": "../LastName.json"
}
}
}
【问题讨论】:
标签: json inheritance overriding schema