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.
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.
Most helpful comment
swagger-php couldn't find a
@OA\Infoannotation in any of the *.php files in$dir.Add the missing annotation(s) and try again.