From a02cb8cc872941f20b61d4d6bb300562da33758a Mon Sep 17 00:00:00 2001 From: Matias Perrone Date: Mon, 13 Oct 2025 14:43:32 -0300 Subject: [PATCH 1/6] feat: Extend Swagger Coverage for controller `OAuth2CompaniesApiController` --- .../Main/OAuth2CompaniesApiController.php | 115 +++++++++++++++++- 1 file changed, 114 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/Apis/Protected/Main/OAuth2CompaniesApiController.php b/app/Http/Controllers/Apis/Protected/Main/OAuth2CompaniesApiController.php index 9650c4a08..b963ceac1 100644 --- a/app/Http/Controllers/Apis/Protected/Main/OAuth2CompaniesApiController.php +++ b/app/Http/Controllers/Apis/Protected/Main/OAuth2CompaniesApiController.php @@ -33,6 +33,119 @@ * Class OAuth2CompaniesApiController * @package App\Http\Controllers */ +#[OA\Get( + path: "/api/v1/companies/{id}", + summary: "Get a specific company", + description: "Returns detailed information about a specific company", + tags: ["Companies"], + parameters: [ + new OA\Parameter( + name: "id", + in: "path", + required: true, + description: "Company ID", + schema: new OA\Schema(type: "integer") + ), + new OA\Parameter( + name: "expand", + in: "query", + required: false, + description: "Expand related entities. Available expansions: sponsorships, project_sponsorships", + schema: new OA\Schema(type: "string") + ), + new OA\Parameter( + name: "relations", + in: "query", + required: false, + description: "Load relations. Available: sponsorships, project_sponsorships", + schema: new OA\Schema(type: "string") + ), + ], + responses: [ + new OA\Response( + response: Response::HTTP_OK, + description: "Success", + content: new OA\JsonContent(ref: "#/components/schemas/Company") + ), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Company not found"), + ] +)] +#[OA\Post( + path: "/api/v1/companies", + summary: "Create a new company", + description: "Creates a new company", + security: [["oauth2_security_scope" => ["openid", "profile", "email"]]], + tags: ["Companies"], + requestBody: new OA\RequestBody( + required: true, + content: new OA\JsonContent(ref: "#/components/schemas/CompanyCreateRequest") + ), + responses: [ + new OA\Response( + response: Response::HTTP_CREATED, + description: "Created", + content: new OA\JsonContent(ref: "#/components/schemas/Company") + ), + new OA\Response(response: Response::HTTP_BAD_REQUEST, description: "Bad Request"), + new OA\Response(response: Response::HTTP_UNAUTHORIZED, description: "Unauthorized"), + new OA\Response(response: Response::HTTP_FORBIDDEN, description: "Forbidden"), + new OA\Response(response: Response::HTTP_PRECONDITION_FAILED, description: "Validation Error"), + ] +)] +#[OA\Put( + path: "/api/v1/companies/{id}", + summary: "Update a company", + description: "Updates an existing company", + security: [["oauth2_security_scope" => ["openid", "profile", "email"]]], + tags: ["Companies"], + parameters: [ + new OA\Parameter( + name: "id", + in: "path", + required: true, + description: "Company ID", + schema: new OA\Schema(type: "integer") + ), + ], + requestBody: new OA\RequestBody( + required: true, + content: new OA\JsonContent(ref: "#/components/schemas/CompanyUpdateRequest") + ), + responses: [ + new OA\Response( + response: Response::HTTP_OK, + description: "Success", + content: new OA\JsonContent(ref: "#/components/schemas/Company") + ), + new OA\Response(response: Response::HTTP_BAD_REQUEST, description: "Bad Request"), + new OA\Response(response: Response::HTTP_UNAUTHORIZED, description: "Unauthorized"), + new OA\Response(response: Response::HTTP_FORBIDDEN, description: "Forbidden"), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Company not found"), + new OA\Response(response: Response::HTTP_PRECONDITION_FAILED, description: "Validation Error"), + ] +)] +#[OA\Delete( + path: "/api/v1/companies/{id}", + summary: "Delete a company", + description: "Deletes a company", + security: [["oauth2_security_scope" => ["openid", "profile", "email"]]], + tags: ["Companies"], + parameters: [ + new OA\Parameter( + name: "id", + in: "path", + required: true, + description: "Company ID", + schema: new OA\Schema(type: "integer") + ), + ], + responses: [ + new OA\Response(response: Response::HTTP_NO_CONTENT, description: "Deleted successfully"), + new OA\Response(response: Response::HTTP_UNAUTHORIZED, description: "Unauthorized"), + new OA\Response(response: Response::HTTP_FORBIDDEN, description: "Forbidden"), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Company not found"), + ] +)] final class OAuth2CompaniesApiController extends OAuth2ProtectedController { @@ -739,4 +852,4 @@ public function deleteCompanyBigLogo($company_id) return $this->deleted(); }); } -} \ No newline at end of file +} From 61a1e1cec23ab5eba8d32bf20240f68adb0c589c Mon Sep 17 00:00:00 2001 From: Matias Perrone Date: Tue, 14 Oct 2025 14:55:03 -0300 Subject: [PATCH 2/6] fix: Change "namespace" word positioning --- .../Apis/Protected/Main/OAuth2CompaniesApiController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/Apis/Protected/Main/OAuth2CompaniesApiController.php b/app/Http/Controllers/Apis/Protected/Main/OAuth2CompaniesApiController.php index b963ceac1..981fcbdb4 100644 --- a/app/Http/Controllers/Apis/Protected/Main/OAuth2CompaniesApiController.php +++ b/app/Http/Controllers/Apis/Protected/Main/OAuth2CompaniesApiController.php @@ -852,4 +852,4 @@ public function deleteCompanyBigLogo($company_id) return $this->deleted(); }); } -} +} \ No newline at end of file From 981652c5b46b0e8c06770a017fe0757df0d96d8f Mon Sep 17 00:00:00 2001 From: Matias Perrone Date: Mon, 10 Nov 2025 22:41:54 +0000 Subject: [PATCH 3/6] fix: Add security schema --- .../Main/OAuth2CompaniesApiController.php | 161 +++++++++++++++++- 1 file changed, 156 insertions(+), 5 deletions(-) diff --git a/app/Http/Controllers/Apis/Protected/Main/OAuth2CompaniesApiController.php b/app/Http/Controllers/Apis/Protected/Main/OAuth2CompaniesApiController.php index 981fcbdb4..05a5131c9 100644 --- a/app/Http/Controllers/Apis/Protected/Main/OAuth2CompaniesApiController.php +++ b/app/Http/Controllers/Apis/Protected/Main/OAuth2CompaniesApiController.php @@ -29,6 +29,31 @@ use ModelSerializers\SerializerRegistry; use OpenApi\Attributes as OA; + +#[OA\SecurityScheme( + type: 'oauth2', + securityScheme: 'OAuth2CompaniesApiControllerAuthSchema', + flows: [ + new OA\Flow( + authorizationUrl: L5_SWAGGER_CONST_AUTH_URL, + tokenUrl: L5_SWAGGER_CONST_TOKEN_URL, + flow: 'authorizationCode', + scopes: [ + CompanyScopes::Read => 'Read Data', + CompanyScopes::Write => 'Write Data', + SummitScopes::ReadSummitData => 'Read Summit Data', + SummitScopes::ReadAllSummitData => 'Read All Summit Data', + SummitScopes::WriteSummitData => 'Write Summit Data', + ], + ), + ], +) +] +class OAuth2CompaniesApiControllerAuthSchema +{ +} + + /** * Class OAuth2CompaniesApiController * @package App\Http\Controllers @@ -37,6 +62,54 @@ path: "/api/v1/companies/{id}", summary: "Get a specific company", description: "Returns detailed information about a specific company", + security: [ + [ + "OAuth2CompaniesApiControllerAuthSchema" => [ + CompanyScopes::Read, + ] + ] + ], + tags: ["Companies"], + parameters: [ + new OA\Parameter( + name: "id", + in: "path", + required: true, + description: "Company ID", + schema: new OA\Schema(type: "integer") + ), + new OA\Parameter( + name: "expand", + in: "query", + required: false, + description: "Expand related entities. Available expansions: sponsorships, project_sponsorships", + schema: new OA\Schema(type: "string") + ), + new OA\Parameter( + name: "relations", + in: "query", + required: false, + description: "Load relations. Available: sponsorships, project_sponsorships", + schema: new OA\Schema(type: "string") + ), + ], + responses: [ + new OA\Response( + response: Response::HTTP_OK, + description: "Success", + content: new OA\JsonContent(ref: "#/components/schemas/Company") + ), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Company not found"), + ] +)] +/** + * Class OAuth2CompaniesApiController + * @package App\Http\Controllers + */ +#[OA\Get( + path: "/api/public/v1/companies/{id}", + summary: "Get a specific company (Public)", + description: "Returns detailed information about a specific company", tags: ["Companies"], parameters: [ new OA\Parameter( @@ -74,7 +147,13 @@ path: "/api/v1/companies", summary: "Create a new company", description: "Creates a new company", - security: [["oauth2_security_scope" => ["openid", "profile", "email"]]], + security: [ + [ + "OAuth2CompaniesApiControllerAuthSchema" => [ + CompanyScopes::Write, + ] + ] + ], tags: ["Companies"], requestBody: new OA\RequestBody( required: true, @@ -96,7 +175,13 @@ path: "/api/v1/companies/{id}", summary: "Update a company", description: "Updates an existing company", - security: [["oauth2_security_scope" => ["openid", "profile", "email"]]], + security: [ + [ + "OAuth2CompaniesApiControllerAuthSchema" => [ + CompanyScopes::Write, + ] + ] + ], tags: ["Companies"], parameters: [ new OA\Parameter( @@ -128,7 +213,13 @@ path: "/api/v1/companies/{id}", summary: "Delete a company", description: "Deletes a company", - security: [["oauth2_security_scope" => ["openid", "profile", "email"]]], + security: [ + [ + "OAuth2CompaniesApiControllerAuthSchema" => [ + CompanyScopes::Write, + ] + ] + ], tags: ["Companies"], parameters: [ new OA\Parameter( @@ -390,7 +481,7 @@ public function __construct description: "Returns a paginated list of companies. Allows ordering, filtering and pagination.", security: [ [ - "companies_oauth2" => [ + "OAuth2CompaniesApiControllerAuthSchema" => [ CompanyScopes::Read, SummitScopes::ReadSummitData, SummitScopes::ReadAllSummitData, @@ -453,6 +544,66 @@ public function __construct ] )] + #[OA\Get( + path: "/api/public/v1/companies", + summary: "Get all companies (Public)", + description: "Returns a paginated list of companies. Allows ordering, filtering and pagination.", + tags: ["Companies"], + parameters: [ + new OA\Parameter( + name: 'page', + in: 'query', + required: false, + schema: new OA\Schema(type: 'integer'), + description: 'The page number' + ), + new OA\Parameter( + name: 'per_page', + in: 'query', + required: false, + schema: new OA\Schema(type: 'integer'), + description: 'The number of pages in each page', + ), + new OA\Parameter( + name: "filter[]", + in: "query", + required: false, + description: "Filter companies. Available filters: name (=@, ==, @@), member_level (=@, ==, @@), display_on_site (==)", + schema: new OA\Schema(type: "array", items: new OA\Items(type: "string")), + explode: true + ), + new OA\Parameter( + name: "order", + in: "query", + required: false, + description: "Order by field. Valid fields: id, name, member_level", + schema: new OA\Schema(type: "string") + ), + new OA\Parameter( + name: "expand", + in: "query", + required: false, + description: "Expand related entities. Available expansions: sponsorships, project_sponsorships", + schema: new OA\Schema(type: "string") + ), + new OA\Parameter( + name: "relations", + in: "query", + required: false, + description: "Load relations. Available: sponsorships, project_sponsorships", + schema: new OA\Schema(type: "string") + ), + ], + responses: [ + new OA\Response( + response: Response::HTTP_OK, + description: "Success", + content: new OA\JsonContent(ref: "#/components/schemas/PaginatedCompaniesResponse") + ), + new OA\Response(response: Response::HTTP_BAD_REQUEST, description: "Bad Request"), + ] + )] + #[OA\Get( path: "/api/public/v1/companies", operationId: "getAllCompaniesPublic", @@ -852,4 +1003,4 @@ public function deleteCompanyBigLogo($company_id) return $this->deleted(); }); } -} \ No newline at end of file +} From 2e0d3ba3781c81e42b19a2b3ad9e0e3a0f52ce0c Mon Sep 17 00:00:00 2001 From: Matias Perrone Date: Thu, 13 Nov 2025 21:51:30 +0000 Subject: [PATCH 4/6] chore: Move the security schema for the controller to its own file --- .../Main/OAuth2CompaniesApiController.php | 443 ++++++++++-------- 1 file changed, 237 insertions(+), 206 deletions(-) diff --git a/app/Http/Controllers/Apis/Protected/Main/OAuth2CompaniesApiController.php b/app/Http/Controllers/Apis/Protected/Main/OAuth2CompaniesApiController.php index 05a5131c9..3e357ffa3 100644 --- a/app/Http/Controllers/Apis/Protected/Main/OAuth2CompaniesApiController.php +++ b/app/Http/Controllers/Apis/Protected/Main/OAuth2CompaniesApiController.php @@ -29,214 +29,10 @@ use ModelSerializers\SerializerRegistry; use OpenApi\Attributes as OA; - -#[OA\SecurityScheme( - type: 'oauth2', - securityScheme: 'OAuth2CompaniesApiControllerAuthSchema', - flows: [ - new OA\Flow( - authorizationUrl: L5_SWAGGER_CONST_AUTH_URL, - tokenUrl: L5_SWAGGER_CONST_TOKEN_URL, - flow: 'authorizationCode', - scopes: [ - CompanyScopes::Read => 'Read Data', - CompanyScopes::Write => 'Write Data', - SummitScopes::ReadSummitData => 'Read Summit Data', - SummitScopes::ReadAllSummitData => 'Read All Summit Data', - SummitScopes::WriteSummitData => 'Write Summit Data', - ], - ), - ], -) -] -class OAuth2CompaniesApiControllerAuthSchema -{ -} - - -/** - * Class OAuth2CompaniesApiController - * @package App\Http\Controllers - */ -#[OA\Get( - path: "/api/v1/companies/{id}", - summary: "Get a specific company", - description: "Returns detailed information about a specific company", - security: [ - [ - "OAuth2CompaniesApiControllerAuthSchema" => [ - CompanyScopes::Read, - ] - ] - ], - tags: ["Companies"], - parameters: [ - new OA\Parameter( - name: "id", - in: "path", - required: true, - description: "Company ID", - schema: new OA\Schema(type: "integer") - ), - new OA\Parameter( - name: "expand", - in: "query", - required: false, - description: "Expand related entities. Available expansions: sponsorships, project_sponsorships", - schema: new OA\Schema(type: "string") - ), - new OA\Parameter( - name: "relations", - in: "query", - required: false, - description: "Load relations. Available: sponsorships, project_sponsorships", - schema: new OA\Schema(type: "string") - ), - ], - responses: [ - new OA\Response( - response: Response::HTTP_OK, - description: "Success", - content: new OA\JsonContent(ref: "#/components/schemas/Company") - ), - new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Company not found"), - ] -)] /** * Class OAuth2CompaniesApiController * @package App\Http\Controllers */ -#[OA\Get( - path: "/api/public/v1/companies/{id}", - summary: "Get a specific company (Public)", - description: "Returns detailed information about a specific company", - tags: ["Companies"], - parameters: [ - new OA\Parameter( - name: "id", - in: "path", - required: true, - description: "Company ID", - schema: new OA\Schema(type: "integer") - ), - new OA\Parameter( - name: "expand", - in: "query", - required: false, - description: "Expand related entities. Available expansions: sponsorships, project_sponsorships", - schema: new OA\Schema(type: "string") - ), - new OA\Parameter( - name: "relations", - in: "query", - required: false, - description: "Load relations. Available: sponsorships, project_sponsorships", - schema: new OA\Schema(type: "string") - ), - ], - responses: [ - new OA\Response( - response: Response::HTTP_OK, - description: "Success", - content: new OA\JsonContent(ref: "#/components/schemas/Company") - ), - new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Company not found"), - ] -)] -#[OA\Post( - path: "/api/v1/companies", - summary: "Create a new company", - description: "Creates a new company", - security: [ - [ - "OAuth2CompaniesApiControllerAuthSchema" => [ - CompanyScopes::Write, - ] - ] - ], - tags: ["Companies"], - requestBody: new OA\RequestBody( - required: true, - content: new OA\JsonContent(ref: "#/components/schemas/CompanyCreateRequest") - ), - responses: [ - new OA\Response( - response: Response::HTTP_CREATED, - description: "Created", - content: new OA\JsonContent(ref: "#/components/schemas/Company") - ), - new OA\Response(response: Response::HTTP_BAD_REQUEST, description: "Bad Request"), - new OA\Response(response: Response::HTTP_UNAUTHORIZED, description: "Unauthorized"), - new OA\Response(response: Response::HTTP_FORBIDDEN, description: "Forbidden"), - new OA\Response(response: Response::HTTP_PRECONDITION_FAILED, description: "Validation Error"), - ] -)] -#[OA\Put( - path: "/api/v1/companies/{id}", - summary: "Update a company", - description: "Updates an existing company", - security: [ - [ - "OAuth2CompaniesApiControllerAuthSchema" => [ - CompanyScopes::Write, - ] - ] - ], - tags: ["Companies"], - parameters: [ - new OA\Parameter( - name: "id", - in: "path", - required: true, - description: "Company ID", - schema: new OA\Schema(type: "integer") - ), - ], - requestBody: new OA\RequestBody( - required: true, - content: new OA\JsonContent(ref: "#/components/schemas/CompanyUpdateRequest") - ), - responses: [ - new OA\Response( - response: Response::HTTP_OK, - description: "Success", - content: new OA\JsonContent(ref: "#/components/schemas/Company") - ), - new OA\Response(response: Response::HTTP_BAD_REQUEST, description: "Bad Request"), - new OA\Response(response: Response::HTTP_UNAUTHORIZED, description: "Unauthorized"), - new OA\Response(response: Response::HTTP_FORBIDDEN, description: "Forbidden"), - new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Company not found"), - new OA\Response(response: Response::HTTP_PRECONDITION_FAILED, description: "Validation Error"), - ] -)] -#[OA\Delete( - path: "/api/v1/companies/{id}", - summary: "Delete a company", - description: "Deletes a company", - security: [ - [ - "OAuth2CompaniesApiControllerAuthSchema" => [ - CompanyScopes::Write, - ] - ] - ], - tags: ["Companies"], - parameters: [ - new OA\Parameter( - name: "id", - in: "path", - required: true, - description: "Company ID", - schema: new OA\Schema(type: "integer") - ), - ], - responses: [ - new OA\Response(response: Response::HTTP_NO_CONTENT, description: "Deleted successfully"), - new OA\Response(response: Response::HTTP_UNAUTHORIZED, description: "Unauthorized"), - new OA\Response(response: Response::HTTP_FORBIDDEN, description: "Forbidden"), - new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Company not found"), - ] -)] final class OAuth2CompaniesApiController extends OAuth2ProtectedController { @@ -274,12 +70,11 @@ public function __construct #[OA\Get( path: "/api/v1/companies/{id}", - operationId: "getCompany", summary: "Get a specific company", description: "Returns detailed information about a specific company", security: [ [ - "companies_oauth2" => [ + "OAuth2CompaniesApiControllerAuthSchema" => [ CompanyScopes::Read, ] ] @@ -321,6 +116,155 @@ public function __construct * Class OAuth2CompaniesApiController * @package App\Http\Controllers */ + #[OA\Get( + path: "/api/public/v1/companies/{id}", + summary: "Get a specific company (Public)", + description: "Returns detailed information about a specific company", + tags: ["Companies"], + parameters: [ + new OA\Parameter( + name: "id", + in: "path", + required: true, + description: "Company ID", + schema: new OA\Schema(type: "integer") + ), + new OA\Parameter( + name: "expand", + in: "query", + required: false, + description: "Expand related entities. Available expansions: sponsorships, project_sponsorships", + schema: new OA\Schema(type: "string") + ), + new OA\Parameter( + name: "relations", + in: "query", + required: false, + description: "Load relations. Available: sponsorships, project_sponsorships", + schema: new OA\Schema(type: "string") + ), + ], + responses: [ + new OA\Response( + response: Response::HTTP_OK, + description: "Success", + content: new OA\JsonContent(ref: "#/components/schemas/Company") + ), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Company not found"), + ] + )] + #[OA\Post( + path: "/api/v1/companies", + summary: "Create a new company", + description: "Creates a new company", + security: [ + [ + "OAuth2CompaniesApiControllerAuthSchema" => [ + CompanyScopes::Write, + ] + ] + ], + x: [ + 'required-groups' => [ + IGroup::SuperAdmins, + IGroup::Administrators, + ] + ], + tags: ["Companies"], + requestBody: new OA\RequestBody( + required: true, + content: new OA\JsonContent(ref: "#/components/schemas/CompanyCreateRequest") + ), + responses: [ + new OA\Response( + response: Response::HTTP_CREATED, + description: "Created", + content: new OA\JsonContent(ref: "#/components/schemas/Company") + ), + new OA\Response(response: Response::HTTP_BAD_REQUEST, description: "Bad Request"), + new OA\Response(response: Response::HTTP_UNAUTHORIZED, description: "Unauthorized"), + new OA\Response(response: Response::HTTP_FORBIDDEN, description: "Forbidden"), + new OA\Response(response: Response::HTTP_PRECONDITION_FAILED, description: "Validation Error"), + ] + )] + #[OA\Put( + path: "/api/v1/companies/{id}", + summary: "Update a company", + description: "Updates an existing company", + security: [ + [ + "OAuth2CompaniesApiControllerAuthSchema" => [ + CompanyScopes::Write, + ] + ] + ], + x: [ + 'required-groups' => [ + IGroup::SuperAdmins, + IGroup::Administrators, + ] + ], + tags: ["Companies"], + parameters: [ + new OA\Parameter( + name: "id", + in: "path", + required: true, + description: "Company ID", + schema: new OA\Schema(type: "integer") + ), + ], + requestBody: new OA\RequestBody( + required: true, + content: new OA\JsonContent(ref: "#/components/schemas/CompanyUpdateRequest") + ), + responses: [ + new OA\Response( + response: Response::HTTP_OK, + description: "Success", + content: new OA\JsonContent(ref: "#/components/schemas/Company") + ), + new OA\Response(response: Response::HTTP_BAD_REQUEST, description: "Bad Request"), + new OA\Response(response: Response::HTTP_UNAUTHORIZED, description: "Unauthorized"), + new OA\Response(response: Response::HTTP_FORBIDDEN, description: "Forbidden"), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Company not found"), + new OA\Response(response: Response::HTTP_PRECONDITION_FAILED, description: "Validation Error"), + ] + )] + #[OA\Delete( + path: "/api/v1/companies/{id}", + summary: "Delete a company", + description: "Deletes a company", + security: [ + [ + "OAuth2CompaniesApiControllerAuthSchema" => [ + CompanyScopes::Write, + ] + ] + ], + x: [ + 'required-groups' => [ + IGroup::SuperAdmins, + IGroup::Administrators, + ] + ], + tags: ["Companies"], + parameters: [ + new OA\Parameter( + name: "id", + in: "path", + required: true, + description: "Company ID", + schema: new OA\Schema(type: "integer") + ), + ], + responses: [ + new OA\Response(response: Response::HTTP_NO_CONTENT, description: "Deleted successfully"), + new OA\Response(response: Response::HTTP_UNAUTHORIZED, description: "Unauthorized"), + new OA\Response(response: Response::HTTP_FORBIDDEN, description: "Forbidden"), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Company not found"), + ] + )] #[OA\Get( path: "/api/public/v1/companies/{id}", operationId: "getCompanyPublic", @@ -475,6 +419,93 @@ public function __construct ] )] #[OA\Get( + path: "/api/v1/companies/{id}", + operationId: "getCompany", + summary: "Get a specific company", + description: "Returns detailed information about a specific company", + security: [ + [ + "companies_oauth2" => [ + CompanyScopes::Read, + ] + ] + ], + tags: ["Companies"], + parameters: [ + new OA\Parameter( + name: "id", + in: "path", + required: true, + description: "Company ID", + schema: new OA\Schema(type: "integer") + ), + new OA\Parameter( + name: "expand", + in: "query", + required: false, + description: "Expand related entities. Available expansions: sponsorships, project_sponsorships", + schema: new OA\Schema(type: "string") + ), + new OA\Parameter( + name: "relations", + in: "query", + required: false, + description: "Load relations. Available: sponsorships, project_sponsorships", + schema: new OA\Schema(type: "string") + ), + ], + responses: [ + new OA\Response( + response: Response::HTTP_OK, + description: "Success", + content: new OA\JsonContent(ref: "#/components/schemas/Company") + ), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Company not found"), + ] + )] + /** + * Class OAuth2CompaniesApiController + * @package App\Http\Controllers + */ + #[OA\Get( + path: "/api/public/v1/companies/{id}", + operationId: "getCompanyPublic", + summary: "Get a specific company (Public)", + description: "Returns detailed information about a specific company", + tags: ["Companies (Public)"], + parameters: [ + new OA\Parameter( + name: "id", + in: "path", + required: true, + description: "Company ID", + schema: new OA\Schema(type: "integer") + ), + new OA\Parameter( + name: "expand", + in: "query", + required: false, + description: "Expand related entities. Available expansions: sponsorships, project_sponsorships", + schema: new OA\Schema(type: "string") + ), + new OA\Parameter( + name: "relations", + in: "query", + required: false, + description: "Load relations. Available: sponsorships, project_sponsorships", + schema: new OA\Schema(type: "string") + ), + ], + responses: [ + new OA\Response( + response: Response::HTTP_OK, + description: "Success", + content: new OA\JsonContent(ref: "#/components/schemas/Company") + ), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Company not found"), + ] + )] + #[OA\Post( path: "/api/v1/companies", operationId: "getAllCompanies", summary: "Get all companies", From 9d605a941cc28ccd8848affc411f2f8fb9890221 Mon Sep 17 00:00:00 2001 From: Matias Perrone Date: Wed, 3 Dec 2025 18:19:02 +0000 Subject: [PATCH 5/6] chore: add operationId and fix schema name --- .../Main/OAuth2CompaniesApiController.php | 81 +++++++++++++++++-- 1 file changed, 74 insertions(+), 7 deletions(-) diff --git a/app/Http/Controllers/Apis/Protected/Main/OAuth2CompaniesApiController.php b/app/Http/Controllers/Apis/Protected/Main/OAuth2CompaniesApiController.php index 3e357ffa3..79e6c467e 100644 --- a/app/Http/Controllers/Apis/Protected/Main/OAuth2CompaniesApiController.php +++ b/app/Http/Controllers/Apis/Protected/Main/OAuth2CompaniesApiController.php @@ -70,11 +70,12 @@ public function __construct #[OA\Get( path: "/api/v1/companies/{id}", + operationId: "getCompany", summary: "Get a specific company", description: "Returns detailed information about a specific company", security: [ [ - "OAuth2CompaniesApiControllerAuthSchema" => [ + "companies_oauth2" => [ CompanyScopes::Read, ] ] @@ -118,9 +119,10 @@ public function __construct */ #[OA\Get( path: "/api/public/v1/companies/{id}", + operationId: "getCompanyPublic", summary: "Get a specific company (Public)", description: "Returns detailed information about a specific company", - tags: ["Companies"], + tags: ["Companies (Public)"], parameters: [ new OA\Parameter( name: "id", @@ -155,11 +157,12 @@ public function __construct )] #[OA\Post( path: "/api/v1/companies", + operationId: "createCompany", summary: "Create a new company", description: "Creates a new company", security: [ [ - "OAuth2CompaniesApiControllerAuthSchema" => [ + "companies_oauth2" => [ CompanyScopes::Write, ] ] @@ -189,11 +192,12 @@ public function __construct )] #[OA\Put( path: "/api/v1/companies/{id}", + operationId: "updateCompany", summary: "Update a company", description: "Updates an existing company", security: [ [ - "OAuth2CompaniesApiControllerAuthSchema" => [ + "companies_oauth2" => [ CompanyScopes::Write, ] ] @@ -233,11 +237,12 @@ public function __construct )] #[OA\Delete( path: "/api/v1/companies/{id}", + operationId: "deleteCompany", summary: "Delete a company", description: "Deletes a company", security: [ [ - "OAuth2CompaniesApiControllerAuthSchema" => [ + "companies_oauth2" => [ CompanyScopes::Write, ] ] @@ -512,7 +517,7 @@ public function __construct description: "Returns a paginated list of companies. Allows ordering, filtering and pagination.", security: [ [ - "OAuth2CompaniesApiControllerAuthSchema" => [ + "companies_oauth2" => [ CompanyScopes::Read, SummitScopes::ReadSummitData, SummitScopes::ReadAllSummitData, @@ -577,9 +582,71 @@ public function __construct #[OA\Get( path: "/api/public/v1/companies", + operationId: "getAllCompaniesPublic", summary: "Get all companies (Public)", description: "Returns a paginated list of companies. Allows ordering, filtering and pagination.", - tags: ["Companies"], + tags: ["Companies (Public)"], + parameters: [ + new OA\Parameter( + name: 'page', + in: 'query', + required: false, + schema: new OA\Schema(type: 'integer'), + description: 'The page number' + ), + new OA\Parameter( + name: 'per_page', + in: 'query', + required: false, + schema: new OA\Schema(type: 'integer'), + description: 'The number of pages in each page', + ), + new OA\Parameter( + name: "filter[]", + in: "query", + required: false, + description: "Filter companies. Available filters: name (=@, ==, @@), member_level (=@, ==, @@), display_on_site (==)", + schema: new OA\Schema(type: "array", items: new OA\Items(type: "string")), + explode: true + ), + new OA\Parameter( + name: "order", + in: "query", + required: false, + description: "Order by field. Valid fields: id, name, member_level", + schema: new OA\Schema(type: "string") + ), + new OA\Parameter( + name: "expand", + in: "query", + required: false, + description: "Expand related entities. Available expansions: sponsorships, project_sponsorships", + schema: new OA\Schema(type: "string") + ), + new OA\Parameter( + name: "relations", + in: "query", + required: false, + description: "Load relations. Available: sponsorships, project_sponsorships", + schema: new OA\Schema(type: "string") + ), + ], + responses: [ + new OA\Response( + response: Response::HTTP_OK, + description: "Success", + content: new OA\JsonContent(ref: "#/components/schemas/PaginatedCompaniesResponse") + ), + new OA\Response(response: Response::HTTP_BAD_REQUEST, description: "Bad Request"), + ] + )] + + #[OA\Get( + path: "/api/public/v1/companies", + operationId: "getAllCompaniesPublic", + summary: "Get all companies (Public)", + description: "Returns a paginated list of companies. Allows ordering, filtering and pagination.", + tags: ["Companies (Public)"], parameters: [ new OA\Parameter( name: 'page', From 62ffc89b0c18b85b5d3316d3207a713867539467 Mon Sep 17 00:00:00 2001 From: Matias Perrone Date: Fri, 5 Dec 2025 14:54:07 +0000 Subject: [PATCH 6/6] fix: main rebase conflict --- .../Main/OAuth2CompaniesApiController.php | 539 +++--------------- 1 file changed, 86 insertions(+), 453 deletions(-) diff --git a/app/Http/Controllers/Apis/Protected/Main/OAuth2CompaniesApiController.php b/app/Http/Controllers/Apis/Protected/Main/OAuth2CompaniesApiController.php index 79e6c467e..1a2ab7758 100644 --- a/app/Http/Controllers/Apis/Protected/Main/OAuth2CompaniesApiController.php +++ b/app/Http/Controllers/Apis/Protected/Main/OAuth2CompaniesApiController.php @@ -69,25 +69,49 @@ public function __construct } #[OA\Get( - path: "/api/v1/companies/{id}", - operationId: "getCompany", - summary: "Get a specific company", - description: "Returns detailed information about a specific company", + path: "/api/v1/companies", + operationId: "getAllCompanies", + summary: "Get all companies", + description: "Returns a paginated list of companies. Allows ordering, filtering and pagination.", security: [ [ "companies_oauth2" => [ CompanyScopes::Read, + SummitScopes::ReadSummitData, + SummitScopes::ReadAllSummitData, ] ] ], tags: ["Companies"], parameters: [ new OA\Parameter( - name: "id", - in: "path", - required: true, - description: "Company ID", - schema: new OA\Schema(type: "integer") + name: 'page', + in: 'query', + required: false, + schema: new OA\Schema(type: 'integer'), + description: 'The page number' + ), + new OA\Parameter( + name: 'per_page', + in: 'query', + required: false, + schema: new OA\Schema(type: 'integer'), + description: 'The number of items per page', + ), + new OA\Parameter( + name: "filter[]", + in: "query", + required: false, + description: "Filter companies. Available filters: name (=@, ==, @@), member_level (=@, ==, @@), display_on_site (==)", + schema: new OA\Schema(type: "array", items: new OA\Items(type: "string")), + explode: true + ), + new OA\Parameter( + name: "order", + in: "query", + required: false, + description: "Order by field. Valid fields: id, name, member_level", + schema: new OA\Schema(type: "string") ), new OA\Parameter( name: "expand", @@ -108,28 +132,46 @@ public function __construct new OA\Response( response: Response::HTTP_OK, description: "Success", - content: new OA\JsonContent(ref: "#/components/schemas/Company") + content: new OA\JsonContent(ref: "#/components/schemas/PaginatedCompaniesResponse") ), - new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Company not found"), + new OA\Response(response: Response::HTTP_BAD_REQUEST, description: "Bad Request"), ] )] - /** - * Class OAuth2CompaniesApiController - * @package App\Http\Controllers - */ #[OA\Get( - path: "/api/public/v1/companies/{id}", - operationId: "getCompanyPublic", - summary: "Get a specific company (Public)", - description: "Returns detailed information about a specific company", + path: "/api/public/v1/companies", + operationId: "getAllCompaniesPublic", + summary: "Get all companies (Public)", + description: "Returns a paginated list of companies. Allows ordering, filtering and pagination.", tags: ["Companies (Public)"], parameters: [ new OA\Parameter( - name: "id", - in: "path", - required: true, - description: "Company ID", - schema: new OA\Schema(type: "integer") + name: 'page', + in: 'query', + required: false, + schema: new OA\Schema(type: 'integer'), + description: 'The page number' + ), + new OA\Parameter( + name: 'per_page', + in: 'query', + required: false, + schema: new OA\Schema(type: 'integer'), + description: 'The number of items per page', + ), + new OA\Parameter( + name: "filter[]", + in: "query", + required: false, + description: "Filter companies. Available filters: name (=@, ==, @@), member_level (=@, ==, @@), display_on_site (==)", + schema: new OA\Schema(type: "array", items: new OA\Items(type: "string")), + explode: true + ), + new OA\Parameter( + name: "order", + in: "query", + required: false, + description: "Order by field. Valid fields: id, name, member_level", + schema: new OA\Schema(type: "string") ), new OA\Parameter( name: "expand", @@ -150,64 +192,23 @@ public function __construct new OA\Response( response: Response::HTTP_OK, description: "Success", - content: new OA\JsonContent(ref: "#/components/schemas/Company") - ), - new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Company not found"), - ] - )] - #[OA\Post( - path: "/api/v1/companies", - operationId: "createCompany", - summary: "Create a new company", - description: "Creates a new company", - security: [ - [ - "companies_oauth2" => [ - CompanyScopes::Write, - ] - ] - ], - x: [ - 'required-groups' => [ - IGroup::SuperAdmins, - IGroup::Administrators, - ] - ], - tags: ["Companies"], - requestBody: new OA\RequestBody( - required: true, - content: new OA\JsonContent(ref: "#/components/schemas/CompanyCreateRequest") - ), - responses: [ - new OA\Response( - response: Response::HTTP_CREATED, - description: "Created", - content: new OA\JsonContent(ref: "#/components/schemas/Company") + content: new OA\JsonContent(ref: "#/components/schemas/PaginatedCompaniesResponse") ), new OA\Response(response: Response::HTTP_BAD_REQUEST, description: "Bad Request"), - new OA\Response(response: Response::HTTP_UNAUTHORIZED, description: "Unauthorized"), - new OA\Response(response: Response::HTTP_FORBIDDEN, description: "Forbidden"), - new OA\Response(response: Response::HTTP_PRECONDITION_FAILED, description: "Validation Error"), ] )] - #[OA\Put( + #[OA\Get( path: "/api/v1/companies/{id}", - operationId: "updateCompany", - summary: "Update a company", - description: "Updates an existing company", + operationId: "getCompany", + summary: "Get a specific company", + description: "Returns detailed information about a specific company", security: [ [ "companies_oauth2" => [ - CompanyScopes::Write, + CompanyScopes::Read, ] ] ], - x: [ - 'required-groups' => [ - IGroup::SuperAdmins, - IGroup::Administrators, - ] - ], tags: ["Companies"], parameters: [ new OA\Parameter( @@ -217,56 +218,27 @@ public function __construct description: "Company ID", schema: new OA\Schema(type: "integer") ), + new OA\Parameter( + name: "expand", + in: "query", + required: false, + description: "Expand related entities. Available expansions: sponsorships, project_sponsorships", + schema: new OA\Schema(type: "string") + ), + new OA\Parameter( + name: "relations", + in: "query", + required: false, + description: "Load relations. Available: sponsorships, project_sponsorships", + schema: new OA\Schema(type: "string") + ), ], - requestBody: new OA\RequestBody( - required: true, - content: new OA\JsonContent(ref: "#/components/schemas/CompanyUpdateRequest") - ), responses: [ new OA\Response( response: Response::HTTP_OK, description: "Success", content: new OA\JsonContent(ref: "#/components/schemas/Company") ), - new OA\Response(response: Response::HTTP_BAD_REQUEST, description: "Bad Request"), - new OA\Response(response: Response::HTTP_UNAUTHORIZED, description: "Unauthorized"), - new OA\Response(response: Response::HTTP_FORBIDDEN, description: "Forbidden"), - new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Company not found"), - new OA\Response(response: Response::HTTP_PRECONDITION_FAILED, description: "Validation Error"), - ] - )] - #[OA\Delete( - path: "/api/v1/companies/{id}", - operationId: "deleteCompany", - summary: "Delete a company", - description: "Deletes a company", - security: [ - [ - "companies_oauth2" => [ - CompanyScopes::Write, - ] - ] - ], - x: [ - 'required-groups' => [ - IGroup::SuperAdmins, - IGroup::Administrators, - ] - ], - tags: ["Companies"], - parameters: [ - new OA\Parameter( - name: "id", - in: "path", - required: true, - description: "Company ID", - schema: new OA\Schema(type: "integer") - ), - ], - responses: [ - new OA\Response(response: Response::HTTP_NO_CONTENT, description: "Deleted successfully"), - new OA\Response(response: Response::HTTP_UNAUTHORIZED, description: "Unauthorized"), - new OA\Response(response: Response::HTTP_FORBIDDEN, description: "Forbidden"), new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Company not found"), ] )] @@ -423,345 +395,6 @@ public function __construct new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Company not found"), ] )] - #[OA\Get( - path: "/api/v1/companies/{id}", - operationId: "getCompany", - summary: "Get a specific company", - description: "Returns detailed information about a specific company", - security: [ - [ - "companies_oauth2" => [ - CompanyScopes::Read, - ] - ] - ], - tags: ["Companies"], - parameters: [ - new OA\Parameter( - name: "id", - in: "path", - required: true, - description: "Company ID", - schema: new OA\Schema(type: "integer") - ), - new OA\Parameter( - name: "expand", - in: "query", - required: false, - description: "Expand related entities. Available expansions: sponsorships, project_sponsorships", - schema: new OA\Schema(type: "string") - ), - new OA\Parameter( - name: "relations", - in: "query", - required: false, - description: "Load relations. Available: sponsorships, project_sponsorships", - schema: new OA\Schema(type: "string") - ), - ], - responses: [ - new OA\Response( - response: Response::HTTP_OK, - description: "Success", - content: new OA\JsonContent(ref: "#/components/schemas/Company") - ), - new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Company not found"), - ] - )] - /** - * Class OAuth2CompaniesApiController - * @package App\Http\Controllers - */ - #[OA\Get( - path: "/api/public/v1/companies/{id}", - operationId: "getCompanyPublic", - summary: "Get a specific company (Public)", - description: "Returns detailed information about a specific company", - tags: ["Companies (Public)"], - parameters: [ - new OA\Parameter( - name: "id", - in: "path", - required: true, - description: "Company ID", - schema: new OA\Schema(type: "integer") - ), - new OA\Parameter( - name: "expand", - in: "query", - required: false, - description: "Expand related entities. Available expansions: sponsorships, project_sponsorships", - schema: new OA\Schema(type: "string") - ), - new OA\Parameter( - name: "relations", - in: "query", - required: false, - description: "Load relations. Available: sponsorships, project_sponsorships", - schema: new OA\Schema(type: "string") - ), - ], - responses: [ - new OA\Response( - response: Response::HTTP_OK, - description: "Success", - content: new OA\JsonContent(ref: "#/components/schemas/Company") - ), - new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Company not found"), - ] - )] - #[OA\Post( - path: "/api/v1/companies", - operationId: "getAllCompanies", - summary: "Get all companies", - description: "Returns a paginated list of companies. Allows ordering, filtering and pagination.", - security: [ - [ - "companies_oauth2" => [ - CompanyScopes::Read, - SummitScopes::ReadSummitData, - SummitScopes::ReadAllSummitData, - ] - ] - ], - tags: ["Companies"], - parameters: [ - new OA\Parameter( - name: 'page', - in: 'query', - required: false, - schema: new OA\Schema(type: 'integer'), - description: 'The page number' - ), - new OA\Parameter( - name: 'per_page', - in: 'query', - required: false, - schema: new OA\Schema(type: 'integer'), - description: 'The number of pages in each page', - ), - new OA\Parameter( - name: "filter[]", - in: "query", - required: false, - description: "Filter companies. Available filters: name (=@, ==, @@), member_level (=@, ==, @@), display_on_site (==)", - schema: new OA\Schema(type: "array", items: new OA\Items(type: "string")), - explode: true - ), - new OA\Parameter( - name: "order", - in: "query", - required: false, - description: "Order by field. Valid fields: id, name, member_level", - schema: new OA\Schema(type: "string") - ), - new OA\Parameter( - name: "expand", - in: "query", - required: false, - description: "Expand related entities. Available expansions: sponsorships, project_sponsorships", - schema: new OA\Schema(type: "string") - ), - new OA\Parameter( - name: "relations", - in: "query", - required: false, - description: "Load relations. Available: sponsorships, project_sponsorships", - schema: new OA\Schema(type: "string") - ), - ], - responses: [ - new OA\Response( - response: Response::HTTP_OK, - description: "Success", - content: new OA\JsonContent(ref: "#/components/schemas/PaginatedCompaniesResponse") - ), - new OA\Response(response: Response::HTTP_BAD_REQUEST, description: "Bad Request"), - ] - )] - - #[OA\Get( - path: "/api/public/v1/companies", - operationId: "getAllCompaniesPublic", - summary: "Get all companies (Public)", - description: "Returns a paginated list of companies. Allows ordering, filtering and pagination.", - tags: ["Companies (Public)"], - parameters: [ - new OA\Parameter( - name: 'page', - in: 'query', - required: false, - schema: new OA\Schema(type: 'integer'), - description: 'The page number' - ), - new OA\Parameter( - name: 'per_page', - in: 'query', - required: false, - schema: new OA\Schema(type: 'integer'), - description: 'The number of pages in each page', - ), - new OA\Parameter( - name: "filter[]", - in: "query", - required: false, - description: "Filter companies. Available filters: name (=@, ==, @@), member_level (=@, ==, @@), display_on_site (==)", - schema: new OA\Schema(type: "array", items: new OA\Items(type: "string")), - explode: true - ), - new OA\Parameter( - name: "order", - in: "query", - required: false, - description: "Order by field. Valid fields: id, name, member_level", - schema: new OA\Schema(type: "string") - ), - new OA\Parameter( - name: "expand", - in: "query", - required: false, - description: "Expand related entities. Available expansions: sponsorships, project_sponsorships", - schema: new OA\Schema(type: "string") - ), - new OA\Parameter( - name: "relations", - in: "query", - required: false, - description: "Load relations. Available: sponsorships, project_sponsorships", - schema: new OA\Schema(type: "string") - ), - ], - responses: [ - new OA\Response( - response: Response::HTTP_OK, - description: "Success", - content: new OA\JsonContent(ref: "#/components/schemas/PaginatedCompaniesResponse") - ), - new OA\Response(response: Response::HTTP_BAD_REQUEST, description: "Bad Request"), - ] - )] - - #[OA\Get( - path: "/api/public/v1/companies", - operationId: "getAllCompaniesPublic", - summary: "Get all companies (Public)", - description: "Returns a paginated list of companies. Allows ordering, filtering and pagination.", - tags: ["Companies (Public)"], - parameters: [ - new OA\Parameter( - name: 'page', - in: 'query', - required: false, - schema: new OA\Schema(type: 'integer'), - description: 'The page number' - ), - new OA\Parameter( - name: 'per_page', - in: 'query', - required: false, - schema: new OA\Schema(type: 'integer'), - description: 'The number of pages in each page', - ), - new OA\Parameter( - name: "filter[]", - in: "query", - required: false, - description: "Filter companies. Available filters: name (=@, ==, @@), member_level (=@, ==, @@), display_on_site (==)", - schema: new OA\Schema(type: "array", items: new OA\Items(type: "string")), - explode: true - ), - new OA\Parameter( - name: "order", - in: "query", - required: false, - description: "Order by field. Valid fields: id, name, member_level", - schema: new OA\Schema(type: "string") - ), - new OA\Parameter( - name: "expand", - in: "query", - required: false, - description: "Expand related entities. Available expansions: sponsorships, project_sponsorships", - schema: new OA\Schema(type: "string") - ), - new OA\Parameter( - name: "relations", - in: "query", - required: false, - description: "Load relations. Available: sponsorships, project_sponsorships", - schema: new OA\Schema(type: "string") - ), - ], - responses: [ - new OA\Response( - response: Response::HTTP_OK, - description: "Success", - content: new OA\JsonContent(ref: "#/components/schemas/PaginatedCompaniesResponse") - ), - new OA\Response(response: Response::HTTP_BAD_REQUEST, description: "Bad Request"), - ] - )] - - #[OA\Get( - path: "/api/public/v1/companies", - operationId: "getAllCompaniesPublic", - summary: "Get all companies (Public)", - description: "Returns a paginated list of companies. Allows ordering, filtering and pagination.", - tags: ["Companies (Public)"], - parameters: [ - new OA\Parameter( - name: 'page', - in: 'query', - required: false, - schema: new OA\Schema(type: 'integer'), - description: 'The page number' - ), - new OA\Parameter( - name: 'per_page', - in: 'query', - required: false, - schema: new OA\Schema(type: 'integer'), - description: 'The number of pages in each page', - ), - new OA\Parameter( - name: "filter[]", - in: "query", - required: false, - description: "Filter companies. Available filters: name (=@, ==, @@), member_level (=@, ==, @@), display_on_site (==)", - schema: new OA\Schema(type: "array", items: new OA\Items(type: "string")), - explode: true - ), - new OA\Parameter( - name: "order", - in: "query", - required: false, - description: "Order by field. Valid fields: id, name, member_level", - schema: new OA\Schema(type: "string") - ), - new OA\Parameter( - name: "expand", - in: "query", - required: false, - description: "Expand related entities. Available expansions: sponsorships, project_sponsorships", - schema: new OA\Schema(type: "string") - ), - new OA\Parameter( - name: "relations", - in: "query", - required: false, - description: "Load relations. Available: sponsorships, project_sponsorships", - schema: new OA\Schema(type: "string") - ), - ], - responses: [ - new OA\Response( - response: Response::HTTP_OK, - description: "Success", - content: new OA\JsonContent(ref: "#/components/schemas/PaginatedCompaniesResponse") - ), - new OA\Response(response: Response::HTTP_BAD_REQUEST, description: "Bad Request"), - ] - )] public function getAllCompanies() {