init openapi generator

This commit is contained in:
Andras Bacsai
2024-07-06 14:34:15 +02:00
parent f8f0aa171c
commit 9c821e2480
6 changed files with 653 additions and 100 deletions

View File

@@ -5,8 +5,43 @@ namespace App\Http\Controllers\Api;
use OpenApi\Attributes as OA;
#[OA\Info(title: 'Coolify', version: '0.1')]
#[OA\Server(url: 'https://coolify.io/api/v1')]
#[OA\SecurityScheme(type: 'http', scheme: 'bearer', bearerFormat: 'JWT', securityScheme: 'bearerAuth')]
#[OA\Server(url: 'https://app.coolify.io/api/v1')]
#[OA\SecurityScheme(
type: 'http',
scheme: 'bearer',
securityScheme: 'bearerAuth',
description: 'Go to `Keys & Tokens` / `API tokens` and create a new token. Use the token as the bearer token.')]
#[OA\Components(
responses: [
new OA\Response(
response: 401,
description: 'Unauthenticated.',
content: new OA\JsonContent(
type: 'object',
properties: [
new OA\Property(property: 'message', type: 'string', example: 'Unauthenticated.'),
]
)),
new OA\Response(
response: 400,
description: 'Invalid token.',
content: new OA\JsonContent(
type: 'object',
properties: [
new OA\Property(property: 'message', type: 'string', example: 'Invalid token.'),
]
)),
new OA\Response(
response: 404,
description: 'Resource not found.',
content: new OA\JsonContent(
type: 'object',
properties: [
new OA\Property(property: 'message', type: 'string'),
]
)),
],
)]
class OpenApi
{
// This class is used to generate OpenAPI documentation