diff --git a/app/Http/Controllers/Apis/Marketplace/PublicCloudsApiController.php b/app/Http/Controllers/Apis/Marketplace/PublicCloudsApiController.php index 1b416d589..c0729beb9 100644 --- a/app/Http/Controllers/Apis/Marketplace/PublicCloudsApiController.php +++ b/app/Http/Controllers/Apis/Marketplace/PublicCloudsApiController.php @@ -1,4 +1,7 @@ -value. 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(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") + ] + )] public function getAll() { return parent::getAll(); diff --git a/app/Swagger/MarketplaceSchemas.php b/app/Swagger/MarketplaceSchemas.php index 278fb4b27..a6f0b6fe5 100644 --- a/app/Swagger/MarketplaceSchemas.php +++ b/app/Swagger/MarketplaceSchemas.php @@ -65,3 +65,23 @@ class PaginatedConsultantsResponseSchema class PaginatedMarketplaceDistributionResponseSchema { } + +#[OA\Schema( + schema: 'PaginatedPublicOrPrivateCloudsResponse', + 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/CloudService') + ) + ] + ) + ] +)] +class PaginatedPublicOrPrivateCloudsResponseSchema +{ +} diff --git a/app/Swagger/Models/CloudServiceSchema.php b/app/Swagger/Models/CloudServiceSchema.php new file mode 100644 index 000000000..ff65fccee --- /dev/null +++ b/app/Swagger/Models/CloudServiceSchema.php @@ -0,0 +1,23 @@ +