From 751c635681cb43ce097d8b6b84a44d3243a97932 Mon Sep 17 00:00:00 2001 From: Matias Perrone Date: Tue, 14 Oct 2025 10:42:36 -0300 Subject: [PATCH 1/9] feat: Extend Swagger Coverage for controller `OAuth2SummitScheduleSettingsApiController` --- ...th2SummitScheduleSettingsApiController.php | 144 +++++------------- app/Swagger/SummitSchemas.php | 24 +-- 2 files changed, 44 insertions(+), 124 deletions(-) diff --git a/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitScheduleSettingsApiController.php b/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitScheduleSettingsApiController.php index 355fc8d41..69d292ebc 100644 --- a/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitScheduleSettingsApiController.php +++ b/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitScheduleSettingsApiController.php @@ -201,17 +201,7 @@ public function getChildSerializer():string{ summary: "Get all schedule settings", operationId: "getAllSummitScheduleSettings", tags: ['Summit Schedule Settings'], - security: [['summit_schedule_settings_oauth2' => [ - SummitScopes::ReadSummitData, - SummitScopes::ReadAllSummitData, - ]]], - x: [ - 'required-groups' => [ - IGroup::SuperAdmins, - IGroup::Administrators, - IGroup::SummitAdministrators, - ] - ], + security: [['summit_oauth2' => []]], parameters: [ new OA\Parameter( name: 'id', @@ -271,11 +261,15 @@ public function getChildSerializer():string{ ), 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: "Not Found"), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "not found"), 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 getAllBySummit($summit_id) + { + return $this->traitGetAllBySummit($summit_id); + } #[OA\Get( path: "/api/v1/summits/{id}/schedule-settings/{config_id}", @@ -283,17 +277,7 @@ public function getChildSerializer():string{ summary: "Get schedule setting", operationId: "getSummitScheduleSetting", tags: ['Summit Schedule Settings'], - security: [['summit_schedule_settings_oauth2' => [ - SummitScopes::ReadSummitData, - SummitScopes::ReadAllSummitData, - ]]], - x: [ - 'required-groups' => [ - IGroup::SuperAdmins, - IGroup::Administrators, - IGroup::SummitAdministrators, - ] - ], + security: [['summit_oauth2' => []]], parameters: [ new OA\Parameter( name: 'id', @@ -332,10 +316,14 @@ public function getChildSerializer():string{ ), 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: "Not Found"), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "not found"), new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error") ] )] + public function get($summit_id, $config_id) + { + return $this->traitGet($summit_id, $config_id); + } #[OA\Post( path: "/api/v1/summits/{id}/schedule-settings", @@ -343,16 +331,7 @@ public function getChildSerializer():string{ summary: "Create schedule setting", operationId: "createSummitScheduleSetting", tags: ['Summit Schedule Settings'], - security: [['summit_schedule_settings_oauth2' => [ - SummitScopes::WriteSummitData, - ]]], - x: [ - 'required-groups' => [ - IGroup::SuperAdmins, - IGroup::Administrators, - IGroup::SummitAdministrators, - ] - ], + security: [['summit_oauth2' => []]], parameters: [ new OA\Parameter( name: 'id', @@ -375,11 +354,15 @@ public function getChildSerializer():string{ 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: "Not Found"), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "not found"), 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 add($summit_id) + { + return $this->traitAdd($summit_id); + } #[OA\Put( path: "/api/v1/summits/{id}/schedule-settings/{config_id}", @@ -387,16 +370,7 @@ public function getChildSerializer():string{ summary: "Update schedule setting", operationId: "updateSummitScheduleSetting", tags: ['Summit Schedule Settings'], - security: [['summit_schedule_settings_oauth2' => [ - SummitScopes::WriteSummitData, - ]]], - x: [ - 'required-groups' => [ - IGroup::SuperAdmins, - IGroup::Administrators, - IGroup::SummitAdministrators, - ] - ], + security: [['summit_oauth2' => []]], parameters: [ new OA\Parameter( name: 'id', @@ -426,11 +400,15 @@ public function getChildSerializer():string{ 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: "Not Found"), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "not found"), 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 update($summit_id, $config_id) + { + return $this->traitUpdate($summit_id, $config_id); + } #[OA\Delete( path: "/api/v1/summits/{id}/schedule-settings/{config_id}", @@ -438,16 +416,7 @@ public function getChildSerializer():string{ summary: "Delete schedule setting", operationId: "deleteSummitScheduleSetting", tags: ['Summit Schedule Settings'], - security: [['summit_schedule_settings_oauth2' => [ - SummitScopes::WriteSummitData, - ]]], - x: [ - 'required-groups' => [ - IGroup::SuperAdmins, - IGroup::Administrators, - IGroup::SummitAdministrators, - ] - ], + security: [['summit_oauth2' => []]], parameters: [ new OA\Parameter( name: 'id', @@ -465,13 +434,17 @@ public function getChildSerializer():string{ ) ], responses: [ - new OA\Response(response: Response::HTTP_NO_CONTENT, description: 'No Content'), + new OA\Response(response: 204, description: 'No Content'), 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: "Not Found"), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "not found"), new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error") ] )] + public function delete($summit_id, $config_id) + { + return $this->traitDelete($summit_id, $config_id); + } #[OA\Get( path: "/api/v1/summits/{id}/schedule-settings/metadata", @@ -479,17 +452,7 @@ public function getChildSerializer():string{ summary: "Get schedule settings metadata", operationId: "getSummitScheduleSettingsMetadata", tags: ['Summit Schedule Settings'], - security: [['summit_schedule_settings_oauth2' => [ - SummitScopes::ReadSummitData, - SummitScopes::ReadAllSummitData, - ]]], - x: [ - 'required-groups' => [ - IGroup::SuperAdmins, - IGroup::Administrators, - IGroup::SummitAdministrators, - ] - ], + security: [['summit_oauth2' => []]], parameters: [ new OA\Parameter( name: 'id', @@ -500,9 +463,11 @@ public function getChildSerializer():string{ ) ], responses: [ - new OA\Response(response: 200, description: 'Success with an empty response body'), + new OA\Response(response: 200, description: 'Success'), 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: "not found"), + new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error") ] )] public function getMetadata($summit_id){ @@ -515,16 +480,7 @@ public function getMetadata($summit_id){ summary: "Add schedule setting filter", operationId: "addSummitScheduleSettingFilter", tags: ['Summit Schedule Settings'], - security: [['summit_schedule_settings_oauth2' => [ - SummitScopes::WriteSummitData, - ]]], - x: [ - 'required-groups' => [ - IGroup::SuperAdmins, - IGroup::Administrators, - IGroup::SummitAdministrators, - ] - ], + security: [['summit_oauth2' => []]], parameters: [ new OA\Parameter( name: 'id', @@ -566,7 +522,7 @@ enum: ['DATE', 'TRACK', 'TRACK_GROUPS', 'COMPANY', 'LEVEL', 'SPEAKERS', 'VENUES' 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: "Not Found"), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "not found"), new OA\Response(response: Response::HTTP_PRECONDITION_FAILED, description: "Validation Error"), new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error") ] @@ -595,16 +551,7 @@ function ($payload, $summit, $id){ summary: "Update schedule setting filter", operationId: "updateSummitScheduleSettingFilter", tags: ['Summit Schedule Settings'], - security: [['summit_schedule_settings_oauth2' => [ - SummitScopes::WriteSummitData, - ]]], - x: [ - 'required-groups' => [ - IGroup::SuperAdmins, - IGroup::Administrators, - IGroup::SummitAdministrators, - ] - ], + security: [['summit_oauth2' => []]], parameters: [ new OA\Parameter( name: 'id', @@ -653,7 +600,7 @@ enum: ['DATE', 'TRACK', 'TRACK_GROUPS', 'COMPANY', 'LEVEL', 'SPEAKERS', 'VENUES' 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: "Not Found"), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "not found"), new OA\Response(response: Response::HTTP_PRECONDITION_FAILED, description: "Validation Error"), new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error") ] @@ -684,16 +631,7 @@ function($filter_id, $payload, $summit, $config_id){ summary: "Seed default schedule settings", operationId: "seedDefaultSummitScheduleSettings", tags: ['Summit Schedule Settings'], - security: [['summit_schedule_settings_oauth2' => [ - SummitScopes::WriteSummitData, - ]]], - x: [ - 'required-groups' => [ - IGroup::SuperAdmins, - IGroup::Administrators, - IGroup::SummitAdministrators, - ] - ], + security: [['summit_oauth2' => []]], parameters: [ new OA\Parameter( name: 'id', @@ -711,7 +649,7 @@ function($filter_id, $payload, $summit, $config_id){ ), 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: "Not Found"), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "not found"), 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/SummitSchemas.php b/app/Swagger/SummitSchemas.php index 78d9f4fbd..4b0ac51ab 100644 --- a/app/Swagger/SummitSchemas.php +++ b/app/Swagger/SummitSchemas.php @@ -6,7 +6,7 @@ use OpenApi\Attributes as OA; #[OA\Schema( - schema: 'SummitScheduleConfigContent', + schema: 'SummitScheduleConfig', type: 'object', properties: [ new OA\Property(property: 'id', type: 'integer', example: 1), @@ -33,23 +33,6 @@ ) ] )] -class SummitScheduleConfigContentSchema {} - - -#[OA\Schema( - schema: 'SummitScheduleConfig', - type: 'object', - properties: [ - new OA\Property( - property: '', - description: 'Dynamic property name with SummitScheduleFilterElementConfig->type as key', - type: 'object', - allOf: [ - new OA\Schema(ref: '#/components/schemas/SummitScheduleConfigContent') - ] - ) - ] -)] class SummitScheduleConfigSchema {} #[OA\Schema( @@ -77,15 +60,14 @@ class PaginatedSummitScheduleConfigsResponseSchema {} new OA\Property(property: 'id', type: 'integer', example: 1), new OA\Property(property: 'created', type: 'integer', description: 'Unix timestamp', example: 1640995200), new OA\Property(property: 'last_edited', type: 'integer', description: 'Unix timestamp', example: 1640995200), - new OA\Property(property: 'label', type: 'string', example: 'Date'), - new OA\Property(property: 'is_enabled', type: 'boolean', example: true), - new OA\Property(property: 'order', type: 'integer', example: 1), new OA\Property( property: 'type', type: 'string', enum: ['DATE', 'TRACK', 'TRACK_GROUPS', 'COMPANY', 'LEVEL', 'SPEAKERS', 'VENUES', 'EVENT_TYPES', 'TITLE', 'CUSTOM_ORDER', 'ABSTRACT', 'TAGS'], example: 'DATE' ), + new OA\Property(property: 'is_enabled', type: 'boolean', example: true), + new OA\Property(property: 'label', type: 'string', example: 'Date'), ] )] class SummitScheduleFilterElementConfigSchema {} From f929e15aa21320759d8a257f4c7aa16621417193 Mon Sep 17 00:00:00 2001 From: Matias Perrone Date: Tue, 14 Oct 2025 14:57:48 -0300 Subject: [PATCH 2/9] fix: Change "namespace" word positioning --- .../Summit/OAuth2SummitScheduleSettingsApiController.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitScheduleSettingsApiController.php b/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitScheduleSettingsApiController.php index 69d292ebc..b11fa598a 100644 --- a/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitScheduleSettingsApiController.php +++ b/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitScheduleSettingsApiController.php @@ -1,4 +1,6 @@ - Date: Mon, 17 Nov 2025 20:35:42 +0000 Subject: [PATCH 3/9] chore: Add the security schema for the controller into its own file --- ...th2SummitScheduleSettingsApiController.php | 92 +++++++++++++++++-- 1 file changed, 83 insertions(+), 9 deletions(-) diff --git a/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitScheduleSettingsApiController.php b/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitScheduleSettingsApiController.php index b11fa598a..4a41cc35f 100644 --- a/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitScheduleSettingsApiController.php +++ b/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitScheduleSettingsApiController.php @@ -203,7 +203,17 @@ public function getChildSerializer():string{ summary: "Get all schedule settings", operationId: "getAllSummitScheduleSettings", tags: ['Summit Schedule Settings'], - security: [['summit_oauth2' => []]], + security: [['summit_schedule_settings_oauth2' => [ + SummitScopes::ReadSummitData, + SummitScopes::ReadAllSummitData, + ]]], + x: [ + 'required-groups' => [ + IGroup::SuperAdmins, + IGroup::Administrators, + IGroup::SummitAdministrators, + ] + ], parameters: [ new OA\Parameter( name: 'id', @@ -279,7 +289,17 @@ public function getAllBySummit($summit_id) summary: "Get schedule setting", operationId: "getSummitScheduleSetting", tags: ['Summit Schedule Settings'], - security: [['summit_oauth2' => []]], + security: [['summit_schedule_settings_oauth2' => [ + SummitScopes::ReadSummitData, + SummitScopes::ReadAllSummitData, + ]]], + x: [ + 'required-groups' => [ + IGroup::SuperAdmins, + IGroup::Administrators, + IGroup::SummitAdministrators, + ] + ], parameters: [ new OA\Parameter( name: 'id', @@ -333,7 +353,16 @@ public function get($summit_id, $config_id) summary: "Create schedule setting", operationId: "createSummitScheduleSetting", tags: ['Summit Schedule Settings'], - security: [['summit_oauth2' => []]], + security: [['summit_schedule_settings_oauth2' => [ + SummitScopes::WriteSummitData, + ]]], + x: [ + 'required-groups' => [ + IGroup::SuperAdmins, + IGroup::Administrators, + IGroup::SummitAdministrators, + ] + ], parameters: [ new OA\Parameter( name: 'id', @@ -372,7 +401,16 @@ public function add($summit_id) summary: "Update schedule setting", operationId: "updateSummitScheduleSetting", tags: ['Summit Schedule Settings'], - security: [['summit_oauth2' => []]], + security: [['summit_schedule_settings_oauth2' => [ + SummitScopes::WriteSummitData, + ]]], + x: [ + 'required-groups' => [ + IGroup::SuperAdmins, + IGroup::Administrators, + IGroup::SummitAdministrators, + ] + ], parameters: [ new OA\Parameter( name: 'id', @@ -418,7 +456,16 @@ public function update($summit_id, $config_id) summary: "Delete schedule setting", operationId: "deleteSummitScheduleSetting", tags: ['Summit Schedule Settings'], - security: [['summit_oauth2' => []]], + security: [['summit_schedule_settings_oauth2' => [ + SummitScopes::WriteSummitData, + ]]], + x: [ + 'required-groups' => [ + IGroup::SuperAdmins, + IGroup::Administrators, + IGroup::SummitAdministrators, + ] + ], parameters: [ new OA\Parameter( name: 'id', @@ -454,7 +501,7 @@ public function delete($summit_id, $config_id) summary: "Get schedule settings metadata", operationId: "getSummitScheduleSettingsMetadata", tags: ['Summit Schedule Settings'], - security: [['summit_oauth2' => []]], + security: [['summit_schedule_settings_oauth2' => []]], parameters: [ new OA\Parameter( name: 'id', @@ -482,7 +529,16 @@ public function getMetadata($summit_id){ summary: "Add schedule setting filter", operationId: "addSummitScheduleSettingFilter", tags: ['Summit Schedule Settings'], - security: [['summit_oauth2' => []]], + security: [['summit_schedule_settings_oauth2' => [ + SummitScopes::WriteSummitData, + ]]], + x: [ + 'required-groups' => [ + IGroup::SuperAdmins, + IGroup::Administrators, + IGroup::SummitAdministrators, + ] + ], parameters: [ new OA\Parameter( name: 'id', @@ -553,7 +609,16 @@ function ($payload, $summit, $id){ summary: "Update schedule setting filter", operationId: "updateSummitScheduleSettingFilter", tags: ['Summit Schedule Settings'], - security: [['summit_oauth2' => []]], + security: [['summit_schedule_settings_oauth2' => [ + SummitScopes::WriteSummitData, + ]]], + x: [ + 'required-groups' => [ + IGroup::SuperAdmins, + IGroup::Administrators, + IGroup::SummitAdministrators, + ] + ], parameters: [ new OA\Parameter( name: 'id', @@ -633,7 +698,16 @@ function($filter_id, $payload, $summit, $config_id){ summary: "Seed default schedule settings", operationId: "seedDefaultSummitScheduleSettings", tags: ['Summit Schedule Settings'], - security: [['summit_oauth2' => []]], + security: [['summit_schedule_settings_oauth2' => [ + SummitScopes::WriteSummitData, + ]]], + x: [ + 'required-groups' => [ + IGroup::SuperAdmins, + IGroup::Administrators, + IGroup::SummitAdministrators, + ] + ], parameters: [ new OA\Parameter( name: 'id', From 5d72be78db3e9c59b3f27ca17a3ad90ea0a1c341 Mon Sep 17 00:00:00 2001 From: Matias Perrone Date: Wed, 26 Nov 2025 15:48:52 +0000 Subject: [PATCH 4/9] fix: response schema and add missing security params --- ...th2SummitScheduleSettingsApiController.php | 32 +++++++---- app/Swagger/SummitSchemas.php | 55 +++++++++++-------- 2 files changed, 53 insertions(+), 34 deletions(-) diff --git a/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitScheduleSettingsApiController.php b/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitScheduleSettingsApiController.php index 4a41cc35f..ac6598436 100644 --- a/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitScheduleSettingsApiController.php +++ b/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitScheduleSettingsApiController.php @@ -273,7 +273,7 @@ public function getChildSerializer():string{ ), 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: "not found"), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Not Found"), new OA\Response(response: Response::HTTP_PRECONDITION_FAILED, description: "Validation Error"), new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error") ] @@ -338,7 +338,7 @@ public function getAllBySummit($summit_id) ), 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: "not found"), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Not Found"), new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error") ] )] @@ -385,7 +385,7 @@ public function get($summit_id, $config_id) 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: "not found"), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Not Found"), new OA\Response(response: Response::HTTP_PRECONDITION_FAILED, description: "Validation Error"), new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error") ] @@ -440,7 +440,7 @@ public function add($summit_id) 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: "not found"), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Not Found"), new OA\Response(response: Response::HTTP_PRECONDITION_FAILED, description: "Validation Error"), new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error") ] @@ -486,7 +486,7 @@ public function update($summit_id, $config_id) new OA\Response(response: 204, description: 'No Content'), 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: "not found"), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Not Found"), new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error") ] )] @@ -501,7 +501,17 @@ public function delete($summit_id, $config_id) summary: "Get schedule settings metadata", operationId: "getSummitScheduleSettingsMetadata", tags: ['Summit Schedule Settings'], - security: [['summit_schedule_settings_oauth2' => []]], + security: [['summit_schedule_settings_oauth2' => [ + SummitScopes::ReadSummitData, + SummitScopes::ReadAllSummitData, + ]]], + x: [ + 'required-groups' => [ + IGroup::SuperAdmins, + IGroup::Administrators, + IGroup::SummitAdministrators, + ] + ], parameters: [ new OA\Parameter( name: 'id', @@ -512,11 +522,9 @@ public function delete($summit_id, $config_id) ) ], responses: [ - new OA\Response(response: 200, description: 'Success'), + new OA\Response(response: 200, description: 'Success with an empty response body'), 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: "not found"), - new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error") ] )] public function getMetadata($summit_id){ @@ -580,7 +588,7 @@ enum: ['DATE', 'TRACK', 'TRACK_GROUPS', 'COMPANY', 'LEVEL', 'SPEAKERS', 'VENUES' 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: "not found"), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Not Found"), new OA\Response(response: Response::HTTP_PRECONDITION_FAILED, description: "Validation Error"), new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error") ] @@ -667,7 +675,7 @@ enum: ['DATE', 'TRACK', 'TRACK_GROUPS', 'COMPANY', 'LEVEL', 'SPEAKERS', 'VENUES' 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: "not found"), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Not Found"), new OA\Response(response: Response::HTTP_PRECONDITION_FAILED, description: "Validation Error"), new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error") ] @@ -725,7 +733,7 @@ function($filter_id, $payload, $summit, $config_id){ ), 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: "not found"), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Not Found"), 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/SummitSchemas.php b/app/Swagger/SummitSchemas.php index 4b0ac51ab..105844f40 100644 --- a/app/Swagger/SummitSchemas.php +++ b/app/Swagger/SummitSchemas.php @@ -9,27 +9,37 @@ schema: 'SummitScheduleConfig', type: 'object', properties: [ - new OA\Property(property: 'id', type: 'integer', example: 1), - new OA\Property(property: 'created', type: 'integer', description: 'Unix timestamp', example: 1640995200), - new OA\Property(property: 'last_edited', type: 'integer', description: 'Unix timestamp', example: 1640995200), - new OA\Property(property: 'key', type: 'string', example: 'schedule-main'), - new OA\Property(property: 'summit_id', type: 'integer', example: 1), - new OA\Property(property: 'is_my_schedule', type: 'boolean', example: false), - new OA\Property(property: 'only_events_with_attendee_access', type: 'boolean', example: false), - new OA\Property(property: 'color_source', type: 'string', enum: ['EVENT_TYPES', 'TRACK', 'TRACK_GROUP'], example: 'EVENT_TYPES'), - new OA\Property(property: 'is_enabled', type: 'boolean', example: true), - new OA\Property(property: 'is_default', type: 'boolean', example: true), - new OA\Property(property: 'hide_past_events_with_show_always_on_schedule', type: 'boolean', example: false), - new OA\Property(property: 'time_format', type: 'string', enum: ['12h', '24h'], example: '12h'), new OA\Property( - property: 'filters', - type: 'array', - items: new OA\Items(ref: '#/components/schemas/SummitScheduleFilterElementConfig') - ), - new OA\Property( - property: 'pre_filters', - type: 'array', - items: new OA\Items(ref: '#/components/schemas/SummitSchedulePreFilterElementConfig') + property: '', + description: 'Dynamic property name with SummitScheduleFilterElementConfig->type as key', + type: 'object', + schema: new OA\Schema( + type: 'object', + properties: [ + new OA\Property(property: 'id', type: 'integer', example: 1), + new OA\Property(property: 'created', type: 'integer', description: 'Unix timestamp', example: 1640995200), + new OA\Property(property: 'last_edited', type: 'integer', description: 'Unix timestamp', example: 1640995200), + new OA\Property(property: 'key', type: 'string', example: 'schedule-main'), + new OA\Property(property: 'summit_id', type: 'integer', example: 1), + new OA\Property(property: 'is_my_schedule', type: 'boolean', example: false), + new OA\Property(property: 'only_events_with_attendee_access', type: 'boolean', example: false), + new OA\Property(property: 'color_source', type: 'string', enum: ['EVENT_TYPES', 'TRACK', 'TRACK_GROUP'], example: 'EVENT_TYPES'), + new OA\Property(property: 'is_enabled', type: 'boolean', example: true), + new OA\Property(property: 'is_default', type: 'boolean', example: true), + new OA\Property(property: 'hide_past_events_with_show_always_on_schedule', type: 'boolean', example: false), + new OA\Property(property: 'time_format', type: 'string', enum: ['12h', '24h'], example: '12h'), + new OA\Property( + property: 'filters', + type: 'array', + items: new OA\Items(ref: '#/components/schemas/SummitScheduleFilterElementConfig') + ), + new OA\Property( + property: 'pre_filters', + type: 'array', + items: new OA\Items(ref: '#/components/schemas/SummitSchedulePreFilterElementConfig') + ) + ] + ) ) ] )] @@ -60,14 +70,15 @@ class PaginatedSummitScheduleConfigsResponseSchema {} new OA\Property(property: 'id', type: 'integer', example: 1), new OA\Property(property: 'created', type: 'integer', description: 'Unix timestamp', example: 1640995200), new OA\Property(property: 'last_edited', type: 'integer', description: 'Unix timestamp', example: 1640995200), + new OA\Property(property: 'label', type: 'string', example: 'Date'), + new OA\Property(property: 'is_enabled', type: 'boolean', example: true), + new OA\Property(property: 'order', type: 'integer', example: 1), new OA\Property( property: 'type', type: 'string', enum: ['DATE', 'TRACK', 'TRACK_GROUPS', 'COMPANY', 'LEVEL', 'SPEAKERS', 'VENUES', 'EVENT_TYPES', 'TITLE', 'CUSTOM_ORDER', 'ABSTRACT', 'TAGS'], example: 'DATE' ), - new OA\Property(property: 'is_enabled', type: 'boolean', example: true), - new OA\Property(property: 'label', type: 'string', example: 'Date'), ] )] class SummitScheduleFilterElementConfigSchema {} From cdcaa0e1e1f628057be17a0301b35e8949d50a10 Mon Sep 17 00:00:00 2001 From: Matias Perrone Date: Wed, 3 Dec 2025 19:49:11 +0000 Subject: [PATCH 5/9] feat: Add changes requested --- .../Summit/OAuth2SummitScheduleSettingsApiController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitScheduleSettingsApiController.php b/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitScheduleSettingsApiController.php index ac6598436..22430bd64 100644 --- a/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitScheduleSettingsApiController.php +++ b/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitScheduleSettingsApiController.php @@ -483,7 +483,7 @@ public function update($summit_id, $config_id) ) ], responses: [ - new OA\Response(response: 204, description: 'No Content'), + new OA\Response(response: Response::HTTP_NO_CONTENT, description: 'No Content'), 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: "Not Found"), From b071c8439363f05a4881633fc1bbf6827fe622bc Mon Sep 17 00:00:00 2001 From: Matias Perrone Date: Wed, 10 Dec 2025 19:40:55 +0000 Subject: [PATCH 6/9] fix: rebase to main and fix doc generation --- app/Swagger/SummitSchemas.php | 60 +++++++++++++++++++---------------- 1 file changed, 33 insertions(+), 27 deletions(-) diff --git a/app/Swagger/SummitSchemas.php b/app/Swagger/SummitSchemas.php index 105844f40..ff2e92c9c 100644 --- a/app/Swagger/SummitSchemas.php +++ b/app/Swagger/SummitSchemas.php @@ -4,6 +4,36 @@ use models\summit\ISponsorshipTypeConstants; use OpenApi\Attributes as OA; +#[OA\Schema( + schema: 'SummitScheduleConfigContent', + type: 'object', + properties: [ + new OA\Property(property: 'id', type: 'integer', example: 1), + new OA\Property(property: 'created', type: 'integer', description: 'Unix timestamp', example: 1640995200), + new OA\Property(property: 'last_edited', type: 'integer', description: 'Unix timestamp', example: 1640995200), + new OA\Property(property: 'key', type: 'string', example: 'schedule-main'), + new OA\Property(property: 'summit_id', type: 'integer', example: 1), + new OA\Property(property: 'is_my_schedule', type: 'boolean', example: false), + new OA\Property(property: 'only_events_with_attendee_access', type: 'boolean', example: false), + new OA\Property(property: 'color_source', type: 'string', enum: ['EVENT_TYPES', 'TRACK', 'TRACK_GROUP'], example: 'EVENT_TYPES'), + new OA\Property(property: 'is_enabled', type: 'boolean', example: true), + new OA\Property(property: 'is_default', type: 'boolean', example: true), + new OA\Property(property: 'hide_past_events_with_show_always_on_schedule', type: 'boolean', example: false), + new OA\Property(property: 'time_format', type: 'string', enum: ['12h', '24h'], example: '12h'), + new OA\Property( + property: 'filters', + type: 'array', + items: new OA\Items(ref: '#/components/schemas/SummitScheduleFilterElementConfig') + ), + new OA\Property( + property: 'pre_filters', + type: 'array', + items: new OA\Items(ref: '#/components/schemas/SummitSchedulePreFilterElementConfig') + ) + ] +)] +class SummitScheduleConfigContentSchema {} + #[OA\Schema( schema: 'SummitScheduleConfig', @@ -13,33 +43,9 @@ property: '', description: 'Dynamic property name with SummitScheduleFilterElementConfig->type as key', type: 'object', - schema: new OA\Schema( - type: 'object', - properties: [ - new OA\Property(property: 'id', type: 'integer', example: 1), - new OA\Property(property: 'created', type: 'integer', description: 'Unix timestamp', example: 1640995200), - new OA\Property(property: 'last_edited', type: 'integer', description: 'Unix timestamp', example: 1640995200), - new OA\Property(property: 'key', type: 'string', example: 'schedule-main'), - new OA\Property(property: 'summit_id', type: 'integer', example: 1), - new OA\Property(property: 'is_my_schedule', type: 'boolean', example: false), - new OA\Property(property: 'only_events_with_attendee_access', type: 'boolean', example: false), - new OA\Property(property: 'color_source', type: 'string', enum: ['EVENT_TYPES', 'TRACK', 'TRACK_GROUP'], example: 'EVENT_TYPES'), - new OA\Property(property: 'is_enabled', type: 'boolean', example: true), - new OA\Property(property: 'is_default', type: 'boolean', example: true), - new OA\Property(property: 'hide_past_events_with_show_always_on_schedule', type: 'boolean', example: false), - new OA\Property(property: 'time_format', type: 'string', enum: ['12h', '24h'], example: '12h'), - new OA\Property( - property: 'filters', - type: 'array', - items: new OA\Items(ref: '#/components/schemas/SummitScheduleFilterElementConfig') - ), - new OA\Property( - property: 'pre_filters', - type: 'array', - items: new OA\Items(ref: '#/components/schemas/SummitSchedulePreFilterElementConfig') - ) - ] - ) + allOf: [ + new OA\Schema(ref: '#/components/schemas/SummitScheduleConfigContent') + ] ) ] )] From 111945dad5dde2b84d9c250632f71f19c475661f Mon Sep 17 00:00:00 2001 From: Matias Perrone Date: Tue, 27 Jan 2026 13:02:04 +0000 Subject: [PATCH 7/9] fix: remove incorrectly added methods from traits Signed-off-by: Matias Perrone --- ...th2SummitScheduleSettingsApiController.php | 20 ------------------- app/Swagger/SummitSchemas.php | 1 + 2 files changed, 1 insertion(+), 20 deletions(-) diff --git a/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitScheduleSettingsApiController.php b/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitScheduleSettingsApiController.php index 22430bd64..8f6ea4d39 100644 --- a/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitScheduleSettingsApiController.php +++ b/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitScheduleSettingsApiController.php @@ -278,10 +278,6 @@ public function getChildSerializer():string{ new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error") ] )] - public function getAllBySummit($summit_id) - { - return $this->traitGetAllBySummit($summit_id); - } #[OA\Get( path: "/api/v1/summits/{id}/schedule-settings/{config_id}", @@ -342,10 +338,6 @@ public function getAllBySummit($summit_id) new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error") ] )] - public function get($summit_id, $config_id) - { - return $this->traitGet($summit_id, $config_id); - } #[OA\Post( path: "/api/v1/summits/{id}/schedule-settings", @@ -390,10 +382,6 @@ public function get($summit_id, $config_id) new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error") ] )] - public function add($summit_id) - { - return $this->traitAdd($summit_id); - } #[OA\Put( path: "/api/v1/summits/{id}/schedule-settings/{config_id}", @@ -445,10 +433,6 @@ public function add($summit_id) new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error") ] )] - public function update($summit_id, $config_id) - { - return $this->traitUpdate($summit_id, $config_id); - } #[OA\Delete( path: "/api/v1/summits/{id}/schedule-settings/{config_id}", @@ -490,10 +474,6 @@ public function update($summit_id, $config_id) new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error") ] )] - public function delete($summit_id, $config_id) - { - return $this->traitDelete($summit_id, $config_id); - } #[OA\Get( path: "/api/v1/summits/{id}/schedule-settings/metadata", diff --git a/app/Swagger/SummitSchemas.php b/app/Swagger/SummitSchemas.php index ff2e92c9c..78d9f4fbd 100644 --- a/app/Swagger/SummitSchemas.php +++ b/app/Swagger/SummitSchemas.php @@ -4,6 +4,7 @@ use models\summit\ISponsorshipTypeConstants; use OpenApi\Attributes as OA; + #[OA\Schema( schema: 'SummitScheduleConfigContent', type: 'object', From 3f7f7b320e5d13d7702a2ec9f6f8f1a7306b5523 Mon Sep 17 00:00:00 2001 From: Matias Perrone Date: Tue, 27 Jan 2026 13:03:45 +0000 Subject: [PATCH 8/9] fix: linting Signed-off-by: Matias Perrone --- .../Summit/OAuth2SummitScheduleSettingsApiController.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitScheduleSettingsApiController.php b/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitScheduleSettingsApiController.php index 8f6ea4d39..355fc8d41 100644 --- a/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitScheduleSettingsApiController.php +++ b/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitScheduleSettingsApiController.php @@ -1,6 +1,4 @@ - Date: Tue, 27 Jan 2026 13:09:26 +0000 Subject: [PATCH 9/9] . Signed-off-by: Matias Perrone --- .../Summit/OAuth2SummitScheduleSettingsApiController.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitScheduleSettingsApiController.php b/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitScheduleSettingsApiController.php index 355fc8d41..8f6ea4d39 100644 --- a/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitScheduleSettingsApiController.php +++ b/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitScheduleSettingsApiController.php @@ -1,4 +1,6 @@ -