symfony-3.4 - NelmioApiDocBundle 不起作用“规范中没有定义操作!” Symfony 3.4
问题描述
我想为我的 symfony 3 项目配置 nelmio。我安装了捆绑包,但最后我收到一条未定义操作的消息!!!!怎么了?有任何想法吗?
/**
* 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);
}
解决方案
推荐阅读
- javascript - 在 vue/nuxt 中对当前路由进行动态 graphql 调用
- r - 如何根据 R 中的其他列从数据框中删除某些行?
- r - 找出列表中的任何两个元素总和是否等于 R 中的特定值
- amazon-web-services - AWS ELB Apache 获取客户端 IP,避免 X-Forwarded-For 欺骗
- ios - 如何从 SwiftUI View 导航回 UIViewController?
- ruby-on-rails - Ruby API:虚拟密码字段的验证不适用于 has_secure_password
- angular - 函数监听器在第一次点击时没有反应
- mongodb - MongoDB replica set initiate
- vue.js - 使用 prop 的值作为组件中可变数据的基础
- xamarin.forms - How to use Refit Settings in xamarin forms?