如何解决symfony 5 nelmio api 文档没有回报
首先很抱歉我的英语不好。
我想将 NelmioApiDoc 用于我的 api,对于安装和配置,我没有问题,我的路由返回此结果: nemlio return
这是当我尝试向控制器插入注释时,没有任何变化,页面没有变化。 我的控制器:
<?PHP
namespace App\Controller;
use App\Entity\Product;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Routing\Annotation\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Serializer\Exception\NotencodableValueException;
use Symfony\Component\Serializer\SerializerInterface;
use Symfony\Component\Validator\Validator\ValidatorInterface;
use Nelmio\ApiDocBundle\Annotation\Model;
use Nelmio\ApiDocBundle\Annotation\Security;
use OpenApi\Annotations as OA;
/**
* Class ApiProductController
*
*/
class ProductController extends AbstractController
{
/**
* @Route("/api/products/showAll",name="productsShow")
* @Method({"GET"})
* @OA\Response(
* response=200,* description="Returns the products of an user",* @OA\JsonContent(
* type="array",* @OA\Items(ref=@Model(type=Product::class))
* )
* )
* @OA\Parameter(
* name="order",* in="query",* description="The field used to order products",* @OA\Schema(type="string")
* )
* @OA\Tag(name="product")
* @Security(name="Bearer")
*/
public function showAll()
{ ... }
如果你对我有回应,我接受!谢谢大家
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。