我得到了这个结果,即使我想要一个完全嵌套的对象:
{
"content": {}
}
这些是我使用的重要代码片段:
"responses": {
"200": {
"description": "An array of addresses",
"schema": {
"type": "object",
"$ref": "#/definitions/ContentWrapperAddress"
}
}
}
和
"ContentWrapperAddress":{
"properties": {
"content": {
"type": "object",
"items": {
"$ref": "#/definitions/AddressList"
}
}
}
},
"AddressList": {
"properties": {
"addresses": {
"type": "array",
"items": {
"$ref": "#/definitions/SplitAddress"
},
"description": "An array of split addresses. Will give back an empty array if nothing useful is returned."
}
}
},
"SplitAddress": {
"properties": {
"address1": {
"type": "string"
},
"address2": {
"type": "string"
},
"city": {
"type": "string"
},
"state": {
"type": "string"
},
"zip": {
"type": "string"
},
"isMultiUnit":{
"type": "boolean"
}
}
如果我只使用AddressList,那么它会完美显示。