我获得了一个使用" oneOf"的JSON模式。如下所示,有没有办法定义XSD来生成JAXB对象,这可以支持这个" oneOf" JSON数据编组和解组的定义?我正在使用杰克逊。
"Source": {
"description": "Indicates the source.",
"type": "object",
"oneOf": [
{
"properties": {
"Source1": {
"description": "Indicates the source 1.",
"type": "string"
}
},
"additionalProperties": false
},
{
"properties": {
"Source2": {
"description": "Indicates the source 2",
"type": "object",
"properties": {
"field1": {
"description": "filed 1 for source 1",
"type": "string"
},
"field2": {
"description": "field 2 for source 2",
"type": "string"
}
}
}
},
"additionalProperties": false
}
]
}