模型的示例招摇标记
* @SWG\Model(
* id="UserSubscriptionSearchResultsFilter",
* @SWG\Property(name="total", type="integer"),
* @SWG\Property(name="perPage", type="integer"),
* @SWG\Property(name="query", type="string"),
* @SWG\Property(name="sortColumn", type="string"),
* @SWG\Property(name="sortDirection", type="string"),
* )
*/
/**
* @SWG\Model(
* id="UserSubscriptionSearchResults",
* @SWG\Property(name="results",type="array", items="$ref:UserSubscriptionRepository"),
* @SWG\Property(name="total", type="integer"),
* @SWG\Property(name="filter",type="object", uniqueItems="$ref:UserSubscriptionSearchResultsFilter")
* )
*/
现在架构看起来像:
"filter": "object"
相反,我想看到的是:
"filter": {
"total": 0,
"perPage": 0,
"query": "",
"sortColumn": "",
"sortDirection": ""
}
现在我只能创建一个看起来与此相对相似的数组对象,但它仍然不是完整的规范。
我在这里读过类似的问题: https ://github.com/swagger-api/swagger-spec/issues/38 https://github.com/mission-liao/pyswagger/issues/18
但我还没有找到明确的答案。