From bc297920744458ad5ee94c4c8abc81d02dbd39c5 Mon Sep 17 00:00:00 2001 From: Matias Perrone Date: Mon, 29 Sep 2025 15:01:38 -0300 Subject: [PATCH 01/15] feat: Add OpenAPI documentation to "getAll" method --- .../Marketplace/AppliancesApiController.php | 94 ++++++++++++++++++- 1 file changed, 93 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/Apis/Marketplace/AppliancesApiController.php b/app/Http/Controllers/Apis/Marketplace/AppliancesApiController.php index fb6cfe2c2..f679195a2 100644 --- a/app/Http/Controllers/Apis/Marketplace/AppliancesApiController.php +++ b/app/Http/Controllers/Apis/Marketplace/AppliancesApiController.php @@ -12,7 +12,9 @@ * limitations under the License. **/ use App\Models\Foundation\Marketplace\IApplianceRepository; +use Illuminate\Http\Response; use models\oauth2\IResourceServerContext; +use OpenApi\Attributes as OA; /** * Class AppliancesApiController @@ -30,8 +32,98 @@ public function __construct(IApplianceRepository $repository, IResourceServerCon parent::__construct($repository, $resource_server_context); } + #[OA\Get( + path: "/api/public/v1/marketplace/appliances", + description: "Get all marketplace appliances (OpenStack implementations)", + summary: 'Get all appliances', + operationId: 'getAllAppliances', + tags: ['Appliances'], + 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@@openstack') + ) + ), + 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', + schema: new OA\Schema(type: 'string', example: 'company,type') + ), + new OA\Parameter( + name: 'relations', + in: 'query', + required: false, + description: 'Relations to load eagerly', + schema: new OA\Schema(type: 'string', example: 'company,type') + ), + 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 appliances', + content: new OA\JsonContent( + properties: [ + 'total' => new OA\Property(property: 'total', type: 'integer', example: 25), + 'per_page' => new OA\Property(property: 'per_page', type: 'integer', example: 25), + '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: 'Appliance'), + 'name' => new OA\Property(property: 'name', type: 'string', example: 'OpenStack Private Cloud Appliance'), + 'overview' => new OA\Property(property: 'overview', type: 'string', example: 'Complete OpenStack solution'), + 'call_2_action_url' => new OA\Property(property: 'call_2_action_url', type: 'string', example: 'https://example.com/contact'), + 'slug' => new OA\Property(property: 'slug', type: 'string', example: 'openstack-appliance'), + '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: false), + '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: true), + '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: 'Tested with OpenStack Yoga') + ], + 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 4849e0dfa909efa4befeba235a5d3efbcc682eec Mon Sep 17 00:00:00 2001 From: Matias Perrone Date: Tue, 30 Sep 2025 15:37:19 -0300 Subject: [PATCH 02/15] fix: namespace positioning --- .../Controllers/Apis/Marketplace/AppliancesApiController.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/Apis/Marketplace/AppliancesApiController.php b/app/Http/Controllers/Apis/Marketplace/AppliancesApiController.php index f679195a2..3b652ae3f 100644 --- a/app/Http/Controllers/Apis/Marketplace/AppliancesApiController.php +++ b/app/Http/Controllers/Apis/Marketplace/AppliancesApiController.php @@ -1,4 +1,7 @@ - Date: Tue, 30 Sep 2025 16:51:03 -0300 Subject: [PATCH 03/15] chore: Add controller's response OpenAPI schema --- .../Marketplace/AppliancesApiController.php | 34 +------------------ 1 file changed, 1 insertion(+), 33 deletions(-) diff --git a/app/Http/Controllers/Apis/Marketplace/AppliancesApiController.php b/app/Http/Controllers/Apis/Marketplace/AppliancesApiController.php index 3b652ae3f..2c0d54bb1 100644 --- a/app/Http/Controllers/Apis/Marketplace/AppliancesApiController.php +++ b/app/Http/Controllers/Apis/Marketplace/AppliancesApiController.php @@ -87,39 +87,7 @@ public function __construct(IApplianceRepository $repository, IResourceServerCon new OA\Response( response: 200, description: 'Success - Returns paginated list of appliances', - content: new OA\JsonContent( - properties: [ - 'total' => new OA\Property(property: 'total', type: 'integer', example: 25), - 'per_page' => new OA\Property(property: 'per_page', type: 'integer', example: 25), - '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: 'Appliance'), - 'name' => new OA\Property(property: 'name', type: 'string', example: 'OpenStack Private Cloud Appliance'), - 'overview' => new OA\Property(property: 'overview', type: 'string', example: 'Complete OpenStack solution'), - 'call_2_action_url' => new OA\Property(property: 'call_2_action_url', type: 'string', example: 'https://example.com/contact'), - 'slug' => new OA\Property(property: 'slug', type: 'string', example: 'openstack-appliance'), - '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: false), - '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: true), - '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: 'Tested with OpenStack Yoga') - ], - type: 'object' - ) - ) - ], - type: 'object' - ) + content: new OA\JsonContent(ref: '#/components/schemas/PaginatedAppliancesListResponse') ), new OA\Response(response: Response::HTTP_PRECONDITION_FAILED, description: "Validation Error"), new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error") From 5e285c85c8e5eb79edc70ec17cc65c35ea3e3bc0 Mon Sep 17 00:00:00 2001 From: Matias Perrone Date: Wed, 1 Oct 2025 15:00:58 -0300 Subject: [PATCH 04/15] chore: Add Marketplace tag --- .../Controllers/Apis/Marketplace/AppliancesApiController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/Apis/Marketplace/AppliancesApiController.php b/app/Http/Controllers/Apis/Marketplace/AppliancesApiController.php index 2c0d54bb1..6326717e4 100644 --- a/app/Http/Controllers/Apis/Marketplace/AppliancesApiController.php +++ b/app/Http/Controllers/Apis/Marketplace/AppliancesApiController.php @@ -40,7 +40,7 @@ public function __construct(IApplianceRepository $repository, IResourceServerCon description: "Get all marketplace appliances (OpenStack implementations)", summary: 'Get all appliances', operationId: 'getAllAppliances', - tags: ['Appliances'], + tags: ['Appliances', 'Marketplace'], parameters: [ new OA\Parameter( name: 'filter[]', From 22564b4b61c9a36d3a5b583143e57305b4c49bfe Mon Sep 17 00:00:00 2001 From: Matias Perrone Date: Mon, 6 Oct 2025 17:07:02 -0300 Subject: [PATCH 05/15] chore: move schemas to a the 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 a6f0b6fe5..825bb26dc 100644 --- a/app/Swagger/MarketplaceSchemas.php +++ b/app/Swagger/MarketplaceSchemas.php @@ -85,3 +85,44 @@ class PaginatedMarketplaceDistributionResponseSchema class PaginatedPublicOrPrivateCloudsResponseSchema { } + +#[OA\Schema( + schema: 'MarketplaceAppliancesResponseSchema', + type: 'object', + properties: [ + 'id' => new OA\Property(property: 'id', type: 'integer', example: 1), + 'class_name' => new OA\Property(property: 'class_name', type: 'string', example: 'Appliance'), + 'name' => new OA\Property(property: 'name', type: 'string', example: 'OpenStack Private Cloud Appliance'), + 'overview' => new OA\Property(property: 'overview', type: 'string', example: 'Complete OpenStack solution'), + 'call_2_action_url' => new OA\Property(property: 'call_2_action_url', type: 'string', example: 'https://example.com/contact'), + 'slug' => new OA\Property(property: 'slug', type: 'string', example: 'openstack-appliance'), + '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: false), + '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: true), + '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: 'Tested with OpenStack Yoga') + ] +)] +class MarketplaceAppliancesResponseSchema {} + +#[OA\Schema( + schema: 'PaginatedMarketplaceAppliancesResponseSchema', + 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/MarketplaceAppliancesResponseSchema') + ) + ] + ) + ] +)] +class PaginatedMarketplaceAppliancesResponseSchema {} From 2680eccde8c035cb239f9705c2f4cf8ddef838c2 Mon Sep 17 00:00:00 2001 From: Matias Perrone Date: Mon, 6 Oct 2025 19:00:36 -0300 Subject: [PATCH 06/15] chore: add optional fields --- app/Swagger/MarketplaceSchemas.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/app/Swagger/MarketplaceSchemas.php b/app/Swagger/MarketplaceSchemas.php index 825bb26dc..9c67dfa49 100644 --- a/app/Swagger/MarketplaceSchemas.php +++ b/app/Swagger/MarketplaceSchemas.php @@ -96,8 +96,6 @@ class PaginatedPublicOrPrivateCloudsResponseSchema 'overview' => new OA\Property(property: 'overview', type: 'string', example: 'Complete OpenStack solution'), 'call_2_action_url' => new OA\Property(property: 'call_2_action_url', type: 'string', example: 'https://example.com/contact'), 'slug' => new OA\Property(property: 'slug', type: 'string', example: 'openstack-appliance'), - '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: false), @@ -105,6 +103,18 @@ class PaginatedPublicOrPrivateCloudsResponseSchema 'is_openstack_powered' => new OA\Property(property: 'is_openstack_powered', type: 'boolean', example: true), '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: 'Tested with OpenStack Yoga') + ], + anyOf: [ + new OA\Schema(anyOf: [ + 'company_id' => new OA\Property(property: 'company_id', type: 'integer', example: 41), + 'company' => new OA\Property(property: 'company', type: 'Company'), + + ]), + new OA\Schema(anyOf: [ + 'type_id' => new OA\Property(property: 'type_id', type: 'integer', example: 13), + 'type' => new OA\Property(property: 'type', type: 'MarketPlaceType'), + ]), + new OA\Property(property: 'reviews', type: 'array', items: new OA\Items(type: 'MarketPlaceReview', title: 'MarketPlaceReview')), ] )] class MarketplaceAppliancesResponseSchema {} From 55c63e77cb44c8c4011aaffaa45fe043444ffbad Mon Sep 17 00:00:00 2001 From: Matias Perrone Date: Tue, 7 Oct 2025 17:59:12 -0300 Subject: [PATCH 07/15] fix: fix typo --- .../Apis/Marketplace/AppliancesApiController.php | 2 +- app/Swagger/MarketplaceSchemas.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/Http/Controllers/Apis/Marketplace/AppliancesApiController.php b/app/Http/Controllers/Apis/Marketplace/AppliancesApiController.php index 6326717e4..67bdce7bd 100644 --- a/app/Http/Controllers/Apis/Marketplace/AppliancesApiController.php +++ b/app/Http/Controllers/Apis/Marketplace/AppliancesApiController.php @@ -87,7 +87,7 @@ public function __construct(IApplianceRepository $repository, IResourceServerCon new OA\Response( response: 200, description: 'Success - Returns paginated list of appliances', - content: new OA\JsonContent(ref: '#/components/schemas/PaginatedAppliancesListResponse') + content: new OA\JsonContent(ref: '#/components/schemas/PaginatedMarketplaceAppliancesResponse') ), 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/MarketplaceSchemas.php b/app/Swagger/MarketplaceSchemas.php index 9c67dfa49..90be01401 100644 --- a/app/Swagger/MarketplaceSchemas.php +++ b/app/Swagger/MarketplaceSchemas.php @@ -87,7 +87,7 @@ class PaginatedPublicOrPrivateCloudsResponseSchema } #[OA\Schema( - schema: 'MarketplaceAppliancesResponseSchema', + schema: 'MarketplaceAppliancesResponse', type: 'object', properties: [ 'id' => new OA\Property(property: 'id', type: 'integer', example: 1), @@ -120,7 +120,7 @@ class PaginatedPublicOrPrivateCloudsResponseSchema class MarketplaceAppliancesResponseSchema {} #[OA\Schema( - schema: 'PaginatedMarketplaceAppliancesResponseSchema', + schema: 'PaginatedMarketplaceAppliancesResponse', allOf: [ new OA\Schema(ref: '#/components/schemas/PaginateDataSchemaResponse'), new OA\Schema( @@ -129,7 +129,7 @@ class MarketplaceAppliancesResponseSchema {} new OA\Property( property: 'data', type: 'array', - items: new OA\Items(ref: '#/components/schemas/MarketplaceAppliancesResponseSchema') + items: new OA\Items(ref: '#/components/schemas/MarketplaceAppliancesResponse') ) ] ) From 5b44592268e3ca2d87b59af7b81e393dfdc4ca5c Mon Sep 17 00:00:00 2001 From: Matias Perrone Date: Tue, 14 Oct 2025 12:52:42 -0300 Subject: [PATCH 08/15] chore: Revert a minor change to main version --- app/Models/Foundation/Marketplace/CompanyService.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Models/Foundation/Marketplace/CompanyService.php b/app/Models/Foundation/Marketplace/CompanyService.php index 71ff04e10..7c82f659e 100644 --- a/app/Models/Foundation/Marketplace/CompanyService.php +++ b/app/Models/Foundation/Marketplace/CompanyService.php @@ -225,4 +225,4 @@ public function getResources() { return $this->resources->toArray(); } -} +} \ No newline at end of file From 470d6871e73a39f8119e2b3f535af4080b77bb33 Mon Sep 17 00:00:00 2001 From: Matias Perrone Date: Tue, 11 Nov 2025 20:44:28 +0000 Subject: [PATCH 09/15] chore: Add missing param in PHPDoc constructor documentation --- .../Controllers/Apis/Marketplace/AppliancesApiController.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/Apis/Marketplace/AppliancesApiController.php b/app/Http/Controllers/Apis/Marketplace/AppliancesApiController.php index 67bdce7bd..4f1b298bf 100644 --- a/app/Http/Controllers/Apis/Marketplace/AppliancesApiController.php +++ b/app/Http/Controllers/Apis/Marketplace/AppliancesApiController.php @@ -29,6 +29,7 @@ final class AppliancesApiController extends AbstractCompanyServiceApiController /** * AppliancesApiController constructor. * @param IApplianceRepository $repository + * @param IResourceServerContext $resource_server_context */ public function __construct(IApplianceRepository $repository, IResourceServerContext $resource_server_context) { @@ -97,4 +98,4 @@ public function getAll() { return parent::getAll(); } -} +} \ No newline at end of file From e5842918f9b11ff7950547d6bc745c2188552b61 Mon Sep 17 00:00:00 2001 From: Matias Perrone Date: Fri, 14 Nov 2025 18:42:22 +0000 Subject: [PATCH 10/15] chore: update schema --- app/Swagger/MarketplaceSchemas.php | 51 ++++++++++++++---------------- 1 file changed, 24 insertions(+), 27 deletions(-) diff --git a/app/Swagger/MarketplaceSchemas.php b/app/Swagger/MarketplaceSchemas.php index 90be01401..3e097aba4 100644 --- a/app/Swagger/MarketplaceSchemas.php +++ b/app/Swagger/MarketplaceSchemas.php @@ -90,34 +90,29 @@ class PaginatedPublicOrPrivateCloudsResponseSchema schema: 'MarketplaceAppliancesResponse', type: 'object', properties: [ - 'id' => new OA\Property(property: 'id', type: 'integer', example: 1), - 'class_name' => new OA\Property(property: 'class_name', type: 'string', example: 'Appliance'), - 'name' => new OA\Property(property: 'name', type: 'string', example: 'OpenStack Private Cloud Appliance'), - 'overview' => new OA\Property(property: 'overview', type: 'string', example: 'Complete OpenStack solution'), - 'call_2_action_url' => new OA\Property(property: 'call_2_action_url', type: 'string', example: 'https://example.com/contact'), - 'slug' => new OA\Property(property: 'slug', type: 'string', example: 'openstack-appliance'), - '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: false), - '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: true), - '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: 'Tested with OpenStack Yoga') + new OA\Property(property: 'id', type: 'integer', example: 1), + new OA\Property(property: 'class_name', type: 'string', example: 'Appliance'), + new OA\Property(property: 'name', type: 'string', example: 'OpenStack Private Cloud Appliance'), + new OA\Property(property: 'overview', type: 'string', example: 'Complete OpenStack solution'), + new OA\Property(property: 'call_2_action_url', type: 'string', example: 'https://example.com/contact'), + new OA\Property(property: 'slug', type: 'string', example: 'openstack-appliance'), + 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: false), + new OA\Property(property: 'is_compatible_with_platform', type: 'boolean', example: true), + new OA\Property(property: 'is_openstack_powered', type: 'boolean', example: true), + new OA\Property(property: 'is_openstack_tested', type: 'boolean', example: true), + new OA\Property(property: 'openstack_tested_info', type: 'string', example: 'Tested with OpenStack Yoga'), + new OA\Property(property: 'company_id', type: 'integer', example: 41, description: 'ID of the company that provides this appliance, visible only when is not expanded'), + new OA\Property(property: 'company', type: 'Company', description: 'Company that provides this appliance, visible only when expanded'), + new OA\Property(property: 'type_id', type: 'integer', example: 13, description: 'ID of the type of this appliance'), + new OA\Property(property: 'type', type: 'MarketPlaceType', description: 'Type of this appliance, visible only when expanded'), + new OA\Property(property: 'reviews', type: 'array', items: new OA\Items(type: 'MarketPlaceReview', title: 'MarketPlaceReview'), description: 'Reviews of this appliance, visible only when expanded'), ], - anyOf: [ - new OA\Schema(anyOf: [ - 'company_id' => new OA\Property(property: 'company_id', type: 'integer', example: 41), - 'company' => new OA\Property(property: 'company', type: 'Company'), - - ]), - new OA\Schema(anyOf: [ - 'type_id' => new OA\Property(property: 'type_id', type: 'integer', example: 13), - 'type' => new OA\Property(property: 'type', type: 'MarketPlaceType'), - ]), - new OA\Property(property: 'reviews', type: 'array', items: new OA\Items(type: 'MarketPlaceReview', title: 'MarketPlaceReview')), - ] )] -class MarketplaceAppliancesResponseSchema {} +class MarketplaceAppliancesResponseSchema +{ +} #[OA\Schema( schema: 'PaginatedMarketplaceAppliancesResponse', @@ -135,4 +130,6 @@ class MarketplaceAppliancesResponseSchema {} ) ] )] -class PaginatedMarketplaceAppliancesResponseSchema {} +class PaginatedMarketplaceAppliancesResponseSchema +{ +} From f5fc56fe37f41a01d93b684a4c2ae2c6d7aa5e77 Mon Sep 17 00:00:00 2001 From: Matias Perrone Date: Fri, 14 Nov 2025 19:38:04 +0000 Subject: [PATCH 11/15] chore: Add missing fields --- .../Apis/Marketplace/AppliancesApiController.php | 16 +++++++++++++++- app/Swagger/MarketplaceSchemas.php | 7 ++++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/Apis/Marketplace/AppliancesApiController.php b/app/Http/Controllers/Apis/Marketplace/AppliancesApiController.php index 4f1b298bf..179f357ca 100644 --- a/app/Http/Controllers/Apis/Marketplace/AppliancesApiController.php +++ b/app/Http/Controllers/Apis/Marketplace/AppliancesApiController.php @@ -43,6 +43,20 @@ public function __construct(IApplianceRepository $repository, IResourceServerCon operationId: 'getAllAppliances', tags: ['Appliances', 'Marketplace'], 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', @@ -98,4 +112,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 3e097aba4..29d0a11f7 100644 --- a/app/Swagger/MarketplaceSchemas.php +++ b/app/Swagger/MarketplaceSchemas.php @@ -107,7 +107,12 @@ class PaginatedPublicOrPrivateCloudsResponseSchema new OA\Property(property: 'company', type: 'Company', description: 'Company that provides this appliance, visible only when expanded'), new OA\Property(property: 'type_id', type: 'integer', example: 13, description: 'ID of the type of this appliance'), new OA\Property(property: 'type', type: 'MarketPlaceType', description: 'Type of this appliance, visible only when expanded'), + new OA\Property(property: 'types', type: 'array', items: new OA\Items(type: 'RegionalSupport'), description: 'Regional support of this appliance, visible only when requested as relation'), new OA\Property(property: 'reviews', type: 'array', items: new OA\Items(type: 'MarketPlaceReview', title: 'MarketPlaceReview'), description: 'Reviews of this appliance, visible only when expanded'), + new OA\Property(property: 'capabilities', type: 'array', items: new OA\Items(type: 'OpenStackImplementationApiCoverage'), description: 'Capabilities of this appliance, visible only when requested as relation'), + new OA\Property(property: 'hypervisors', type: 'array', items: new OA\Items(type: 'HyperVisorType'), description: 'Hypervisors of this appliance, visible only when requested as relation'), + new OA\Property(property: 'guests', type: 'array', items: new OA\Items(type: 'GuestOSType'), description: 'GuestOSType of this appliance, visible only when requested as relation'), + new OA\Property(property: 'supported_regions', type: 'array', items: new OA\Items(type: 'RegionalSupport'), description: 'Regional support of this appliance, visible only when requested as relation'), ], )] class MarketplaceAppliancesResponseSchema @@ -132,4 +137,4 @@ class MarketplaceAppliancesResponseSchema )] class PaginatedMarketplaceAppliancesResponseSchema { -} +} \ No newline at end of file From 0d614595441e76a754033fa40bca409974d5989e Mon Sep 17 00:00:00 2001 From: Matias Perrone Date: Fri, 14 Nov 2025 20:08:19 +0000 Subject: [PATCH 12/15] fix: incorrect type --- app/Swagger/MarketplaceSchemas.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Swagger/MarketplaceSchemas.php b/app/Swagger/MarketplaceSchemas.php index 29d0a11f7..ba1930afd 100644 --- a/app/Swagger/MarketplaceSchemas.php +++ b/app/Swagger/MarketplaceSchemas.php @@ -107,7 +107,7 @@ class PaginatedPublicOrPrivateCloudsResponseSchema new OA\Property(property: 'company', type: 'Company', description: 'Company that provides this appliance, visible only when expanded'), new OA\Property(property: 'type_id', type: 'integer', example: 13, description: 'ID of the type of this appliance'), new OA\Property(property: 'type', type: 'MarketPlaceType', description: 'Type of this appliance, visible only when expanded'), - new OA\Property(property: 'types', type: 'array', items: new OA\Items(type: 'RegionalSupport'), description: 'Regional support of this appliance, visible only when requested as relation'), + new OA\Property(property: 'types', type: 'array', items: new OA\Items(type: 'MarketPlaceType'), description: 'Regional support of this appliance, visible only when requested as relation'), new OA\Property(property: 'reviews', type: 'array', items: new OA\Items(type: 'MarketPlaceReview', title: 'MarketPlaceReview'), description: 'Reviews of this appliance, visible only when expanded'), new OA\Property(property: 'capabilities', type: 'array', items: new OA\Items(type: 'OpenStackImplementationApiCoverage'), description: 'Capabilities of this appliance, visible only when requested as relation'), new OA\Property(property: 'hypervisors', type: 'array', items: new OA\Items(type: 'HyperVisorType'), description: 'Hypervisors of this appliance, visible only when requested as relation'), @@ -137,4 +137,4 @@ class MarketplaceAppliancesResponseSchema )] class PaginatedMarketplaceAppliancesResponseSchema { -} \ No newline at end of file +} From 36440cd9bb1b7b7120c1c08ae48f9ed43ac98474 Mon Sep 17 00:00:00 2001 From: Matias Perrone Date: Wed, 19 Nov 2025 20:00:57 +0000 Subject: [PATCH 13/15] chore: move Appliance schema to its own file for reusability --- .../Marketplace/AppliancesApiController.php | 4 +- app/Swagger/MarketplaceSchemas.php | 6 +-- app/Swagger/Models/ApplianceSchema.php | 41 +++++++++++++++++++ 3 files changed, 46 insertions(+), 5 deletions(-) create mode 100644 app/Swagger/Models/ApplianceSchema.php diff --git a/app/Http/Controllers/Apis/Marketplace/AppliancesApiController.php b/app/Http/Controllers/Apis/Marketplace/AppliancesApiController.php index 179f357ca..2e91d3009 100644 --- a/app/Http/Controllers/Apis/Marketplace/AppliancesApiController.php +++ b/app/Http/Controllers/Apis/Marketplace/AppliancesApiController.php @@ -102,7 +102,7 @@ public function __construct(IApplianceRepository $repository, IResourceServerCon new OA\Response( response: 200, description: 'Success - Returns paginated list of appliances', - content: new OA\JsonContent(ref: '#/components/schemas/PaginatedMarketplaceAppliancesResponse') + content: new OA\JsonContent(ref: '#/components/schemas/PaginatedAppliancesResponseSchema') ), new OA\Response(response: Response::HTTP_PRECONDITION_FAILED, description: "Validation Error"), new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error") @@ -112,4 +112,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 ba1930afd..6f585b73d 100644 --- a/app/Swagger/MarketplaceSchemas.php +++ b/app/Swagger/MarketplaceSchemas.php @@ -120,7 +120,7 @@ class MarketplaceAppliancesResponseSchema } #[OA\Schema( - schema: 'PaginatedMarketplaceAppliancesResponse', + schema: 'PaginatedAppliancesResponse', allOf: [ new OA\Schema(ref: '#/components/schemas/PaginateDataSchemaResponse'), new OA\Schema( @@ -129,12 +129,12 @@ class MarketplaceAppliancesResponseSchema new OA\Property( property: 'data', type: 'array', - items: new OA\Items(ref: '#/components/schemas/MarketplaceAppliancesResponse') + items: new OA\Items(ref: '#/components/schemas/Appliance') ) ] ) ] )] -class PaginatedMarketplaceAppliancesResponseSchema +class PaginatedAppliancesResponseSchema { } diff --git a/app/Swagger/Models/ApplianceSchema.php b/app/Swagger/Models/ApplianceSchema.php new file mode 100644 index 000000000..5bb8f9d2d --- /dev/null +++ b/app/Swagger/Models/ApplianceSchema.php @@ -0,0 +1,41 @@ + Date: Wed, 19 Nov 2025 21:26:18 +0000 Subject: [PATCH 14/15] fix: schema response name --- .../Marketplace/AppliancesApiController.php | 4 ++-- app/Swagger/Models/ApplianceSchema.php | 20 +++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/app/Http/Controllers/Apis/Marketplace/AppliancesApiController.php b/app/Http/Controllers/Apis/Marketplace/AppliancesApiController.php index 2e91d3009..e8df3abd7 100644 --- a/app/Http/Controllers/Apis/Marketplace/AppliancesApiController.php +++ b/app/Http/Controllers/Apis/Marketplace/AppliancesApiController.php @@ -102,7 +102,7 @@ public function __construct(IApplianceRepository $repository, IResourceServerCon new OA\Response( response: 200, description: 'Success - Returns paginated list of appliances', - content: new OA\JsonContent(ref: '#/components/schemas/PaginatedAppliancesResponseSchema') + content: new OA\JsonContent(ref: '#/components/schemas/PaginatedAppliancesResponse') ), new OA\Response(response: Response::HTTP_PRECONDITION_FAILED, description: "Validation Error"), new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error") @@ -112,4 +112,4 @@ public function getAll() { return parent::getAll(); } -} \ No newline at end of file +} diff --git a/app/Swagger/Models/ApplianceSchema.php b/app/Swagger/Models/ApplianceSchema.php index 5bb8f9d2d..7d7f9e42d 100644 --- a/app/Swagger/Models/ApplianceSchema.php +++ b/app/Swagger/Models/ApplianceSchema.php @@ -25,17 +25,17 @@ new OA\Property(property: 'is_openstack_tested', type: 'boolean', example: true), new OA\Property(property: 'openstack_tested_info', type: 'string', example: 'Tested with OpenStack Yoga'), new OA\Property(property: 'company_id', type: 'integer', example: 41, description: 'ID of the company that provides this appliance, visible only when is not expanded'), - new OA\Property(property: 'company', type: 'Company', description: 'Company that provides this appliance, visible only when expanded'), - new OA\Property(property: 'type_id', type: 'integer', example: 13, description: 'ID of the type of this appliance'), - new OA\Property(property: 'type', type: 'MarketPlaceType', description: 'Type of this appliance, visible only when expanded'), - new OA\Property(property: 'types', type: 'array', items: new OA\Items(type: 'MarketPlaceType'), description: 'Regional support of this appliance, visible only when requested as relation'), - new OA\Property(property: 'reviews', type: 'array', items: new OA\Items(type: 'MarketPlaceReview', title: 'MarketPlaceReview'), description: 'Reviews of this appliance, visible only when expanded'), - new OA\Property(property: 'capabilities', type: 'array', items: new OA\Items(type: 'OpenStackImplementationApiCoverage'), description: 'Capabilities of this appliance, visible only when requested as relation'), - new OA\Property(property: 'hypervisors', type: 'array', items: new OA\Items(type: 'HyperVisorType'), description: 'Hypervisors of this appliance, visible only when requested as relation'), - new OA\Property(property: 'guests', type: 'array', items: new OA\Items(type: 'GuestOSType'), description: 'GuestOSType of this appliance, visible only when requested as relation'), - new OA\Property(property: 'supported_regions', type: 'array', items: new OA\Items(type: 'RegionalSupport'), description: 'Regional support of this appliance, visible only when requested as relation'), + new OA\Property(property: 'company', ref: '#/components/schemas/Company', description: 'Company that provides this appliance, visible only when expanded'), + new OA\Property(property: 'type_id', type: 'integer', example: 13, description: 'ID of the type of this appliance, visible only when not expanded'), + new OA\Property(property: 'type', ref: '#/components/schemas/MarketPlaceType', description: 'Type of this appliance, visible only when expanded'), + new OA\Property(property: 'types', type: 'array', items: new OA\Items(ref: '#/components/schemas/MarketPlaceType'), description: 'Regional support of this appliance, visible only when requested as relation'), + new OA\Property(property: 'reviews', type: 'array', items: new OA\Items(ref: '#/components/schemas/MarketPlaceReview', title: 'MarketPlaceReview'), description: 'Reviews of this appliance, visible only when expanded'), + new OA\Property(property: 'capabilities', type: 'array', items: new OA\Items(ref: '#/components/schemas/OpenStackImplementationApiCoverage'), description: 'Capabilities of this appliance, visible only when requested as relation'), + new OA\Property(property: 'hypervisors', type: 'array', items: new OA\Items(ref: '#/components/schemas/HyperVisorType'), description: 'Hypervisors of this appliance, visible only when requested as relation'), + new OA\Property(property: 'guests', type: 'array', items: new OA\Items(ref: '#/components/schemas/GuestOSType'), description: 'GuestOSType of this appliance, visible only when requested as relation'), + new OA\Property(property: 'supported_regions', type: 'array', items: new OA\Items(ref: '#/components/schemas/RegionalSupport'), description: 'Regional support of this appliance, visible only when requested as relation'), ], )] class ApplianceSchema { -} +} \ No newline at end of file From 4918d0eb8d64efc64eff57a5eae5357c397b6578 Mon Sep 17 00:00:00 2001 From: Matias Perrone Date: Wed, 19 Nov 2025 22:03:58 +0000 Subject: [PATCH 15/15] chore: add ref schemas --- app/Swagger/Models/ApplianceSchema.php | 6 ++--- .../Models/MarketPlaceReviewSchema.php | 22 +++++++++++++++++++ 2 files changed, 25 insertions(+), 3 deletions(-) create mode 100644 app/Swagger/Models/MarketPlaceReviewSchema.php diff --git a/app/Swagger/Models/ApplianceSchema.php b/app/Swagger/Models/ApplianceSchema.php index 7d7f9e42d..1cba0158a 100644 --- a/app/Swagger/Models/ApplianceSchema.php +++ b/app/Swagger/Models/ApplianceSchema.php @@ -26,14 +26,14 @@ new OA\Property(property: 'openstack_tested_info', type: 'string', example: 'Tested with OpenStack Yoga'), new OA\Property(property: 'company_id', type: 'integer', example: 41, description: 'ID of the company that provides this appliance, visible only when is not expanded'), new OA\Property(property: 'company', ref: '#/components/schemas/Company', description: 'Company that provides this appliance, visible only when expanded'), - new OA\Property(property: 'type_id', type: 'integer', example: 13, description: 'ID of the type of this appliance, visible only when not expanded'), - new OA\Property(property: 'type', ref: '#/components/schemas/MarketPlaceType', description: 'Type of this appliance, visible only when expanded'), - new OA\Property(property: 'types', type: 'array', items: new OA\Items(ref: '#/components/schemas/MarketPlaceType'), description: 'Regional support of this appliance, visible only when requested as relation'), + new OA\Property(property: 'type_id', type: 'integer', example: 13, description: 'ID of the MarketPlaceType of this appliance, visible only when not expanded'), new OA\Property(property: 'reviews', type: 'array', items: new OA\Items(ref: '#/components/schemas/MarketPlaceReview', title: 'MarketPlaceReview'), description: 'Reviews of this appliance, visible only when expanded'), new OA\Property(property: 'capabilities', type: 'array', items: new OA\Items(ref: '#/components/schemas/OpenStackImplementationApiCoverage'), description: 'Capabilities of this appliance, visible only when requested as relation'), new OA\Property(property: 'hypervisors', type: 'array', items: new OA\Items(ref: '#/components/schemas/HyperVisorType'), description: 'Hypervisors of this appliance, visible only when requested as relation'), new OA\Property(property: 'guests', type: 'array', items: new OA\Items(ref: '#/components/schemas/GuestOSType'), description: 'GuestOSType of this appliance, visible only when requested as relation'), new OA\Property(property: 'supported_regions', type: 'array', items: new OA\Items(ref: '#/components/schemas/RegionalSupport'), description: 'Regional support of this appliance, visible only when requested as relation'), + // @TODO: Investigate how to reference properly, as it is present in ApplianceSerializer, but does not to have a serializer asociated + // new OA\Property(property: 'type', ref: '#/components/schemas/MarketPlaceType', description: 'MarketPlaceType of this appliance, visible only when expanded'), ], )] class ApplianceSchema diff --git a/app/Swagger/Models/MarketPlaceReviewSchema.php b/app/Swagger/Models/MarketPlaceReviewSchema.php new file mode 100644 index 000000000..bc033dd4e --- /dev/null +++ b/app/Swagger/Models/MarketPlaceReviewSchema.php @@ -0,0 +1,22 @@ +