0

在此处输入图像描述我正在使用 symfony 4.4 / nelmio api doc bundle 4.0 / zircote swagger-php 3.0。当我尝试第一个示例时,出现此错误:用户注意:未找到必需的@OA\PathItem()

namespace App\Controller;

use OpenApi\Annotations as OA;

/**

@OA\PathItem(
path="/products/{product_id}",
@OA\Parameter(ref="#/components/parameters/product_id_in_path_required")
)
*/
class ProductController
{

/**
* @OA\Get(
*   tags={"Products"},
*   path="/products/{product_id}",
*   @OA\Response(
*       response="default",
*       description="successful operation",
*       @OA\JsonContent(ref="#/components/responses/product")
*   )
* )
*/
public function getProduct($id)
{
}

}

https://github.com/zircote/swagger-php/blob/3.0.0/Examples/example-object/example-object.php https://github.com/zircote/swagger-php/blob/3.0.0 /Examples/using-refs/ProductController.php

4

0 回答 0