19 lines
450 B
PHP
19 lines
450 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
require __DIR__ . '/../vendor/autoload.php';
|
|
|
|
use App\Api\OpenApiGenerator;
|
|
|
|
$baseUrl = $_ENV['APP_PUBLIC_BASE_URL'] ?? $_ENV['APP_URL'] ?? 'http://localhost:8080';
|
|
if (isset($argv[1])) {
|
|
$baseUrl = $argv[1];
|
|
}
|
|
|
|
$destination = __DIR__ . '/../public/pwgenerator-swagger-spec.json';
|
|
OpenApiGenerator::write($baseUrl, $destination);
|
|
|
|
echo "OpenAPI spec generated at {$destination}\n";
|
|
echo "Base URL: {$baseUrl}\n";
|