1
我正在尋找一種方式來添加多個響應類型招搖的UI通過NelmioAPiDoc實施揚鞭-UI的Symfony NelmioAPiDoc添加多個responseTyp的選項
我想爲圖像/ JPEG作爲一個選項響應類型我有代碼工作在控制器設置身體的圖像,即使響應類型仍然說的應用程序/ JSON但我的目標是如果'應用程序/ JSON'被選中它返回圖像的JSON格式的網址,但是如果選擇'image/jpeg',它會將圖像返回到主體。任何幫助不勝感激。
/**
* @Security("is_granted('IS_AUTHENTICATED_FULLY')")
*
* @Route("/api/airs/renderframe", name="get_airs_frame", methods={"GET"})
*
* @SWG\Response(
* response=200,
* description="Returns json image url from paramaters",
*)
* @SWG\Parameter(
* name="imageHost",
* in="query",
* type="string",
* description="image host"
*)
* @SWG\Parameter(
* name="imagePath",
* in="query",
* type="string",
* description="image path"
*)
*
我自己也嘗試添加該到我班上的第一名,但仍然有一個下拉選項
/**
* @SWG\Swagger(
* schemes={"http"},
* produces={"image/jpeg","application/json"},
* consumes={"application/json"}
* )
*/