Symfony:在 nelmio api 文档中输出示例图像?

Symfony: Output example image in nelmio api docs?

我正在使用 Nelmio Api Doc 为我的 API 生成文档。我刚刚添加了一个新端点,其中 returns image/png 文件基于 id 参数。我如何在我的 api 文档中最好地表示此响应?理想情况下,我想在该端点文档的示例响应部分显示示例图像。但是我可以用 nelmio 做到这一点吗?请看下面:

/**
 *
 * ### Example Response ###
 *     [
 *         {TELL NELIMO TO OUTPUT EXAMPLE IMAGE?}
 *     ]
 *
 * @Route("/image/{id}", name="image_get", requirements={"id": "\d+"})
 * @Method("GET")
 *
 * @ApiDoc(
 *  section="image",
 *  description="Fetch image.",
 *  headers={
 *     {
 *          "name" : "api-key",
 *          "description"="Token the client needs to provide when making API calls.",
 *          "required"="true"
 *     }
 *  },
 *  requirements={
 *      {
 *          "name"="id",
 *          "dataType"="integer",
 *          "requirement"="\d+",
 *          "description"="ID of the image you wish to retrieve."
 *      }
 *  },
 *  parameters={},
 *  filters={},
 *  statusCodes={
 *      200="Returned when successful",
 *      400={
 *        "Returned when bad request",
 *      },
 *      401={
 *        "Returned when unauthorized",
 *      },
 *      404={
 *        "Returned when not found",
 *      }
 *   }
 * )
 */
public function getAction($id, Request $request)
{
    /** @var ImageRepository $imageRepository */
    $imageRepository = $this->get('api.repository.image');

    /** @var Image $image */
    $image = $imageRepository->fetchById($id);

    if(empty($image->getId())){
        $problem = new ApiProblem("Image not found", "E_NOT_FOUND");
        $problem->setDetail("A image could not be found.");
        $problem->setInstance($request->getUri());
        return new Response($problem->asJson(), Response::HTTP_NOT_FOUND);
    }

    /** @var string $file */
    $file = file_get_contents(__DIR__ . '/../../../../app/Resources/img/' . $flag->getImg());

    return new Response($file, 200, [
        'Content-Type' => 'image/png',
        'Content-Disposition' => 'inline; filename="'.$image->getImg().'"'
    ]);
}

像这样在评论中使用 markdown ![alt text](https://some_image.png) 这将在 nelmio api 文档中输出它。