Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

refactor: Update OpenApi command to generate documentation

Andras Bacsai094499e1a347
diff --git a/app/Console/Commands/OpenApi.php b/app/Console/Commands/OpenApi.php
new file mode 100644
index 0000000000..e8d73ef477
--- /dev/null
+++ b/app/Console/Commands/OpenApi.php
@@ -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();
+
+ }
+}
diff --git a/app/Http/Controllers/Api/ApplicationsController.php b/app/Http/Controllers/Api/ApplicationsController.php
index cd4d724b45..aee9433e3a 100644
--- a/app/Http/Controllers/Api/ApplicationsController.php
+++ b/app/Http/Controllers/Api/ApplicationsController.php
@@ -201,7 +201,7 @@ class ApplicationsController extends Controller
#[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' => []],
],
diff --git a/openapi.yaml b/openapi.yaml
index 00d7bff435..9f6bc38898 100644
--- a/openapi.yaml
+++ b/openapi.yaml
@@ -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