我想在 json requestBody 的 swagger-php 中上传一个文件 如何在 swagger anonations 的帮助下上传
尝试了很多时间,但运气不佳,如何在 application/json 数组中发送和归档,如果有任何关于此的信息,您能否提供帮助,那么我将解决我的问题,我对此一无所知
当此代码在终端中生成时也没有任何错误并且未显示在 swagger ui 的请求正文中
/**
* @OA\Post(
* path="/products/save",
* tags={"Product"},
* summary="Post bulk products",
* description="Return bulk products",
* @OA\RequestBody(
* required=true,
* description="Bulk products Body",
* @OA\JsonContent(
* @OA\Property(
* property="products",
* @OA\Items(
* @OA\Property(property="first_name", type="string"),
* @OA\Property(property="last_name", type="string"),
* @OA\Property(property="email", type="string"),
* @OA\Property(property="phone", type="string"),
* @OA\Property(property="resume", type="string", format="base64"),
* ),
* )
* )
* ),
* )
*/
我想要这种类型的 swagger-ui 正文,以便用户可以填写属性并以 base64 格式添加简历
{
"products": [
{
"first_name": "string",
"last_name": "string",
"email": "string",
"phone": "string",
"resume": "string" ==> here i will send base64 format of resume file
}
]
}
``