为文件上载的查询参数交换注释



我正试图为我的基于symfony的api制作一个api文档,我想为我的api添加有关上传端点的信息。我正在使用nelmioapidocbundle。有人能提供一个链接到我能找到的文件吗?或者如果有一个例子的话会更好。非常感谢。

/**
* @Route("/products/{id}/images", methods={"POST"})
* 
* @SWGParameter(
*      name="file",
*      in="body",
*      type="file",
*      ---- Im not sure what to put here to make this work
* )
* 
* @SWGResponse(
*          response=201,
*          description="File is uploaded."
*      )
* )
*/
public function uploadImages(Request $request, FileUploadService $fileUploadService) {}

对于任何可能遇到这种情况的人。此表单值中的数据修复了问题:

* @SWGParameter( 
*      name="file", 
*      in="formData", <----
*      required=true, 
*      type="file", 
*      description="product image" 

最新更新