问题
I want to uplaod a file in swagger-php in the json requestBody How can upload with the help of swagger anonations
Trying from lot of hours but not luck how can send and file in application/json array Can you help if any information about this so then i will solve my problem i have not concept about this
when this code generate in the terminal also not have any error and not shown in the request body in the 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\MediaType(
* mediaType="multipart/form-data",
* @OA\Schema(
* @OA\Property(
* property="resume",
* type="file",
* format="file"
* ),
* )
* )
* ),
* )
* )
* ),
* )
*/
来源:https://stackoverflow.com/questions/62954088/how-can-send-multipart-form-data-file-in-application-json-in-swagger-php