Skip to content

Commit

Permalink
🔧 fix(HealthCheckController.php): rename 'version' key to 'app_versio…
Browse files Browse the repository at this point in the history
…n' and add 'api_version' key to improve clarity and consistency in health check response

🔧 fix(ErrorResponse.php, SuccessResponse.php): rename 'version' property to 'app_version' and add 'api_version' property to match changes in HealthCheckController.php
  • Loading branch information
Vahn Gomes authored and Vahn Gomes committed Jul 24, 2023
1 parent 07dc956 commit 3686d2d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/app/Http/Controllers/API/HealthCheckController.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ public function index(): JsonResponse
'data' => [
'uptime' => 'N/A', // TODO: Get uptime from 'uptime' command
'timestamp' => now()->toAtomString(),
'version' => config('app.version'),
'app_version' => config('app.version'),
'api_version' => 'v1',
'diskspace' => disk_free_space('/') / disk_total_space('/') * 100,
'latency' => round(microtime(true) - LARAVEL_START, 3),
'dependencies' => $dependencies
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ public function build(): Response
Schema::object('data')->properties(
Schema::string('uptime')->example('3 days 2 hours'),
Schema::string('timestamp')->example('2021-01-01 00:00:00'),
Schema::string('version')->example('1.0.0'),
Schema::string('app_version')->example('1.0.0'),
Schema::string('api_version')->example('v1'),
Schema::number('diskspace')->example(50.0),
Schema::number('latency')->example(0.123)
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ public function build(): Response
Schema::object('data')->properties(
Schema::string('uptime')->example('3 days 2 hours'),
Schema::string('timestamp')->example('2021-01-01 00:00:00'),
Schema::string('version')->example('1.0.0'),
Schema::string('app_version')->example('1.0.0'),
Schema::string('api_version')->example('v1'),
Schema::number('diskspace')->example(50.0),
Schema::number('latency')->example(0.123)
),
Expand Down

0 comments on commit 3686d2d

Please sign in to comment.