This commit is contained in:
2024-05-24 15:27:07 +03:00
parent 17df2ce6a9
commit fc1da2c238
643 changed files with 110185 additions and 231 deletions

View File

@ -0,0 +1,26 @@
<?php
namespace console\controllers;
use OpenApi\Annotations\OpenApi;
use yii\console\Controller;
use Yii;
use yii\console\ExitCode;
use yii\helpers\Console;
class SwaggerController extends Controller
{
public function actionGo()
{
$openApi = \OpenApi\Generator::scan([Yii::getAlias("@frontend/modules/api")]);
$file = Yii::getAlias('@frontend/web/api-doc/dist/swagger.yaml');
$handle = fopen($file, 'wb');
fwrite($handle, $openApi->toYaml());
fclose($handle);
echo $this->ansiFormat('Created \n", Console::FG_BLUE');
return ExitCode::OK;
}
}