How can send multipart/form-data file in application/json in swagger php

。_饼干妹妹 提交于 2020-07-22 05:21:07

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!