PHP数组的招摇过市
我试图创建一个响应示例,该示例应返回如下数组:PHP数组的招摇过市,php,swagger,openapi,swagger-php,Php,Swagger,Openapi,Swagger Php,我试图创建一个响应示例,该示例应返回如下数组: [ [ "Shop Name", "53.7094190", "-1.9084720" ,1 ] ] 为此,我使用以下代码: * @OA\Response( * response= "default", * description="Success: Array of shops", * @OA\MediaType( * mediaType="text/plain",
[
[
"Shop Name",
"53.7094190",
"-1.9084720"
,1
]
]
为此,我使用以下代码:
* @OA\Response(
* response= "default",
* description="Success: Array of shops",
* @OA\MediaType(
* mediaType="text/plain",
* @OA\Schema(
* type = "array",
* @OA\Items( type="array",
* @OA\Items(type="string", default="'Bridge Balti','53.7094190','-1.9084720',1"),
* ),
* )
* )
* )
我在斯威格中心得到了这个:
[
[
"string"
]
]
如果您只想在swagger ui中显示一个示例,那么您需要使用“example”参数 @OA\Items(type=“string”,example=“'Bridge Balti','53.7094190','-1.9084720',1”)