我开始学习Swagger。
我试图完成书籍“使用Angular 6和Laravel 5进行全栈Web开发”中的相同操作。
在输入命令“php artisan l5-swagger:generate
”后,使用php-fpm bash时,在VS Code终端中出现了以下异常:
root@8e6435be9103:/application# php artisan l5-swagger:generate
Regenerating docs
ErrorException : Required @OA\Info() not found
at /application/vendor/zircote/swagger-php/src/Logger.php:39
35| $this->log = function ($entry, $type) {
36| if ($entry instanceof Exception) {
37| $entry = $entry->getMessage();
> 39| trigger_error($entry, $type);
40| };
41| }
42|
43| /**
Exception trace:
1 trigger_error("Required @OA\Info() not found")
/application/vendor/zircote/swagger-php/src/Logger.php:39
2 OpenApi\Logger::OpenApi\{closure}("Required @OA\Info() not found")
/application/vendor/zircote/swagger-php/src/Logger.php:71
当我尝试打开http://localhost:8081/api/documentation时,它会出现以下错误:
Failed to load API definition.
Fetch errorNot Found http://localhost:8081/docs/api-docs.json
我在docker内使用php-fpm bash。我的操作系统是Ubuntu 18.04.3 LTS。
有人可以帮我解决这个问题吗?谢谢!
* @OA\Get(
。 - hamed hossani