From f6127efc1ce23e53bd54ff636c3dddbcc5c896ff Mon Sep 17 00:00:00 2001 From: Matias Perrone Date: Mon, 29 Sep 2025 15:54:38 -0300 Subject: [PATCH 01/12] feat: Add OpenAPI documentation to "getAll" method --- .../Marketplace/PublicCloudsApiController.php | 94 ++++++++++++++++++- 1 file changed, 93 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/Apis/Marketplace/PublicCloudsApiController.php b/app/Http/Controllers/Apis/Marketplace/PublicCloudsApiController.php index 1b416d589..ad93a2b8f 100644 --- a/app/Http/Controllers/Apis/Marketplace/PublicCloudsApiController.php +++ b/app/Http/Controllers/Apis/Marketplace/PublicCloudsApiController.php @@ -12,7 +12,9 @@ * limitations under the License. **/ use App\Models\Foundation\Marketplace\IPublicCloudServiceRepository; +use Illuminate\Http\Response; use models\oauth2\IResourceServerContext; +use OpenApi\Attributes as OA; /** * Class PublicCloudsApiController @@ -29,8 +31,98 @@ public function __construct(IPublicCloudServiceRepository $repository, IResource parent::__construct($repository, $resource_server_context); } + #[OA\Get( + path: "/api/public/v1/marketplace/public-clouds", + description: "Get all marketplace public cloud services (OpenStack implementations)", + summary: 'Get all public clouds', + operationId: 'getAllPublicClouds', + tags: ['Public Clouds'], + parameters: [ + new OA\Parameter( + name: 'filter[]', + in: 'query', + required: false, + description: 'Filter expressions in the format fieldvalue. Available fields: name, company. Operators: =@, ==, @@.', + style: 'form', + explode: true, + schema: new OA\Schema( + type: 'array', + items: new OA\Items(type: 'string', example: 'name@@aws') + ) + ), + new OA\Parameter( + name: 'order', + in: 'query', + required: false, + description: 'Order by field(s)', + schema: new OA\Schema(type: 'string', example: 'name,-id') + ), + new OA\Parameter( + name: 'expand', + in: 'query', + required: false, + description: 'Comma-separated list of related resources to include. Available relations: company, type, capabilities, guests, hypervisors, supported_regions, data_centers, data_center_regions', + schema: new OA\Schema(type: 'string', example: 'company,data_centers') + ), + new OA\Parameter( + name: 'relations', + in: 'query', + required: false, + description: 'Relations to load eagerly', + schema: new OA\Schema(type: 'string', example: 'company,data_centers') + ), + new OA\Parameter( + name: 'fields', + in: 'query', + required: false, + description: 'Comma-separated list of fields to return', + schema: new OA\Schema(type: 'string', example: 'id,name,company.name') + ), + ], + responses: [ + new OA\Response( + response: 200, + description: 'Success - Returns paginated list of public clouds', + content: new OA\JsonContent( + properties: [ + 'total' => new OA\Property(property: 'total', type: 'integer', example: 8), + 'per_page' => new OA\Property(property: 'per_page', type: 'integer', example: 8), + 'current_page' => new OA\Property(property: 'current_page', type: 'integer', example: 1), + 'last_page' => new OA\Property(property: 'last_page', type: 'integer', example: 1), + 'data' => new OA\Property( + property: 'data', + type: 'array', + items: new OA\Items( + properties: [ + 'id' => new OA\Property(property: 'id', type: 'integer', example: 1), + 'class_name' => new OA\Property(property: 'class_name', type: 'string', example: 'PublicCloudService'), + 'name' => new OA\Property(property: 'name', type: 'string', example: 'AWS OpenStack Compatible Service'), + 'overview' => new OA\Property(property: 'overview', type: 'string', example: 'Public cloud service with OpenStack compatibility'), + 'call_2_action_url' => new OA\Property(property: 'call_2_action_url', type: 'string', example: 'https://example.com/public-cloud'), + 'slug' => new OA\Property(property: 'slug', type: 'string', example: 'aws-openstack-service'), + 'company_id' => new OA\Property(property: 'company_id', type: 'integer', example: 1), + 'type_id' => new OA\Property(property: 'type_id', type: 'integer', example: 1), + 'is_compatible_with_storage' => new OA\Property(property: 'is_compatible_with_storage', type: 'boolean', example: true), + 'is_compatible_with_compute' => new OA\Property(property: 'is_compatible_with_compute', type: 'boolean', example: true), + 'is_compatible_with_federated_identity' => new OA\Property(property: 'is_compatible_with_federated_identity', type: 'boolean', example: true), + 'is_compatible_with_platform' => new OA\Property(property: 'is_compatible_with_platform', type: 'boolean', example: true), + 'is_openstack_powered' => new OA\Property(property: 'is_openstack_powered', type: 'boolean', example: false), + 'is_openstack_tested' => new OA\Property(property: 'is_openstack_tested', type: 'boolean', example: true), + 'openstack_tested_info' => new OA\Property(property: 'openstack_tested_info', type: 'string', example: 'Compatible with OpenStack APIs') + ], + type: 'object' + ) + ) + ], + type: 'object' + ) + ), + new OA\Response(response: Response::HTTP_PRECONDITION_FAILED, description: "Validation Error"), + new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error") + ] + )] public function getAll() { return parent::getAll(); } -} \ No newline at end of file +} From 990325106193a5911bafe0bb568da86d254b4836 Mon Sep 17 00:00:00 2001 From: Matias Perrone Date: Tue, 30 Sep 2025 12:01:49 -0300 Subject: [PATCH 02/12] chore: Add controller's response OpenAPI schema --- .../Marketplace/PublicCloudsApiController.php | 34 +-------------- app/Swagger/schemas.php | 42 +++++++++++++++++++ 2 files changed, 43 insertions(+), 33 deletions(-) diff --git a/app/Http/Controllers/Apis/Marketplace/PublicCloudsApiController.php b/app/Http/Controllers/Apis/Marketplace/PublicCloudsApiController.php index ad93a2b8f..de50cf2ed 100644 --- a/app/Http/Controllers/Apis/Marketplace/PublicCloudsApiController.php +++ b/app/Http/Controllers/Apis/Marketplace/PublicCloudsApiController.php @@ -83,39 +83,7 @@ public function __construct(IPublicCloudServiceRepository $repository, IResource new OA\Response( response: 200, description: 'Success - Returns paginated list of public clouds', - content: new OA\JsonContent( - properties: [ - 'total' => new OA\Property(property: 'total', type: 'integer', example: 8), - 'per_page' => new OA\Property(property: 'per_page', type: 'integer', example: 8), - 'current_page' => new OA\Property(property: 'current_page', type: 'integer', example: 1), - 'last_page' => new OA\Property(property: 'last_page', type: 'integer', example: 1), - 'data' => new OA\Property( - property: 'data', - type: 'array', - items: new OA\Items( - properties: [ - 'id' => new OA\Property(property: 'id', type: 'integer', example: 1), - 'class_name' => new OA\Property(property: 'class_name', type: 'string', example: 'PublicCloudService'), - 'name' => new OA\Property(property: 'name', type: 'string', example: 'AWS OpenStack Compatible Service'), - 'overview' => new OA\Property(property: 'overview', type: 'string', example: 'Public cloud service with OpenStack compatibility'), - 'call_2_action_url' => new OA\Property(property: 'call_2_action_url', type: 'string', example: 'https://example.com/public-cloud'), - 'slug' => new OA\Property(property: 'slug', type: 'string', example: 'aws-openstack-service'), - 'company_id' => new OA\Property(property: 'company_id', type: 'integer', example: 1), - 'type_id' => new OA\Property(property: 'type_id', type: 'integer', example: 1), - 'is_compatible_with_storage' => new OA\Property(property: 'is_compatible_with_storage', type: 'boolean', example: true), - 'is_compatible_with_compute' => new OA\Property(property: 'is_compatible_with_compute', type: 'boolean', example: true), - 'is_compatible_with_federated_identity' => new OA\Property(property: 'is_compatible_with_federated_identity', type: 'boolean', example: true), - 'is_compatible_with_platform' => new OA\Property(property: 'is_compatible_with_platform', type: 'boolean', example: true), - 'is_openstack_powered' => new OA\Property(property: 'is_openstack_powered', type: 'boolean', example: false), - 'is_openstack_tested' => new OA\Property(property: 'is_openstack_tested', type: 'boolean', example: true), - 'openstack_tested_info' => new OA\Property(property: 'openstack_tested_info', type: 'string', example: 'Compatible with OpenStack APIs') - ], - type: 'object' - ) - ) - ], - type: 'object' - ) + content: new OA\JsonContent(ref: '#/components/schemas/PaginatedPublicCloudsResponseSchema') ), new OA\Response(response: Response::HTTP_PRECONDITION_FAILED, description: "Validation Error"), new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error") diff --git a/app/Swagger/schemas.php b/app/Swagger/schemas.php index c40fbc58d..baaaf7cb7 100644 --- a/app/Swagger/schemas.php +++ b/app/Swagger/schemas.php @@ -416,3 +416,45 @@ class ChunkedFileUploadCompleteResponseSchema {} ] )] class ChunkedFileUploadRequestSchema {} + +#[OA\Schema( + schema: 'PublicCloudsResponseSchema', + type: 'object', + properties: [ + 'id' => new OA\Property(property: 'id', type: 'integer', example: 1), + 'class_name' => new OA\Property(property: 'class_name', type: 'string', example: 'PublicCloudService'), + 'name' => new OA\Property(property: 'name', type: 'string', example: 'AWS OpenStack Compatible Service'), + 'overview' => new OA\Property(property: 'overview', type: 'string', example: 'Public cloud service with OpenStack compatibility'), + 'call_2_action_url' => new OA\Property(property: 'call_2_action_url', type: 'string', example: 'https://example.com/public-cloud'), + 'slug' => new OA\Property(property: 'slug', type: 'string', example: 'aws-openstack-service'), + 'company_id' => new OA\Property(property: 'company_id', type: 'integer', example: 1), + 'type_id' => new OA\Property(property: 'type_id', type: 'integer', example: 1), + 'is_compatible_with_storage' => new OA\Property(property: 'is_compatible_with_storage', type: 'boolean', example: true), + 'is_compatible_with_compute' => new OA\Property(property: 'is_compatible_with_compute', type: 'boolean', example: true), + 'is_compatible_with_federated_identity' => new OA\Property(property: 'is_compatible_with_federated_identity', type: 'boolean', example: true), + 'is_compatible_with_platform' => new OA\Property(property: 'is_compatible_with_platform', type: 'boolean', example: true), + 'is_openstack_powered' => new OA\Property(property: 'is_openstack_powered', type: 'boolean', example: false), + 'is_openstack_tested' => new OA\Property(property: 'is_openstack_tested', type: 'boolean', example: true), + 'openstack_tested_info' => new OA\Property(property: 'openstack_tested_info', type: 'string', example: 'Compatible with OpenStack APIs') + ] +)] +class PublicCloudsResponseSchema {} + +#[OA\Schema( + schema: 'PaginatedPublicCloudsResponseSchema', + allOf: [ + new OA\Schema(ref: '#/components/schemas/PaginateDataSchemaResponse'), + new OA\Schema( + type: 'object', + properties: [ + new OA\Property( + property: 'data', + type: 'array', + items: new OA\Items(ref: '#/components/schemas/PublicCloudsResponseSchema') + ) + ] + ) + ] +)] +class PaginatedPublicCloudsResponseSchema {} + From a63368f97a98c158770ac6d3f12e03bcbc5746f8 Mon Sep 17 00:00:00 2001 From: Matias Perrone Date: Tue, 30 Sep 2025 12:07:26 -0300 Subject: [PATCH 03/12] chore: change schema name to be reused by private cloud controller too --- .../Apis/Marketplace/PublicCloudsApiController.php | 2 +- app/Swagger/schemas.php | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/app/Http/Controllers/Apis/Marketplace/PublicCloudsApiController.php b/app/Http/Controllers/Apis/Marketplace/PublicCloudsApiController.php index de50cf2ed..f96581055 100644 --- a/app/Http/Controllers/Apis/Marketplace/PublicCloudsApiController.php +++ b/app/Http/Controllers/Apis/Marketplace/PublicCloudsApiController.php @@ -83,7 +83,7 @@ public function __construct(IPublicCloudServiceRepository $repository, IResource new OA\Response( response: 200, description: 'Success - Returns paginated list of public clouds', - content: new OA\JsonContent(ref: '#/components/schemas/PaginatedPublicCloudsResponseSchema') + content: new OA\JsonContent(ref: '#/components/schemas/PaginatedPublicOrPrivateCloudsResponseSchema') ), new OA\Response(response: Response::HTTP_PRECONDITION_FAILED, description: "Validation Error"), new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error") diff --git a/app/Swagger/schemas.php b/app/Swagger/schemas.php index baaaf7cb7..20f2544ea 100644 --- a/app/Swagger/schemas.php +++ b/app/Swagger/schemas.php @@ -418,7 +418,7 @@ class ChunkedFileUploadCompleteResponseSchema {} class ChunkedFileUploadRequestSchema {} #[OA\Schema( - schema: 'PublicCloudsResponseSchema', + schema: 'PublicOrPrivateCloudsResponseSchema', type: 'object', properties: [ 'id' => new OA\Property(property: 'id', type: 'integer', example: 1), @@ -438,10 +438,10 @@ class ChunkedFileUploadRequestSchema {} 'openstack_tested_info' => new OA\Property(property: 'openstack_tested_info', type: 'string', example: 'Compatible with OpenStack APIs') ] )] -class PublicCloudsResponseSchema {} +class PublicOrPrivateCloudsResponseSchema {} #[OA\Schema( - schema: 'PaginatedPublicCloudsResponseSchema', + schema: 'PaginatedPublicOrPrivateCloudsResponseSchema', allOf: [ new OA\Schema(ref: '#/components/schemas/PaginateDataSchemaResponse'), new OA\Schema( @@ -450,11 +450,10 @@ class PublicCloudsResponseSchema {} new OA\Property( property: 'data', type: 'array', - items: new OA\Items(ref: '#/components/schemas/PublicCloudsResponseSchema') + items: new OA\Items(ref: '#/components/schemas/PublicOrPrivateCloudsResponseSchema') ) ] ) ] )] -class PaginatedPublicCloudsResponseSchema {} - +class PaginatedPublicOrPrivateCloudsResponseSchema {} From 075228ceb2e04453b9224baf6b95b340d4743ab9 Mon Sep 17 00:00:00 2001 From: Matias Perrone Date: Tue, 7 Oct 2025 18:15:43 -0300 Subject: [PATCH 04/12] chore: remove unnecessary and conflicting require and move schema to Marketplace Schemas file --- app/Swagger/MarketplaceSchemas.php | 41 ++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/app/Swagger/MarketplaceSchemas.php b/app/Swagger/MarketplaceSchemas.php index 278fb4b27..4f4e59a0a 100644 --- a/app/Swagger/MarketplaceSchemas.php +++ b/app/Swagger/MarketplaceSchemas.php @@ -65,3 +65,44 @@ class PaginatedConsultantsResponseSchema class PaginatedMarketplaceDistributionResponseSchema { } + +#[OA\Schema( + schema: 'PublicOrPrivateCloudsResponseSchema', + type: 'object', + properties: [ + 'id' => new OA\Property(property: 'id', type: 'integer', example: 1), + 'class_name' => new OA\Property(property: 'class_name', type: 'string', example: 'PublicCloudService'), + 'name' => new OA\Property(property: 'name', type: 'string', example: 'AWS OpenStack Compatible Service'), + 'overview' => new OA\Property(property: 'overview', type: 'string', example: 'Public cloud service with OpenStack compatibility'), + 'call_2_action_url' => new OA\Property(property: 'call_2_action_url', type: 'string', example: 'https://example.com/public-cloud'), + 'slug' => new OA\Property(property: 'slug', type: 'string', example: 'aws-openstack-service'), + 'company_id' => new OA\Property(property: 'company_id', type: 'integer', example: 1), + 'type_id' => new OA\Property(property: 'type_id', type: 'integer', example: 1), + 'is_compatible_with_storage' => new OA\Property(property: 'is_compatible_with_storage', type: 'boolean', example: true), + 'is_compatible_with_compute' => new OA\Property(property: 'is_compatible_with_compute', type: 'boolean', example: true), + 'is_compatible_with_federated_identity' => new OA\Property(property: 'is_compatible_with_federated_identity', type: 'boolean', example: true), + 'is_compatible_with_platform' => new OA\Property(property: 'is_compatible_with_platform', type: 'boolean', example: true), + 'is_openstack_powered' => new OA\Property(property: 'is_openstack_powered', type: 'boolean', example: false), + 'is_openstack_tested' => new OA\Property(property: 'is_openstack_tested', type: 'boolean', example: true), + 'openstack_tested_info' => new OA\Property(property: 'openstack_tested_info', type: 'string', example: 'Compatible with OpenStack APIs') + ] +)] +class PublicOrPrivateCloudsResponseSchema {} + +#[OA\Schema( + schema: 'PaginatedPublicOrPrivateCloudsResponseSchema', + allOf: [ + new OA\Schema(ref: '#/components/schemas/PaginateDataSchemaResponse'), + new OA\Schema( + type: 'object', + properties: [ + new OA\Property( + property: 'data', + type: 'array', + items: new OA\Items(ref: '#/components/schemas/PublicOrPrivateCloudsResponseSchema') + ) + ] + ) + ] +)] +class PaginatedPublicOrPrivateCloudsResponseSchema {} From 1d81cbfdb89dbdb7454ad5f6ff2d585d6da973fd Mon Sep 17 00:00:00 2001 From: Matias Perrone Date: Tue, 7 Oct 2025 18:26:51 -0300 Subject: [PATCH 05/12] fix: fix typo --- .../Controllers/Apis/Marketplace/PublicCloudsApiController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/Apis/Marketplace/PublicCloudsApiController.php b/app/Http/Controllers/Apis/Marketplace/PublicCloudsApiController.php index f96581055..db0cf2afe 100644 --- a/app/Http/Controllers/Apis/Marketplace/PublicCloudsApiController.php +++ b/app/Http/Controllers/Apis/Marketplace/PublicCloudsApiController.php @@ -83,7 +83,7 @@ public function __construct(IPublicCloudServiceRepository $repository, IResource new OA\Response( response: 200, description: 'Success - Returns paginated list of public clouds', - content: new OA\JsonContent(ref: '#/components/schemas/PaginatedPublicOrPrivateCloudsResponseSchema') + content: new OA\JsonContent(ref: '#/components/schemas/PaginatedPublicOrPrivateCloudsResponse') ), new OA\Response(response: Response::HTTP_PRECONDITION_FAILED, description: "Validation Error"), new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error") From be147347ce48a2041f19018066a905c62d954958 Mon Sep 17 00:00:00 2001 From: Matias Perrone Date: Tue, 14 Oct 2025 12:57:09 -0300 Subject: [PATCH 06/12] fix: Change "namespace" word positioning --- .../Apis/Marketplace/PublicCloudsApiController.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/Apis/Marketplace/PublicCloudsApiController.php b/app/Http/Controllers/Apis/Marketplace/PublicCloudsApiController.php index db0cf2afe..9b3f37bce 100644 --- a/app/Http/Controllers/Apis/Marketplace/PublicCloudsApiController.php +++ b/app/Http/Controllers/Apis/Marketplace/PublicCloudsApiController.php @@ -1,4 +1,7 @@ - Date: Fri, 31 Oct 2025 10:34:16 -0300 Subject: [PATCH 07/12] fix: remove "Schema" string from schema name --- app/Swagger/MarketplaceSchemas.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Swagger/MarketplaceSchemas.php b/app/Swagger/MarketplaceSchemas.php index 4f4e59a0a..d2fd51025 100644 --- a/app/Swagger/MarketplaceSchemas.php +++ b/app/Swagger/MarketplaceSchemas.php @@ -67,7 +67,7 @@ class PaginatedMarketplaceDistributionResponseSchema } #[OA\Schema( - schema: 'PublicOrPrivateCloudsResponseSchema', + schema: 'PublicOrPrivateCloudsResponse', type: 'object', properties: [ 'id' => new OA\Property(property: 'id', type: 'integer', example: 1), @@ -90,7 +90,7 @@ class PaginatedMarketplaceDistributionResponseSchema class PublicOrPrivateCloudsResponseSchema {} #[OA\Schema( - schema: 'PaginatedPublicOrPrivateCloudsResponseSchema', + schema: 'PaginatedPublicOrPrivateCloudsResponse', allOf: [ new OA\Schema(ref: '#/components/schemas/PaginateDataSchemaResponse'), new OA\Schema( @@ -99,7 +99,7 @@ class PublicOrPrivateCloudsResponseSchema {} new OA\Property( property: 'data', type: 'array', - items: new OA\Items(ref: '#/components/schemas/PublicOrPrivateCloudsResponseSchema') + items: new OA\Items(ref: '#/components/schemas/PublicOrPrivateCloudsResponse') ) ] ) From d9ed2ae10ff66a6483b241eb07deff1949c6354d Mon Sep 17 00:00:00 2001 From: Matias Perrone Date: Fri, 31 Oct 2025 11:01:18 -0300 Subject: [PATCH 08/12] fix: comment --- .../Controllers/Apis/Marketplace/PublicCloudsApiController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/Apis/Marketplace/PublicCloudsApiController.php b/app/Http/Controllers/Apis/Marketplace/PublicCloudsApiController.php index 9b3f37bce..237d06625 100644 --- a/app/Http/Controllers/Apis/Marketplace/PublicCloudsApiController.php +++ b/app/Http/Controllers/Apis/Marketplace/PublicCloudsApiController.php @@ -26,7 +26,7 @@ final class PublicCloudsApiController extends AbstractCompanyServiceApiController { /** - * PrivateCloudsApiController constructor. + * PublicCloudsApiController constructor. * @param IPublicCloudServiceRepository $repository */ public function __construct(IPublicCloudServiceRepository $repository, IResourceServerContext $resource_server_context) From 4b94981c420a16eda9fc7e9df8a135850e730db1 Mon Sep 17 00:00:00 2001 From: Matias Perrone Date: Tue, 11 Nov 2025 20:48:51 +0000 Subject: [PATCH 09/12] chore: Move to Marketplace single tag --- .../Apis/Marketplace/PublicCloudsApiController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/Apis/Marketplace/PublicCloudsApiController.php b/app/Http/Controllers/Apis/Marketplace/PublicCloudsApiController.php index 237d06625..413500149 100644 --- a/app/Http/Controllers/Apis/Marketplace/PublicCloudsApiController.php +++ b/app/Http/Controllers/Apis/Marketplace/PublicCloudsApiController.php @@ -39,7 +39,7 @@ public function __construct(IPublicCloudServiceRepository $repository, IResource description: "Get all marketplace public cloud services (OpenStack implementations)", summary: 'Get all public clouds', operationId: 'getAllPublicClouds', - tags: ['Public Clouds'], + tags: ['Marketplace'], parameters: [ new OA\Parameter( name: 'filter[]', @@ -96,4 +96,4 @@ public function getAll() { return parent::getAll(); } -} \ No newline at end of file +} From 54a04db85876c5f8366bdbb11e6120e427644ad9 Mon Sep 17 00:00:00 2001 From: Matias Perrone Date: Thu, 27 Nov 2025 16:02:37 +0000 Subject: [PATCH 10/12] chore: update with refs --- .../Marketplace/PublicCloudsApiController.php | 18 ++++++++- app/Swagger/MarketplaceSchemas.php | 29 ++------------ app/Swagger/Models/CloudServiceSchema.php | 40 +++++++++++++++++++ app/Swagger/schemas.php | 40 ------------------- 4 files changed, 60 insertions(+), 67 deletions(-) create mode 100644 app/Swagger/Models/CloudServiceSchema.php diff --git a/app/Http/Controllers/Apis/Marketplace/PublicCloudsApiController.php b/app/Http/Controllers/Apis/Marketplace/PublicCloudsApiController.php index 413500149..c0729beb9 100644 --- a/app/Http/Controllers/Apis/Marketplace/PublicCloudsApiController.php +++ b/app/Http/Controllers/Apis/Marketplace/PublicCloudsApiController.php @@ -39,8 +39,22 @@ public function __construct(IPublicCloudServiceRepository $repository, IResource description: "Get all marketplace public cloud services (OpenStack implementations)", summary: 'Get all public clouds', operationId: 'getAllPublicClouds', - tags: ['Marketplace'], + tags: ['Marketplace', 'Clouds'], parameters: [ + new OA\Parameter( + name: 'page', + in: 'query', + required: false, + description: 'Page number for pagination', + schema: new OA\Schema(type: 'integer', example: 1) + ), + new OA\Parameter( + name: 'per_page', + in: 'query', + required: false, + description: 'Items per page', + schema: new OA\Schema(type: 'integer', example: 10, maximum: 100) + ), new OA\Parameter( name: 'filter[]', in: 'query', @@ -96,4 +110,4 @@ public function getAll() { return parent::getAll(); } -} +} \ No newline at end of file diff --git a/app/Swagger/MarketplaceSchemas.php b/app/Swagger/MarketplaceSchemas.php index d2fd51025..a6f0b6fe5 100644 --- a/app/Swagger/MarketplaceSchemas.php +++ b/app/Swagger/MarketplaceSchemas.php @@ -66,29 +66,6 @@ class PaginatedMarketplaceDistributionResponseSchema { } -#[OA\Schema( - schema: 'PublicOrPrivateCloudsResponse', - type: 'object', - properties: [ - 'id' => new OA\Property(property: 'id', type: 'integer', example: 1), - 'class_name' => new OA\Property(property: 'class_name', type: 'string', example: 'PublicCloudService'), - 'name' => new OA\Property(property: 'name', type: 'string', example: 'AWS OpenStack Compatible Service'), - 'overview' => new OA\Property(property: 'overview', type: 'string', example: 'Public cloud service with OpenStack compatibility'), - 'call_2_action_url' => new OA\Property(property: 'call_2_action_url', type: 'string', example: 'https://example.com/public-cloud'), - 'slug' => new OA\Property(property: 'slug', type: 'string', example: 'aws-openstack-service'), - 'company_id' => new OA\Property(property: 'company_id', type: 'integer', example: 1), - 'type_id' => new OA\Property(property: 'type_id', type: 'integer', example: 1), - 'is_compatible_with_storage' => new OA\Property(property: 'is_compatible_with_storage', type: 'boolean', example: true), - 'is_compatible_with_compute' => new OA\Property(property: 'is_compatible_with_compute', type: 'boolean', example: true), - 'is_compatible_with_federated_identity' => new OA\Property(property: 'is_compatible_with_federated_identity', type: 'boolean', example: true), - 'is_compatible_with_platform' => new OA\Property(property: 'is_compatible_with_platform', type: 'boolean', example: true), - 'is_openstack_powered' => new OA\Property(property: 'is_openstack_powered', type: 'boolean', example: false), - 'is_openstack_tested' => new OA\Property(property: 'is_openstack_tested', type: 'boolean', example: true), - 'openstack_tested_info' => new OA\Property(property: 'openstack_tested_info', type: 'string', example: 'Compatible with OpenStack APIs') - ] -)] -class PublicOrPrivateCloudsResponseSchema {} - #[OA\Schema( schema: 'PaginatedPublicOrPrivateCloudsResponse', allOf: [ @@ -99,10 +76,12 @@ class PublicOrPrivateCloudsResponseSchema {} new OA\Property( property: 'data', type: 'array', - items: new OA\Items(ref: '#/components/schemas/PublicOrPrivateCloudsResponse') + items: new OA\Items(ref: '#/components/schemas/CloudService') ) ] ) ] )] -class PaginatedPublicOrPrivateCloudsResponseSchema {} +class PaginatedPublicOrPrivateCloudsResponseSchema +{ +} diff --git a/app/Swagger/Models/CloudServiceSchema.php b/app/Swagger/Models/CloudServiceSchema.php new file mode 100644 index 000000000..deaebd417 --- /dev/null +++ b/app/Swagger/Models/CloudServiceSchema.php @@ -0,0 +1,40 @@ + new OA\Property(property: 'id', type: 'integer', example: 1), - 'class_name' => new OA\Property(property: 'class_name', type: 'string', example: 'PublicCloudService'), - 'name' => new OA\Property(property: 'name', type: 'string', example: 'AWS OpenStack Compatible Service'), - 'overview' => new OA\Property(property: 'overview', type: 'string', example: 'Public cloud service with OpenStack compatibility'), - 'call_2_action_url' => new OA\Property(property: 'call_2_action_url', type: 'string', example: 'https://example.com/public-cloud'), - 'slug' => new OA\Property(property: 'slug', type: 'string', example: 'aws-openstack-service'), - 'company_id' => new OA\Property(property: 'company_id', type: 'integer', example: 1), - 'type_id' => new OA\Property(property: 'type_id', type: 'integer', example: 1), - 'is_compatible_with_storage' => new OA\Property(property: 'is_compatible_with_storage', type: 'boolean', example: true), - 'is_compatible_with_compute' => new OA\Property(property: 'is_compatible_with_compute', type: 'boolean', example: true), - 'is_compatible_with_federated_identity' => new OA\Property(property: 'is_compatible_with_federated_identity', type: 'boolean', example: true), - 'is_compatible_with_platform' => new OA\Property(property: 'is_compatible_with_platform', type: 'boolean', example: true), - 'is_openstack_powered' => new OA\Property(property: 'is_openstack_powered', type: 'boolean', example: false), - 'is_openstack_tested' => new OA\Property(property: 'is_openstack_tested', type: 'boolean', example: true), - 'openstack_tested_info' => new OA\Property(property: 'openstack_tested_info', type: 'string', example: 'Compatible with OpenStack APIs') - ] -)] -class PublicOrPrivateCloudsResponseSchema {} - -#[OA\Schema( - schema: 'PaginatedPublicOrPrivateCloudsResponseSchema', - allOf: [ - new OA\Schema(ref: '#/components/schemas/PaginateDataSchemaResponse'), - new OA\Schema( - type: 'object', - properties: [ - new OA\Property( - property: 'data', - type: 'array', - items: new OA\Items(ref: '#/components/schemas/PublicOrPrivateCloudsResponseSchema') - ) - ] - ) - ] -)] -class PaginatedPublicOrPrivateCloudsResponseSchema {} From 6f38c3606aeff4e370378d84c5fd89487c4189e1 Mon Sep 17 00:00:00 2001 From: Matias Perrone Date: Thu, 27 Nov 2025 18:52:36 +0000 Subject: [PATCH 11/12] feat: add OpenAPI documentation for CloudService, DataCenterLocation, and DataCenterRegion schemas --- app/Swagger/Models/CloudServiceSchema.php | 37 +++++-------------- .../Models/DataCenterLocationSchema.php | 27 ++++++++++++++ app/Swagger/Models/DataCenterRegionSchema.php | 21 +++++++++++ 3 files changed, 58 insertions(+), 27 deletions(-) create mode 100644 app/Swagger/Models/DataCenterLocationSchema.php create mode 100644 app/Swagger/Models/DataCenterRegionSchema.php diff --git a/app/Swagger/Models/CloudServiceSchema.php b/app/Swagger/Models/CloudServiceSchema.php index deaebd417..6ee36d87a 100644 --- a/app/Swagger/Models/CloudServiceSchema.php +++ b/app/Swagger/Models/CloudServiceSchema.php @@ -7,33 +7,16 @@ #[OA\Schema( schema: 'CloudService', - type: 'object', - properties: [ - new OA\Property(property: 'id', type: 'integer', example: 1), - new OA\Property(property: 'created', type: 'integer', example: 1), - new OA\Property(property: 'last_edited', type: 'integer', example: 1), - new OA\Property(property: 'class_name', type: 'string', example: 'PublicCloudService'), - new OA\Property(property: 'name', type: 'string', example: 'AWS OpenStack Compatible Service'), - new OA\Property(property: 'overview', type: 'string', example: 'Public cloud service with OpenStack compatibility'), - new OA\Property(property: 'call_2_action_url', type: 'string', example: 'https://example.com/public-cloud'), - new OA\Property(property: 'slug', type: 'string', example: 'aws-openstack-service'), - new OA\Property(property: 'company_id', type: 'integer', example: 1), - new OA\Property(property: 'type_id', type: 'integer', example: 1), - new OA\Property(property: 'is_compatible_with_storage', type: 'boolean', example: true), - new OA\Property(property: 'is_compatible_with_compute', type: 'boolean', example: true), - new OA\Property(property: 'is_compatible_with_federated_identity', type: 'boolean', example: true), - new OA\Property(property: 'is_compatible_with_platform', type: 'boolean', example: true), - new OA\Property(property: 'is_openstack_powered', type: 'boolean', example: false), - new OA\Property(property: 'is_openstack_tested', type: 'boolean', example: true), - new OA\Property(property: 'openstack_tested_info', type: 'string', example: 'Compatible with OpenStack APIs'), - new OA\Property(property: 'company', ref: '#/components/schemas/Company'), - new OA\Property(property: 'type', ref: '#/components/schemas/SponsorshipType'), - new OA\Property(property: 'reviews', type: 'array', items: new OA\Items(ref: '#/components/schemas/MarketPlaceReview')), - new OA\Property(property: 'capabilities', type: 'array', items: new OA\Items(ref: '#/components/schemas/OpenStackImplementationApiCoverage')), - new OA\Property(property: 'guests', type: 'array', items: new OA\Items(ref: '#/components/schemas/HyperVisorType')), - new OA\Property(property: 'hypervisors', type: 'array', items: new OA\Items(ref: '#/components/schemas/GuestOSType')), - new OA\Property(property: 'supported_regions', type: 'array', items: new OA\Items(ref: '#/components/schemas/RegionalSupport')), - ] + allOf: [ + new OA\Schema(ref: '#/components/schemas/OpenStackImplementation'), + new OA\Schema( + type: 'object', + properties: [ + new OA\Property(property: 'data_centers', type: 'array', items: new OA\Items(ref: '#/components/schemas/DataCenterLocation')), + new OA\Property(property: 'data_center_regions', type: 'array', items: new OA\Items(ref: '#/components/schemas/DataCenterRegion')), + ] + ), + ], )] class CloudServiceSchema { diff --git a/app/Swagger/Models/DataCenterLocationSchema.php b/app/Swagger/Models/DataCenterLocationSchema.php new file mode 100644 index 000000000..3ec0afeb6 --- /dev/null +++ b/app/Swagger/Models/DataCenterLocationSchema.php @@ -0,0 +1,27 @@ + Date: Thu, 27 Nov 2025 19:02:20 +0000 Subject: [PATCH 12/12] chore: add requested changes --- app/Swagger/Models/CloudServiceSchema.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Swagger/Models/CloudServiceSchema.php b/app/Swagger/Models/CloudServiceSchema.php index 6ee36d87a..ff65fccee 100644 --- a/app/Swagger/Models/CloudServiceSchema.php +++ b/app/Swagger/Models/CloudServiceSchema.php @@ -12,8 +12,8 @@ new OA\Schema( type: 'object', properties: [ - new OA\Property(property: 'data_centers', type: 'array', items: new OA\Items(ref: '#/components/schemas/DataCenterLocation')), - new OA\Property(property: 'data_center_regions', type: 'array', items: new OA\Items(ref: '#/components/schemas/DataCenterRegion')), + new OA\Property(property: 'data_centers', type: 'array', items: new OA\Items(ref: '#/components/schemas/DataCenterLocation'), description: 'List of DataCenterLocation objects associated with this CloudService, only if ?relations=data_centers is used in the query string'), + new OA\Property(property: 'data_center_regions', type: 'array', items: new OA\Items(ref: '#/components/schemas/DataCenterRegion'), description: 'List of DataCenterRegion objects associated with this CloudService, only if ?relations=data_center_regions is used in the query string'), ] ), ],