From 094499e1a3474e31db63c2267fe8ce90d0697bf9 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Tue, 13 Aug 2024 13:27:50 +0200 Subject: [PATCH] refactor: Update OpenApi command to generate documentation --- app/Console/Commands/OpenApi.php | 26 +++++++++++++++++++ .../Api/ApplicationsController.php | 2 +- openapi.yaml | 4 +-- 3 files changed, 29 insertions(+), 3 deletions(-) create mode 100644 app/Console/Commands/OpenApi.php diff --git a/app/Console/Commands/OpenApi.php b/app/Console/Commands/OpenApi.php new file mode 100644 index 000000000..e8d73ef47 --- /dev/null +++ b/app/Console/Commands/OpenApi.php @@ -0,0 +1,26 @@ +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 cd4d724b4..aee9433e3 100644 --- a/app/Http/Controllers/Api/ApplicationsController.php +++ b/app/Http/Controllers/Api/ApplicationsController.php @@ -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' => []], ], diff --git a/openapi.yaml b/openapi.yaml index 00d7bff43..9f6bc3889 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