【发布时间】:2015-01-07 21:35:28
【问题描述】:
我正在使用 swagger 2.0。我在“定义”中定义了一个名为“mobilePrice”的响应对象。 我有另一个名为“Offer”的响应对象,它具有引用“mobilePrice”的属性“PriceOne”和“PriceTwo”。 代码如下所示:
"mobilePrice": {
"properties": {
"amount": {
"type": "string"
}
}
}
"Offer": {
"properties": {
"PriceOne": {
"$ref": "mobilePrice"
},
"PriceTwo": {
"$ref": "mobilePrice"
}
}
}
当我尝试在 swagger UI 上看到它时。它根本没有向我显示“PriceTwo”属性。 在尝试各种事情时,我认为问题是由于响应对象“mobilePrice”被多次引用而发生的。谁能帮我允许多次引用同一个对象。
提前谢谢你
【问题讨论】:
标签: swagger