From 3c6cd07a9771131f003cddb2a96302203f22a881 Mon Sep 17 00:00:00 2001 From: Matias Perrone Date: Tue, 14 Oct 2025 10:42:36 -0300 Subject: [PATCH 1/6] feat: Extend Swagger Coverage for controller `OAuth2SummitScheduleSettingsApiController` --- ...th2SummitScheduleSettingsApiController.php | 426 +++++++++++++++++- app/Swagger/SummitSchemas.php | 271 +++++++++++ 2 files changed, 691 insertions(+), 6 deletions(-) diff --git a/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitScheduleSettingsApiController.php b/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitScheduleSettingsApiController.php index ac884c672..df926d497 100644 --- a/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitScheduleSettingsApiController.php +++ b/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitScheduleSettingsApiController.php @@ -16,6 +16,7 @@ use App\Models\Foundation\Summit\Repositories\ISummitScheduleConfigRepository; use App\ModelSerializers\SerializerUtils; use App\Services\Model\ISummitScheduleSettingsService; +use Illuminate\Http\Response; use Illuminate\Support\Facades\Log; use models\exceptions\EntityNotFoundException; use models\exceptions\ValidationException; @@ -25,6 +26,7 @@ use models\summit\SummitScheduleConfig; use models\utils\IEntity; use ModelSerializers\SerializerRegistry; +use OpenApi\Attributes as OA; use utils\PagingResponse; /** @@ -190,10 +192,338 @@ public function getChildSerializer():string{ return SerializerRegistry::SerializerType_Private; } + #[OA\Get( + path: "/api/v1/summits/{id}/schedule-settings", + description: "Get all schedule settings for a summit", + summary: "Get all schedule settings", + operationId: "getAllSummitScheduleSettings", + tags: ['Summit Schedule Settings'], + security: [['summit_oauth2' => []]], + parameters: [ + new OA\Parameter( + name: 'id', + in: 'path', + required: true, + schema: new OA\Schema(type: 'integer'), + description: 'The summit id' + ), + new OA\Parameter( + name: 'page', + in: 'query', + required: false, + schema: new OA\Schema(type: 'integer', default: 1), + description: 'Page number' + ), + new OA\Parameter( + name: 'per_page', + in: 'query', + required: false, + schema: new OA\Schema(type: 'integer', default: 10), + description: 'Items per page' + ), + new OA\Parameter( + name: 'filter', + in: 'query', + required: false, + schema: new OA\Schema(type: 'string'), + description: 'Filter expression (e.g., key=@schedule,is_enabled==true)' + ), + new OA\Parameter( + name: 'order', + in: 'query', + required: false, + schema: new OA\Schema(type: 'string'), + description: 'Order by field (e.g., +id, -key)' + ), + new OA\Parameter( + name: 'expand', + in: 'query', + required: false, + schema: new OA\Schema(type: 'string'), + description: 'Expand relationships (filters,pre_filters)' + ), + new OA\Parameter( + name: 'relations', + in: 'query', + required: false, + schema: new OA\Schema(type: 'string'), + description: 'Relations to include (filters,pre_filters)' + ) + ], + responses: [ + new OA\Response( + response: 200, + description: 'Success', + content: new OA\JsonContent(ref: '#/components/schemas/PaginatedSummitScheduleConfigsResponse') + ), + 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_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}", + description: "Get a specific schedule setting by id", + summary: "Get schedule setting", + operationId: "getSummitScheduleSetting", + tags: ['Summit Schedule Settings'], + security: [['summit_oauth2' => []]], + parameters: [ + new OA\Parameter( + name: 'id', + in: 'path', + required: true, + schema: new OA\Schema(type: 'integer'), + description: 'The summit id' + ), + new OA\Parameter( + name: 'config_id', + in: 'path', + required: true, + schema: new OA\Schema(type: 'integer'), + description: 'The schedule config id' + ), + new OA\Parameter( + name: 'expand', + in: 'query', + required: false, + schema: new OA\Schema(type: 'string'), + description: 'Expand relationships (filters,pre_filters)' + ), + new OA\Parameter( + name: 'relations', + in: 'query', + required: false, + schema: new OA\Schema(type: 'string'), + description: 'Relations to include (filters,pre_filters)' + ) + ], + responses: [ + new OA\Response( + response: 200, + description: 'Success', + content: new OA\JsonContent(ref: '#/components/schemas/SummitScheduleConfig') + ), + 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 get($summit_id, $config_id) + { + return $this->traitGet($summit_id, $config_id); + } + + #[OA\Post( + path: "/api/v1/summits/{id}/schedule-settings", + description: "Create a new schedule setting for a summit", + summary: "Create schedule setting", + operationId: "createSummitScheduleSetting", + tags: ['Summit Schedule Settings'], + security: [['summit_oauth2' => []]], + parameters: [ + new OA\Parameter( + name: 'id', + in: 'path', + required: true, + schema: new OA\Schema(type: 'integer'), + description: 'The summit id' + ) + ], + requestBody: new OA\RequestBody( + required: true, + content: new OA\JsonContent(ref: '#/components/schemas/SummitScheduleConfigCreateRequest') + ), + responses: [ + new OA\Response( + response: 201, + description: 'Created', + content: new OA\JsonContent(ref: '#/components/schemas/SummitScheduleConfig') + ), + 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_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}", + description: "Update an existing schedule setting", + summary: "Update schedule setting", + operationId: "updateSummitScheduleSetting", + tags: ['Summit Schedule Settings'], + security: [['summit_oauth2' => []]], + parameters: [ + new OA\Parameter( + name: 'id', + in: 'path', + required: true, + schema: new OA\Schema(type: 'integer'), + description: 'The summit id' + ), + new OA\Parameter( + name: 'config_id', + in: 'path', + required: true, + schema: new OA\Schema(type: 'integer'), + description: 'The schedule config id' + ) + ], + requestBody: new OA\RequestBody( + required: true, + content: new OA\JsonContent(ref: '#/components/schemas/SummitScheduleConfigUpdateRequest') + ), + responses: [ + new OA\Response( + response: 200, + description: 'Success', + content: new OA\JsonContent(ref: '#/components/schemas/SummitScheduleConfig') + ), + 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_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}", + description: "Delete a schedule setting", + summary: "Delete schedule setting", + operationId: "deleteSummitScheduleSetting", + tags: ['Summit Schedule Settings'], + security: [['summit_oauth2' => []]], + parameters: [ + new OA\Parameter( + name: 'id', + in: 'path', + required: true, + schema: new OA\Schema(type: 'integer'), + description: 'The summit id' + ), + new OA\Parameter( + name: 'config_id', + in: 'path', + required: true, + schema: new OA\Schema(type: 'integer'), + description: 'The schedule config id' + ) + ], + responses: [ + 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_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", + description: "Get metadata for schedule settings", + summary: "Get schedule settings metadata", + operationId: "getSummitScheduleSettingsMetadata", + tags: ['Summit Schedule Settings'], + security: [['summit_oauth2' => []]], + parameters: [ + new OA\Parameter( + name: 'id', + in: 'path', + required: true, + schema: new OA\Schema(type: 'integer'), + description: 'The summit id' + ) + ], + responses: [ + 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){ } + #[OA\Post( + path: "/api/v1/summits/{id}/schedule-settings/{config_id}/filters", + description: "Add a filter to a schedule setting", + summary: "Add schedule setting filter", + operationId: "addSummitScheduleSettingFilter", + tags: ['Summit Schedule Settings'], + security: [['summit_oauth2' => []]], + parameters: [ + new OA\Parameter( + name: 'id', + in: 'path', + required: true, + schema: new OA\Schema(type: 'integer'), + description: 'The summit id' + ), + new OA\Parameter( + name: 'config_id', + in: 'path', + required: true, + schema: new OA\Schema(type: 'integer'), + description: 'The schedule config id' + ) + ], + requestBody: new OA\RequestBody( + required: true, + content: new OA\JsonContent( + type: 'object', + required: ['type'], + properties: [ + new OA\Property( + property: 'type', + type: 'string', + enum: ['DATE', 'TRACK', 'TRACK_GROUPS', 'COMPANY', 'LEVEL', 'SPEAKERS', 'VENUES', 'EVENT_TYPES', 'TITLE', 'CUSTOM_ORDER', 'ABSTRACT', 'TAGS'] + ), + new OA\Property(property: 'is_enabled', type: 'boolean'), + new OA\Property(property: 'label', type: 'string', nullable: true) + ] + ) + ), + responses: [ + new OA\Response( + response: 201, + description: 'Created', + content: new OA\JsonContent(ref: '#/components/schemas/SummitScheduleFilterElementConfig') + ), + 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_PRECONDITION_FAILED, description: "Validation Error"), + new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error") + ] + )] public function addFilter($summit_id, $config_id){ $summit = SummitFinderStrategyFactory::build($this->summit_repository, $this->resource_server_context)->find($summit_id); @@ -212,6 +542,66 @@ function ($payload, $summit, $id){ ); } + #[OA\Put( + path: "/api/v1/summits/{id}/schedule-settings/{config_id}/filters/{filter_id}", + description: "Update a filter of a schedule setting", + summary: "Update schedule setting filter", + operationId: "updateSummitScheduleSettingFilter", + tags: ['Summit Schedule Settings'], + security: [['summit_oauth2' => []]], + parameters: [ + new OA\Parameter( + name: 'id', + in: 'path', + required: true, + schema: new OA\Schema(type: 'integer'), + description: 'The summit id' + ), + new OA\Parameter( + name: 'config_id', + in: 'path', + required: true, + schema: new OA\Schema(type: 'integer'), + description: 'The schedule config id' + ), + new OA\Parameter( + name: 'filter_id', + in: 'path', + required: true, + schema: new OA\Schema(type: 'integer'), + description: 'The filter id' + ) + ], + requestBody: new OA\RequestBody( + required: true, + content: new OA\JsonContent( + type: 'object', + properties: [ + new OA\Property( + property: 'type', + type: 'string', + enum: ['DATE', 'TRACK', 'TRACK_GROUPS', 'COMPANY', 'LEVEL', 'SPEAKERS', 'VENUES', 'EVENT_TYPES', 'TITLE', 'CUSTOM_ORDER', 'ABSTRACT', 'TAGS'], + nullable: true + ), + new OA\Property(property: 'is_enabled', type: 'boolean', nullable: true), + new OA\Property(property: 'label', type: 'string', nullable: true) + ] + ) + ), + responses: [ + new OA\Response( + response: 200, + description: 'Success', + content: new OA\JsonContent(ref: '#/components/schemas/SummitScheduleFilterElementConfig') + ), + 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_PRECONDITION_FAILED, description: "Validation Error"), + new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error") + ] + )] public function updateFilter($summit_id, $config_id, $filter_id){ $summit = SummitFinderStrategyFactory::build($this->summit_repository, $this->resource_server_context)->find($summit_id); if (is_null($summit)) return $this->error404(); @@ -232,11 +622,35 @@ function($filter_id, $payload, $summit, $config_id){ }, ...$args); } - /** - * @param $summit_id - * @return \Illuminate\Http\JsonResponse|mixed - * @throws \Exception - */ + #[OA\Post( + path: "/api/v1/summits/{id}/schedule-settings/seed", + description: "Seed default schedule settings for a summit", + summary: "Seed default schedule settings", + operationId: "seedDefaultSummitScheduleSettings", + tags: ['Summit Schedule Settings'], + security: [['summit_oauth2' => []]], + parameters: [ + new OA\Parameter( + name: 'id', + in: 'path', + required: true, + schema: new OA\Schema(type: 'integer'), + description: 'The summit id' + ) + ], + responses: [ + new OA\Response( + response: 201, + description: 'Created', + content: new OA\JsonContent(ref: '#/components/schemas/PaginatedSummitScheduleConfigsResponse') + ), + 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_PRECONDITION_FAILED, description: "Validation Error"), + new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error") + ] + )] public function seedDefaults($summit_id){ try { $summit = SummitFinderStrategyFactory::build($this->getSummitRepository(), $this->getResourceServerContext())->find($summit_id); @@ -281,4 +695,4 @@ public function seedDefaults($summit_id){ return $this->error500($ex); } } -} \ No newline at end of file +} diff --git a/app/Swagger/SummitSchemas.php b/app/Swagger/SummitSchemas.php index 489d39517..9a742f845 100644 --- a/app/Swagger/SummitSchemas.php +++ b/app/Swagger/SummitSchemas.php @@ -4,6 +4,277 @@ use OpenApi\Attributes as OA; +#[OA\Schema( + 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') + ) + ] +)] +class SummitScheduleConfigSchema {} + +#[OA\Schema( + schema: 'PaginatedSummitScheduleConfigsResponse', + 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/SummitScheduleConfig') + ) + ] + ) + ] +)] +class PaginatedSummitScheduleConfigsResponseSchema {} + +#[OA\Schema( + schema: 'SummitScheduleFilterElementConfig', + 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: '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 {} + +#[OA\Schema( + schema: 'SummitSchedulePreFilterElementConfig', + 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: 'type', + type: 'string', + enum: ['DATE', 'TRACK', 'TRACK_GROUPS', 'COMPANY', 'LEVEL', 'SPEAKERS', 'VENUES', 'EVENT_TYPES', 'TITLE', 'CUSTOM_ORDER', 'ABSTRACT', 'TAGS'], + example: 'TAGS' + ), + new OA\Property( + property: 'values', + type: 'array', + items: new OA\Items(type: 'string'), + example: ['tag1', 'tag2'] + ) + ] +)] +class SummitSchedulePreFilterElementConfigSchema {} + +#[OA\Schema( + schema: 'SummitScheduleConfigCreateRequest', + type: 'object', + required: ['key'], + properties: [ + new OA\Property(property: 'key', type: 'string', example: 'schedule-main'), + 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( + type: 'object', + properties: [ + new OA\Property(property: 'type', type: 'string', enum: ['DATE', 'TRACK', 'TRACK_GROUPS', 'COMPANY', 'LEVEL', 'SPEAKERS', 'VENUES', 'EVENT_TYPES', 'TITLE', 'CUSTOM_ORDER', 'ABSTRACT', 'TAGS']), + new OA\Property(property: 'is_enabled', type: 'boolean'), + new OA\Property(property: 'label', type: 'string', nullable: true) + ] + ), + nullable: true + ), + new OA\Property( + property: 'pre_filters', + type: 'array', + items: new OA\Items( + type: 'object', + properties: [ + new OA\Property(property: 'type', type: 'string', enum: ['DATE', 'TRACK', 'TRACK_GROUPS', 'COMPANY', 'LEVEL', 'SPEAKERS', 'VENUES', 'EVENT_TYPES', 'TITLE', 'CUSTOM_ORDER', 'ABSTRACT', 'TAGS']), + new OA\Property(property: 'values', type: 'array', items: new OA\Items(type: 'string')) + ] + ), + nullable: true + ) + ] +)] +class SummitScheduleConfigCreateRequestSchema {} + +#[OA\Schema( + schema: 'SummitScheduleConfigUpdateRequest', + type: 'object', + properties: [ + new OA\Property(property: 'key', type: 'string', example: 'schedule-main', nullable: true), + new OA\Property(property: 'is_my_schedule', type: 'boolean', example: false, nullable: true), + new OA\Property(property: 'only_events_with_attendee_access', type: 'boolean', example: false, nullable: true), + new OA\Property(property: 'color_source', type: 'string', enum: ['EVENT_TYPES', 'TRACK', 'TRACK_GROUP'], example: 'EVENT_TYPES', nullable: true), + new OA\Property(property: 'is_enabled', type: 'boolean', example: true, nullable: true), + new OA\Property(property: 'is_default', type: 'boolean', example: true, nullable: true), + new OA\Property(property: 'hide_past_events_with_show_always_on_schedule', type: 'boolean', example: false, nullable: true), + new OA\Property(property: 'time_format', type: 'string', enum: ['12h', '24h'], example: '12h', nullable: true), + new OA\Property( + property: 'filters', + type: 'array', + items: new OA\Items( + type: 'object', + properties: [ + new OA\Property(property: 'type', type: 'string', enum: ['DATE', 'TRACK', 'TRACK_GROUPS', 'COMPANY', 'LEVEL', 'SPEAKERS', 'VENUES', 'EVENT_TYPES', 'TITLE', 'CUSTOM_ORDER', 'ABSTRACT', 'TAGS']), + new OA\Property(property: 'is_enabled', type: 'boolean'), + new OA\Property(property: 'label', type: 'string', nullable: true) + ] + ), + nullable: true + ), + new OA\Property( + property: 'pre_filters', + type: 'array', + items: new OA\Items( + type: 'object', + properties: [ + new OA\Property(property: 'type', type: 'string', enum: ['DATE', 'TRACK', 'TRACK_GROUPS', 'COMPANY', 'LEVEL', 'SPEAKERS', 'VENUES', 'EVENT_TYPES', 'TITLE', 'CUSTOM_ORDER', 'ABSTRACT', 'TAGS']), + new OA\Property(property: 'values', type: 'array', items: new OA\Items(type: 'string')) + ] + ), + nullable: true + ) + ] +)] +class SummitScheduleConfigUpdateRequestSchema {} + +// Summit Documents + +#[OA\Schema( + schema: "SummitDocument", + description: "Summit document", + 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: "name", type: "string", example: "Code of Conduct"), + new OA\Property(property: "description", type: "string", example: "Summit code of conduct document"), + new OA\Property(property: "show_always", type: "boolean", example: true), + new OA\Property(property: "label", type: "string", example: "Code of Conduct"), + new OA\Property(property: "file", type: "string", format: "uri", nullable: true, example: "https://example.com/document.pdf"), + new OA\Property(property: "web_link", type: "string", format: "uri", nullable: true, example: "https://example.com/page"), + new OA\Property(property: "selection_plan_id", type: "integer", nullable: true, description: "SelectionPlan ID, full object description when ?expand=summit (summit)"), + new OA\Property( + property: "event_types", + type: "array", + items: new OA\Items(type: "integer"), + description: "Array of SummitEventType: objects when expanded, ids otherwise", + ), + new OA\Property(property: "summit_id", type: "integer", description: "Summit ID, full object description when ?expand=summit (summit)"), + ] +)] +class SummitDocumentSchema {} + +#[OA\Schema( + schema: "PaginatedSummitDocumentsResponse", + description: "Paginated list of summit documents", + allOf: [ + new OA\Schema(ref: "#/components/schemas/PaginateDataSchemaResponse"), + new OA\Schema( + properties: [ + new OA\Property( + property: "data", + type: "array", + items: new OA\Items(ref: "#/components/schemas/SummitDocument") + ) + ] + ) + ] +)] +class PaginatedSummitDocumentsResponseSchema {} + +#[OA\Schema( + schema: "SummitDocumentCreateRequest", + description: "Request to create a summit document", + required: ["name", "label"], + type: "object", + properties: [ + new OA\Property(property: "name", type: "string", example: "Code of Conduct"), + new OA\Property(property: "label", type: "string", example: "Code of Conduct"), + new OA\Property(property: "description", type: "string", nullable: true, example: "Summit code of conduct document"), + new OA\Property(property: "show_always", type: "boolean", nullable: true, example: true), + new OA\Property(property: "web_link", type: "string", format: "uri", nullable: true, example: "https://example.com/page"), + new OA\Property(property: "selection_plan_id", type: "integer", nullable: true, example: 1), + new OA\Property( + property: "event_types", + type: "array", + nullable: true, + items: new OA\Items(type: "integer"), + example: [1, 2, 3] + ), + new OA\Property( + property: "file", + type: "string", + format: "binary", + nullable: true, + description: "Document file upload (required if web_link not provided)" + ), + ] +)] +class SummitDocumentCreateRequest {} + +#[OA\Schema( + schema: "SummitDocumentUpdateRequest", + description: "Request to update a summit document", + type: "object", + properties: [ + new OA\Property(property: "name", type: "string", nullable: true, example: "Code of Conduct"), + new OA\Property(property: "label", type: "string", nullable: true, example: "Code of Conduct"), + new OA\Property(property: "description", type: "string", nullable: true, example: "Summit code of conduct document"), + new OA\Property(property: "show_always", type: "boolean", nullable: true, example: true), + new OA\Property(property: "web_link", type: "string", format: "uri", nullable: true, example: "https://example.com/page"), + new OA\Property(property: "selection_plan_id", type: "integer", nullable: true, example: 1), + new OA\Property( + property: "event_types", + type: "array", + nullable: true, + items: new OA\Items(type: "integer"), + example: [1, 2, 3] + ), + ] +)] +class SummitDocumentUpdateRequest {} + // Summit Attendee Badges #[OA\Schema( From d5bb6a2860901d780475bef3b77f15c68147b4ed Mon Sep 17 00:00:00 2001 From: Matias Perrone Date: Tue, 14 Oct 2025 14:57:48 -0300 Subject: [PATCH 2/6] fix: Change "namespace" word positioning --- .../Summit/OAuth2SummitScheduleSettingsApiController.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitScheduleSettingsApiController.php b/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitScheduleSettingsApiController.php index df926d497..243654ff6 100644 --- a/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitScheduleSettingsApiController.php +++ b/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitScheduleSettingsApiController.php @@ -1,4 +1,7 @@ -error500($ex); } } -} +} \ No newline at end of file From 6ce1c4d13a8a41acd36947da85db3ada142909d3 Mon Sep 17 00:00:00 2001 From: Matias Perrone Date: Mon, 17 Nov 2025 20:35:42 +0000 Subject: [PATCH 3/6] chore: Add the security schema for the controller into its own file --- ...th2SummitScheduleSettingsApiController.php | 96 +++++++++++++++++-- .../SummitScheduleSettingsAuthSchema.php | 28 ++++++ 2 files changed, 114 insertions(+), 10 deletions(-) create mode 100644 app/Swagger/Security/SummitScheduleSettingsAuthSchema.php diff --git a/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitScheduleSettingsApiController.php b/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitScheduleSettingsApiController.php index 243654ff6..4a41cc35f 100644 --- a/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitScheduleSettingsApiController.php +++ b/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitScheduleSettingsApiController.php @@ -16,8 +16,10 @@ **/ use App\Http\Exceptions\HTTP403ForbiddenException; +use App\Models\Foundation\Main\IGroup; use App\Models\Foundation\Summit\Repositories\ISummitScheduleConfigRepository; use App\ModelSerializers\SerializerUtils; +use App\Security\SummitScopes; use App\Services\Model\ISummitScheduleSettingsService; use Illuminate\Http\Response; use Illuminate\Support\Facades\Log; @@ -201,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', @@ -277,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', @@ -331,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', @@ -370,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', @@ -416,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', @@ -452,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', @@ -480,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', @@ -551,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', @@ -631,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', @@ -698,4 +774,4 @@ public function seedDefaults($summit_id){ return $this->error500($ex); } } -} \ No newline at end of file +} diff --git a/app/Swagger/Security/SummitScheduleSettingsAuthSchema.php b/app/Swagger/Security/SummitScheduleSettingsAuthSchema.php new file mode 100644 index 000000000..ad9d72cdb --- /dev/null +++ b/app/Swagger/Security/SummitScheduleSettingsAuthSchema.php @@ -0,0 +1,28 @@ + 'Read Summit Data', + SummitScopes::ReadAllSummitData => 'Read All Summit Data', + SummitScopes::WriteSummitData => 'Write Summit Data', + ], + ), + ], + ) +] +class SummitScheduleSettingsAuthSchema +{ +} From 577f4a2622537b82914aef7b792d70421546c28f Mon Sep 17 00:00:00 2001 From: Matias Perrone Date: Wed, 26 Nov 2025 15:48:52 +0000 Subject: [PATCH 4/6] 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 9a742f845..fe8c5c7d4 100644 --- a/app/Swagger/SummitSchemas.php +++ b/app/Swagger/SummitSchemas.php @@ -8,27 +8,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') + ) + ] + ) ) ] )] @@ -59,14 +69,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 965044dc31c99ab7795831d1c9c348a58f8de064 Mon Sep 17 00:00:00 2001 From: Matias Perrone Date: Wed, 3 Dec 2025 19:49:11 +0000 Subject: [PATCH 5/6] feat: Add changes requested --- .../Summit/OAuth2SummitScheduleSettingsApiController.php | 2 +- app/Swagger/Security/SummitScheduleSettingsAuthSchema.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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"), diff --git a/app/Swagger/Security/SummitScheduleSettingsAuthSchema.php b/app/Swagger/Security/SummitScheduleSettingsAuthSchema.php index ad9d72cdb..6e7e9837a 100644 --- a/app/Swagger/Security/SummitScheduleSettingsAuthSchema.php +++ b/app/Swagger/Security/SummitScheduleSettingsAuthSchema.php @@ -1,6 +1,6 @@ Date: Wed, 10 Dec 2025 19:40:55 +0000 Subject: [PATCH 6/6] 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 fe8c5c7d4..5f83d1c19 100644 --- a/app/Swagger/SummitSchemas.php +++ b/app/Swagger/SummitSchemas.php @@ -3,6 +3,36 @@ namespace App\Swagger\schemas; 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', @@ -12,33 +42,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') + ] ) ] )]