Swagger PHP multipart/form-data 与 json 数据

问题描述

我正在尝试将我的新路由添加到我的 swagger 文档中,但我遇到了 swagger 在多部分/表单数据中显示 JSON 正文的问题。请求由两部分组成,首先是图像,其次是 json 结构。我没有收到任何错误,但显示器没有显示 json。如何获取 multipart/form-data 以显示具有 json 结构的多个属性

@OA\RequestBody(
   required=true,@OA\MediaType(
       mediaType="multipart/form-data",@OA\Schema(
           @OA\Property(
               property="File",description="PDF or image supported",type="file",@OA\Items(type="string",format="binary")
           ),@OA\Property(
               property="Data",description="Archive data used to locat and archive the request",type="application/json",@OA\Schema(
                   @OA\Property(
                       property="targetTable",description="Some dexcription here",type="string",example="Customer_ID"
                   ),@OA\Property(
                       property="indexes",example={{
                               "name":"first_name","value":"Fred"
                               },{
                               "name":"last_name","value":"Flintstone"
                               },{
                               "name":"form","value":"PhotoID"
                       }}
                 )
             )
         )
    ),),

enter image description here

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)