Closed Rasoul-Karimi closed 1 month ago
Same for me after composer update
yes after composer update
same error after update
It has to do with the package zircode/swagger-php.
darkaoline/l5-swagger requires "zircode/swagger-php where the OpenApi/Generator should be.
For any reasons, the Generator Class isn't available in the installed version of zircode/swagger-php, which will be installed as a dependency of darkaonline/l5-swagger.
Installing the lastest 3.x version, (which is 3.3.7) of zircode/swagger-php from the projects composer.json fixes this issue as a workaround (Tested with 8.1.0):
Add this to your composer.json and run composer update:
"require": {
...,
"zircote/swagger-php": "3.3.7"
},
Good answer. Looks like a bug here as L5 only requires ^3
which obviously is wrong.
It has to do with the package zircode/swagger-php.
darkaoline/l5-swagger requires "zircode/swagger-php where the OpenApi/Generator should be.
For any reasons, the Generator Class isn't available in the installed version of zircode/swagger-php, which will be installed as a dependency of darkaonline/l5-swagger.
Installing the lastest 3.x version, (which is 3.3.7) of zircode/swagger-php from the projects composer.json fixes this issue as a workaround (Tested with 8.1.0):
Add this to your composer.json and run composer update:
"require": { ..., "zircote/swagger-php": "3.3.7" },
it worked for me
please update the package and release fixed version @collegeman @DarkaOnLine @verwilst @StyleCIBot @ashish-khokhar @rlems @ymhuang0808 @rodrigowbazevedo @firdaushatta
@Rasoul-Karimi what is wrong with package requirements? We have swagger-php: "^3.2.0 || ^4.0.0"
https://github.com/DarkaOnLine/L5-Swagger/blob/master/composer.json#L24
@DarkaOnLine after update i get new error!! now i have too many documents and work fine with version 8.1 but after update to 8.5 or master get this error:
Required @OA\Info() not found
i dont need to get a new error! :) i want to only fix this one: error Class \"OpenApi\Generator\" not found
Have you checked this for @OA\Info()
problem: https://zircote.github.io/swagger-php/guide/faq.html#warning-required-oa-info-not-found
Installed "darkaonline/l5-swagger": "8.1", because latest version 8.5 - return "Required https://github.com/OA\Info() not found" BUT i have
/**
in my class Controller!!! Done composer require "zircote/swagger-php:3.*" - nothing changed (((
EDITED
changed "darkaonline/l5-swagger": "8.1", to "darkaonline/l5-swagger": "^8.1", in composer
composer update
And all working
I can confirm, that after adding the downgraded swagger-php 3.x version to composer.json everything works fine:
PHP: 8.2.4 Laravel: 9.52.5
facing Error "Required @OA\Info() not found" its ttok my 1 day.
at vendor\zircote\swagger-php\src\Loggers\DefaultLogger.php:31
php: 8.1.13 laravel: 10.14.1
facing Error "Required @OA\Info() not found" its ttok my 1 day.
at vendor\zircote\swagger-php\src\Loggers\DefaultLogger.php:31
php: 8.1.13 laravel: 10.14.1
Did you solve this?
Description:
i get this error : Class \"OpenApi\Generator\" not found I remove the vendor directory and composer install again but not working
exception : "Error" file : "vendor/darkaonline/l5-swagger/src/Generator.php" line : 176 message : "Class \"OpenApi\\Generator\" not found"