mirror of
https://github.com/tiennm99/coolify.git
synced 2026-10-13 06:15:13 +00:00
feat(api): add service database management endpoints
Add service database CRUD, logs, and lifecycle actions, and document service application operations with OpenAPI tests.
This commit is contained in:
1 parent
64667574f6
commit
908b5cc09d
13 files changed
+870
-3
No files matched your search
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
use App\Http\Controllers\Api\ServicesController;
|
||||
use OpenApi\Attributes\Patch;
|
||||
|
||||
it('only documents fields supported by the update service endpoint', function () {
|
||||
$method = new ReflectionMethod(ServicesController::class, 'update_by_uuid');
|
||||
$patch = $method->getAttributes(Patch::class)[0]->newInstance();
|
||||
$documentedProperties = $patch->requestBody->content[0]->schema->properties;
|
||||
|
||||
$openApi = json_decode(
|
||||
file_get_contents(__DIR__.'/../../openapi.json'),
|
||||
true,
|
||||
flags: JSON_THROW_ON_ERROR,
|
||||
);
|
||||
$generatedProperties = $openApi['paths']['/services/{uuid}']['patch']['requestBody']['content']['application/json']['schema']['properties'];
|
||||
|
||||
$unsupportedFields = [
|
||||
'project_uuid',
|
||||
'environment_name',
|
||||
'environment_uuid',
|
||||
'server_uuid',
|
||||
'destination_uuid',
|
||||
];
|
||||
|
||||
expect(array_keys($generatedProperties))->toBe(array_keys($documentedProperties))
|
||||
->and(array_intersect($unsupportedFields, array_keys($documentedProperties)))->toBeEmpty();
|
||||
});
|
||||
Reference in new issue
Block a user