0

enter image description hereI m using symfony 4.4 / nelmio api doc bundle 4.0 / zircote swagger-php 3.0. When i try with a first example i get this error : User Notice: Required @OA\PathItem() not found

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

mohamed jebri
  • 261
  • 3
  • 13
  • What exactly do you try? And can you share the full and exact error message? – Nico Haase Jun 09 '20 at 08:39
  • https://github.com/zircote/swagger-php/blob/3.0.0/Examples/using-refs/ProductController.php – mohamed jebri Jun 09 '20 at 08:46
  • i have tried without PathItem but the error still here : `namespace App\Controller; use OpenApi\Annotations as OA; 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) { } }` – mohamed jebri Jun 09 '20 at 08:51
  • I tried with examples : 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 – mohamed jebri Jun 09 '20 at 08:56

0 Answers0