diff --git a/app/Http/Controllers/Apis/Marketplace/ConsultantsApiController.php b/app/Http/Controllers/Apis/Marketplace/ConsultantsApiController.php index 43256704f..74ff62b43 100644 --- a/app/Http/Controllers/Apis/Marketplace/ConsultantsApiController.php +++ b/app/Http/Controllers/Apis/Marketplace/ConsultantsApiController.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@@consulting') + ) + ), + 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, offices, clients, spoken_languages, configuration_management_expertise, expertise_areas, services_offered, supported_regions', + schema: new OA\Schema(type: 'string', example: 'company,offices') + ), + new OA\Parameter( + name: 'relations', + in: 'query', + required: false, + description: 'Relations to load eagerly', + schema: new OA\Schema(type: 'string', example: 'company,offices') + ), + 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 consultants', + content: new OA\JsonContent(ref: '#/components/schemas/PaginatedConsultantsResponse') + ), + 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 +} diff --git a/app/Swagger/MarketplaceSchemas.php b/app/Swagger/MarketplaceSchemas.php index 6b3e2f895..3f05714e3 100644 --- a/app/Swagger/MarketplaceSchemas.php +++ b/app/Swagger/MarketplaceSchemas.php @@ -4,4 +4,37 @@ use OpenApi\Attributes as OA; -// + +#[OA\Schema( + schema: 'ConsultantsResponse', + type: 'object', + properties: [ + 'id' => new OA\Property(property: 'id', type: 'integer', example: 1), + 'class_name' => new OA\Property(property: 'class_name', type: 'string', example: 'Consultant'), + 'name' => new OA\Property(property: 'name', type: 'string', example: 'OpenStack Consulting Services'), + 'overview' => new OA\Property(property: 'overview', type: 'string', example: 'Professional OpenStack consulting and support services'), + '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-consulting'), + 'company_id' => new OA\Property(property: 'company_id', type: 'integer', example: 1), + 'type_id' => new OA\Property(property: 'type_id', type: 'integer', example: 1) + ] +)] +class ConsultantsResponseSchema {} + +#[OA\Schema( + schema: 'PaginatedConsultantsResponse', + 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/ConsultantsResponse') + ) + ] + ) + ] +)] +class PaginatedConsultantsResponseSchema {}