From 883912d1cf0c874c895e865ee5cdd450e7ead502 Mon Sep 17 00:00:00 2001 From: Matias Perrone Date: Tue, 14 Oct 2025 17:48:12 -0300 Subject: [PATCH 1/3] feat: Extend Swagger Coverage for controller `OAuth2SummitDocumentsApiController` --- app/Swagger/SummitSchemas.php | 102 ++++++++++++++++++++++++++++++++++ 1 file changed, 102 insertions(+) diff --git a/app/Swagger/SummitSchemas.php b/app/Swagger/SummitSchemas.php index 2366319b1..a1172c9d1 100644 --- a/app/Swagger/SummitSchemas.php +++ b/app/Swagger/SummitSchemas.php @@ -390,6 +390,108 @@ class SummitDocumentCreateRequest {} )] class SummitDocumentUpdateRequest {} +// 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: "label", type: "string", example: "Code of Conduct"), + new OA\Property(property: "show_always", type: "boolean", example: true), + 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: "event_types", + type: "array", + items: new OA\Items(type: ["integer", "SummitEventType"]), + description: "Array of SummitEventType: objects when expanded, ids otherwise", + ), + ], + anyOf: [ + new OA\Property(property: "summit_id", type: "integer", example: 1), + new OA\Property(property: "summit", type: "Summit"), + new OA\Property(property: "selection_plan_id", type: "integer", nullable: true, example: 1), + new OA\Property(property: "selection_plan", type: "SelectionPlan"), + ] +)] +class SummitDocument {} + +#[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 PaginatedSummitDocumentsResponse {} + +#[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 975709e1cb7851502a6c1cc04ab420389c0fe872 Mon Sep 17 00:00:00 2001 From: Matias Perrone Date: Wed, 26 Nov 2025 20:28:57 +0000 Subject: [PATCH 2/3] chore: Add the correct security and x attributes and create security schema --- app/Swagger/SummitSchemas.php | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/app/Swagger/SummitSchemas.php b/app/Swagger/SummitSchemas.php index a1172c9d1..d8c9e2650 100644 --- a/app/Swagger/SummitSchemas.php +++ b/app/Swagger/SummitSchemas.php @@ -402,25 +402,21 @@ class SummitDocumentUpdateRequest {} 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: "label", type: "string", example: "Code of Conduct"), 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", "SummitEventType"]), + items: new OA\Items(type: "integer"), description: "Array of SummitEventType: objects when expanded, ids otherwise", ), - ], - anyOf: [ - new OA\Property(property: "summit_id", type: "integer", example: 1), - new OA\Property(property: "summit", type: "Summit"), - new OA\Property(property: "selection_plan_id", type: "integer", nullable: true, example: 1), - new OA\Property(property: "selection_plan", type: "SelectionPlan"), + new OA\Property(property: "summit_id", type: "integer", description: "Summit ID, full object description when ?expand=summit (summit)"), ] )] -class SummitDocument {} +class SummitDocumentSchema {} #[OA\Schema( schema: "PaginatedSummitDocumentsResponse", @@ -438,7 +434,7 @@ class SummitDocument {} ) ] )] -class PaginatedSummitDocumentsResponse {} +class PaginatedSummitDocumentsResponseSchema {} #[OA\Schema( schema: "SummitDocumentCreateRequest", From 1580be5796748b757515dc2b253864b0520de66a Mon Sep 17 00:00:00 2001 From: Matias Perrone Date: Tue, 16 Dec 2025 20:41:35 +0000 Subject: [PATCH 3/3] fix: merge issues --- app/Swagger/SummitSchemas.php | 196 ---------------------------------- 1 file changed, 196 deletions(-) diff --git a/app/Swagger/SummitSchemas.php b/app/Swagger/SummitSchemas.php index d8c9e2650..5f83d1c19 100644 --- a/app/Swagger/SummitSchemas.php +++ b/app/Swagger/SummitSchemas.php @@ -292,202 +292,6 @@ class SummitDocumentCreateRequest {} )] class SummitDocumentUpdateRequest {} -// 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 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(