I want to include Array of objects in api/doc view. But I am unable to get that.
From the code below:
@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",),
),
),
),
I get the output:
{
"project-name": "string",
"project-detail": [
{
"name": "string",
"category": "string"
}
]
}
But I want below one:
{
"project-name": "string",
"project-detail": [
{
"name": "string",
"category": "string"
},
{
"new_name": "string",
"new_category": "string"
},
]
}
Please help me out for this.