refactor: Update OpenApi command to generate documentation

This commit is contained in:
Andras Bacsai 2024-08-13 13:27:50 +02:00
parent de34150451
commit 094499e1a3
3 changed files with 29 additions and 3 deletions

View File

@ -0,0 +1,26 @@
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Process;
class OpenApi extends Command
{
protected $signature = 'openapi';
protected $description = 'Generate OpenApi file.';
public function handle()
{
// Generate OpenAPI documentation
echo "Generating OpenAPI documentation.\n";
$process = Process::run(['/var/www/html/vendor/bin/openapi', 'app', '-o', 'openapi.yaml']);
$error = $process->errorOutput();
$error = preg_replace('/^.*an object literal,.*$/m', '', $error);
$error = preg_replace('/^\h*\v+/m', '', $error);
echo $error;
echo $process->output();
}
}

View File

@ -201,7 +201,7 @@ public function create_public_application(Request $request)
#[OA\Post(
summary: 'Create (Private - GH App)',
description: 'Create new application based on a private repository through a Github App.',
path: '/applications/private-gh-app',
path: '/applications/private-github-app',
security: [
['bearerAuth' => []],
],

View File

@ -247,13 +247,13 @@ paths:
security:
-
bearerAuth: []
/applications/private-gh-app:
/applications/private-github-app:
post:
tags:
- Applications
summary: 'Create (Private - GH App)'
description: 'Create new application based on a private repository through a Github App.'
operationId: 4d46c84bda4f1a411f6dda15fce4061f
operationId: 8b7af9c9a509385963bf3e72eeeea786
requestBody:
description: 'Application object that needs to be created.'
required: true