我想在 api/doc 视图中包含对象数组。但我无法得到那个。
从下面的代码:
@SWG\Schema(
@SWG\Property(property="project-name", type="string"),
@SWG\Property(property="project-detail", type="array",
@SWG\Items(type="object",
@SWG\Property(property="name", type="string", ),
@SWG\Property(property="category", type="string",),
),
@SWG\Items(type="object",
@SWG\Property(property="new_name", type="string", ),
@SWG\Property(property="new_category", type="string",),
),
),
),
我得到输出:
{
"project-name": "string",
"project-detail": [
{
"name": "string",
"category": "string"
}
]
}
但我想要以下一个:
{
"project-name": "string",
"project-detail": [
{
"name": "string",
"category": "string"
},
{
"new_name": "string",
"new_category": "string"
},
]
}
请帮我解决这个问题。