Skip to content

Commit 669bdaf

Browse files
authored
Merge pull request #551 from dq042000/fix/issue-545-openapi-root-attributes
fix(openapi): move root attributes into OA\OpenApi
2 parents aa5d082 + 5ac01ac commit 669bdaf

1 file changed

Lines changed: 25 additions & 8 deletions

File tree

‎src/App/src/OpenAPI.php‎

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,31 @@
99
use Fig\Http\Message\StatusCodeInterface;
1010
use OpenApi\Attributes as OA;
1111

12-
#[OA\Info(version: '1.0', title: 'Dotkernel API')]
13-
#[OA\Server(url: 'http://api.dotkernel.localhost', description: 'Local development server')]
14-
#[OA\SecurityScheme(securityScheme: 'AuthToken', type: 'http', in: 'header', bearerFormat: 'JWT', scheme: 'bearer')]
15-
#[OA\SecurityScheme(securityScheme: 'ErrorReportingToken', type: 'apiKey', name: 'Error-Reporting-Token', in: 'header')]
16-
17-
#[OA\ExternalDocumentation(
18-
description: 'Dotkernel API documentation',
19-
url: 'https://docs.dotkernel.org/api-documentation/'
12+
#[OA\OpenApi(
13+
info: new OA\Info(version: '1.0', title: 'Dotkernel API'),
14+
servers: [
15+
new OA\Server(url: 'http://api.dotkernel.localhost', description: 'Local development server'),
16+
],
17+
externalDocs: new OA\ExternalDocumentation(
18+
description: 'Dotkernel API documentation',
19+
url: 'https://docs.dotkernel.org/api-documentation/',
20+
),
21+
components: new OA\Components(
22+
securitySchemes: [
23+
new OA\SecurityScheme(
24+
securityScheme: 'AuthToken',
25+
type: 'http',
26+
bearerFormat: 'JWT',
27+
scheme: 'bearer',
28+
),
29+
new OA\SecurityScheme(
30+
securityScheme: 'ErrorReportingToken',
31+
type: 'apiKey',
32+
name: 'Error-Reporting-Token',
33+
in: 'header',
34+
),
35+
],
36+
),
2037
)]
2138

2239
/**

0 commit comments

Comments
 (0)