java - 是否有任何库可以使用 java 或 springboot 或 nodejs 将多个 json 模式组合成单个模式
问题描述
我有一个 Json 模式数组的输入,我需要将这些多个模式组合成单个模式,那么 java 或 springboot 中是否有任何库可以将多个模式组合成单个模式
我找到了我们可以使用nodejs https://www.npmjs.com/package/json-schema-merge-allof做的链接, 但步骤不清楚,所以无法理解实现它
我的输入 json 模式数组如下
[
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "PartyAddressArray",
"description": "PartyAddressArray",
"type": "array",
"items": {
"$ref": "PartyAddress"
}
},
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "PartyAddress",
"description": "PartyAddress",
"type": "object",
"properties": {
"id": {
"description": "The unique identifier for a partyAddress",
"type": "string"
},
"partyId": {
"description": "The associated partyId for a partyAddress",
"type": "string"
},
"addressType": {
"description": "The address type for a partyAddress",
"type": "string",
"enum": [
"HOME",
"WORK",
"PERMANENT",
"COMMUNICATION",
"REGISTERED",
"SAIL",
"BUSINESS"
]
},
"languageCode": {
"description": "The language code for a partyAddress",
"type": "string",
"maxLength": 10
},
"statusType": {
"description": "The status type for a partyAddress",
"type": "string",
"enum": [
"PAST",
"CURRENT",
"FUTURE"
]
},
"effectiveDate": {
"description": "The effective date for a partyAddress",
"type": "string",
"format": "date"
},
"endDate": {
"description": "The end date for a partyAddress",
"type": "string",
"format": "date"
},
"postalAddress": {
"description": "The postal address for a partyAddress",
"$ref": "PostalAddress"
}
},
"required": [
"addressType",
"statusType"
],
"example": {
"id": "b9e2d964-e3ef-4c04-aaa9-31c46122e4g5",
"partyId": "ff77a7a1-a637-40d2-b8f5-7da261f8bdc3",
"addressType": "HOME",
"languageCode": "EG",
"statusType": "CURRENT",
"effectiveDate": "13/03/2019",
"endDate": "19/03/2019",
"postalAddress": {
"country": "India",
"state": "MH",
"city": "Mumbai",
"zip": "40060",
"line1": "Goregoan East1",
"line2": "Goregoan East2",
"line3": "Goregoan East3",
"line4": "Goregoan East4",
"line5": "Goregoan East5",
"line6": "Goregoan East6",
"line7": "Goregoan East7",
"line8": "Goregoan East8",
"line9": "Goregoan East9",
"line10": "Goregoan East10",
"line11": "Goregoan East11",
"line12": "Goregoan East12"
}
}
}
]
我需要将上述所有 json 模式组合成单个模式
输入是一个带有 json 模式的数组,需要将所有模式组合成一个模式
解决方案
推荐阅读
- android - 圆形可绘制在某些设备上不呈现颜色
- loops - 使用循环按日期移动文件的批处理文件
- c# - Visual Studio 2015 - 命名空间 System.Runtime.Remoting.Channels.Http 中不存在 Http;
- swift - 当被呈现的视图“拥有”时,Swift 无主的自我泄漏
- javascript - 具有固定长度、前导空格和数字的 Javascript 正则表达式模式
- postgresql - 将 pg_restore 与远程文件一起使用
- kubernetes - VPC 网络中链接的不同集群之间的 GCP 中的 Pod 和服务之间的通信
- mysql - Mysql / PHP - 选择一个包含部分单词的表名
- nexus - NPM 发布和 Nexus 组的缓存问题
- java - 在 JSF 中提交表单时如何避免 LazyInitializationException?