L5-Swagger: Required @OA\Info() not found

  • L5-Swagger Version: 8.4(composer show | grep l5-swagger)
  • PHP Version (php -v):8.1.6
  • OS: windows 10

Description:

image

Steps To Reproduce:

composer require “darkaonline/l5-swagger” php artisan vendor:publish --provider “L5Swagger\L5SwaggerServiceProvider” php artisan l5-swagger:generate

ErrorException

Required @OA\PathItem() not found

at C:\xampp\htdocs\simpleflex-api\vendor\zircote\swagger-php\src\Loggers\DefaultLogger.php:31 27▕ } else { 28▕ $error_level = E_USER_WARNING; 32▕ } 33▕ } 34▕

1 C:\xampp\htdocs\simpleflex-api\vendor\zircote\swagger-php\src\Loggers\DefaultLogger.php:31 trigger_error(“Required @OA\PathItem() not found”)

2 C:\xampp\htdocs\simpleflex-api\vendor\psr\log\src\LoggerTrait.php:86 OpenApi\Loggers\DefaultLogger::log(“warning”, “Required @OA\PathItem() not found”, [])

<?php namespace App\Http\Controllers; use Illuminate\Foundation\Bus\DispatchesJobs; use Illuminate\Routing\Controller as BaseController; use Illuminate\Foundation\Validation\ValidatesRequests; use Illuminate\Foundation\Auth\Access\AuthorizesRequests; /** * @OA\Info(title="My First API", version="0.1") */ class Controller extends BaseController { use AuthorizesRequests, DispatchesJobs, ValidatesRequests; }

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 5
  • Comments: 16

Most upvoted comments

Hmm, classic case of works for me 🤷

What version of swagger-php do you have installed?

This message comes from swagger-php. As of version 4 annotations and attributes must be associated with structural elements (class, method, etc.). If not, reflection annot find them. https://zircote.github.io/swagger-php/guide/faq.html#warning-required-oa-info-not-found