forked from zircote/swagger-php
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscan.php
More file actions
23 lines (19 loc) · 678 Bytes
/
scan.php
File metadata and controls
23 lines (19 loc) · 678 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?php
require __DIR__ . '/../../vendor/autoload.php';
// also load our custom processor...
require __DIR__ . '/SchemaQueryParameter.php';
// merge our custom processor
$processors = [];
foreach (\OpenApi\Analysis::processors() as $processor) {
$processors[] = $processor;
if ($processor instanceof \OpenApi\Processors\BuildPaths) {
$processors[] = new \SchemaQueryParameterProcessor\SchemaQueryParameter();
}
}
$options = [
'processors' => $processors,
];
$openapi = OpenApi\scan(__DIR__ . '/app', $options);
$spec = json_encode($openapi, JSON_PRETTY_PRINT);
file_put_contents(__DIR__ . '/schema-query-parameter-processor.json', $spec);
//echo $spec;