Swagger-php: IRequired @OA\Info() not found

Created on 24 Dec 2018  路  1Comment  路  Source: zircote/swagger-php

I fllow the manue :
composer require zircote/swagger-php
composer global require zircote/swagger-php

And My code:
public function getJSON() { $dir = dirname($_SERVER['DOCUMENT_ROOT']) . '\application'; // echo $dir; $openapi =\OpenApi\scan($dir); return $openapi->toYaml(); }

But it throw error:
Required @OA\Info() not found

My run env: thinkphp5.1

Can you fix the bug,thx.

Most helpful comment

swagger-php couldn't find a @OA\Info annotation in any of the *.php files in$dir.

Add the missing annotation(s) and try again.

>All comments

swagger-php couldn't find a @OA\Info annotation in any of the *.php files in$dir.

Add the missing annotation(s) and try again.

Was this page helpful?
0 / 5 - 0 ratings