diff --git a/src/App/src/OpenAPI.php b/src/App/src/OpenAPI.php index 75f8f00..5a3588b 100644 --- a/src/App/src/OpenAPI.php +++ b/src/App/src/OpenAPI.php @@ -9,14 +9,31 @@ use Fig\Http\Message\StatusCodeInterface; use OpenApi\Attributes as OA; -#[OA\Info(version: '1.0', title: 'Dotkernel API')] -#[OA\Server(url: 'http://api.dotkernel.localhost', description: 'Local development server')] -#[OA\SecurityScheme(securityScheme: 'AuthToken', type: 'http', in: 'header', bearerFormat: 'JWT', scheme: 'bearer')] -#[OA\SecurityScheme(securityScheme: 'ErrorReportingToken', type: 'apiKey', name: 'Error-Reporting-Token', in: 'header')] - -#[OA\ExternalDocumentation( - description: 'Dotkernel API documentation', - url: 'https://docs.dotkernel.org/api-documentation/' +#[OA\OpenApi( + info: new OA\Info(version: '1.0', title: 'Dotkernel API'), + servers: [ + new OA\Server(url: 'http://api.dotkernel.localhost', description: 'Local development server'), + ], + externalDocs: new OA\ExternalDocumentation( + description: 'Dotkernel API documentation', + url: 'https://docs.dotkernel.org/api-documentation/', + ), + components: new OA\Components( + securitySchemes: [ + new OA\SecurityScheme( + securityScheme: 'AuthToken', + type: 'http', + bearerFormat: 'JWT', + scheme: 'bearer', + ), + new OA\SecurityScheme( + securityScheme: 'ErrorReportingToken', + type: 'apiKey', + name: 'Error-Reporting-Token', + in: 'header', + ), + ], + ), )] /**