NelmioApiDocBundle不起作用“规范中未定义任何操作!” Symfony 3.4

时间:2019-01-14 17:50:36

标签: symfony-3.4 nelmioapidocbundle

我想将nelmio配置为我的symfony 3项目。我安装了捆绑软件,但最后得到的消息是未定义任何操作! 怎么了有什么想法吗?

/**
     * List the rewards of the specified user.
     *
     * This call takes into account all confirmed awards, but not pending or refused awards.
     *
     * @Route("/product", name="product", methods={"GET"})
     * @SWG\Response(
     *     response=200,
     *     description="Returns the rewards of an user",
     *     @SWG\Schema(
     *         type="array",
     *         @SWG\Items(ref=@Model(type=Reward::class, groups={"full"}))
     *     )
     * )
     * @SWG\Parameter(
     *     name="order",
     *     in="query",
     *     type="string",
     *     description="The field used to order rewards"
     * )
     * @SWG\Tag(name="rewards")
     * @Security(name="Bearer")
     *
     */
    public function getProducts()
    {
        $product = $this->entityManager->getRepository(Product::class)->getProducts();
        $productSerializer = $this->serializer->serialize($product, 'json');
        return new JsonResponse($productSerializer);
    }

0 个答案:

没有答案