diff --git a/app/Http/Controllers/Apis/Marketplace/DistributionsApiController.php b/app/Http/Controllers/Apis/Marketplace/DistributionsApiController.php index 2ab1a0861..e1dcd6f80 100644 --- a/app/Http/Controllers/Apis/Marketplace/DistributionsApiController.php +++ b/app/Http/Controllers/Apis/Marketplace/DistributionsApiController.php @@ -1,4 +1,5 @@ -value. Available fields: name, company. Operators: =@, ==, @@.', + style: 'form', + explode: true, + schema: new OA\Schema( + type: 'array', + items: new OA\Items(type: 'string', example: 'name@@ubuntu') + ) + ), + new OA\Parameter( + name: 'order', + in: 'query', + required: false, + description: 'Order by field(s). Allowed fields: id, name, company', + 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 distributions', + content: new OA\JsonContent(ref: "#/components/schemas/PaginatedMarketplaceDistributionResponseSchema") + ), + 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/Models/Foundation/Marketplace/CompanyService.php b/app/Models/Foundation/Marketplace/CompanyService.php index 31e494087..71ff04e10 100644 --- a/app/Models/Foundation/Marketplace/CompanyService.php +++ b/app/Models/Foundation/Marketplace/CompanyService.php @@ -152,7 +152,7 @@ public function getCompany() } /** - * @return Company + * @return MarketPlaceType */ public function getType() { @@ -225,4 +225,4 @@ public function getResources() { return $this->resources->toArray(); } -} \ No newline at end of file +} diff --git a/app/Swagger/MarketplaceSchemas.php b/app/Swagger/MarketplaceSchemas.php index 3f05714e3..278fb4b27 100644 --- a/app/Swagger/MarketplaceSchemas.php +++ b/app/Swagger/MarketplaceSchemas.php @@ -19,7 +19,9 @@ 'type_id' => new OA\Property(property: 'type_id', type: 'integer', example: 1) ] )] -class ConsultantsResponseSchema {} +class ConsultantsResponseSchema +{ +} #[OA\Schema( schema: 'PaginatedConsultantsResponse', @@ -37,4 +39,29 @@ class ConsultantsResponseSchema {} ) ] )] -class PaginatedConsultantsResponseSchema {} +class PaginatedConsultantsResponseSchema +{ +} + + + + +#[OA\Schema( + schema: 'PaginatedMarketplaceDistributionResponseSchema', + 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/Distribution') + ) + ] + ) + ] +)] +class PaginatedMarketplaceDistributionResponseSchema +{ +} diff --git a/app/Swagger/Models/CompanySchema.php b/app/Swagger/Models/CompanySchema.php new file mode 100644 index 000000000..2657628df --- /dev/null +++ b/app/Swagger/Models/CompanySchema.php @@ -0,0 +1,42 @@ +