pandorafms/pandora_console/api/v2/config/generateDoc.php

21 lines
431 B
PHP
Raw Normal View History

2024-01-12 08:22:17 +01:00
<?php
require_once __DIR__.'/../../../vendor/autoload.php';
$exclude = ['tests'];
$pattern = '*.php';
$openapi = \OpenApi\Generator::scan(
\OpenApi\Util::finder(
[
__DIR__.'/..',
__DIR__.'/../../../include/lib/Modules',
],
$exclude,
$pattern
)
);
header('Content-Type: application/json');
file_put_contents(__DIR__.'/../public/swagger.json', $openapi->toJson());