From 13f901b88fef31f1b5885a13bf3b7508801e8c53 Mon Sep 17 00:00:00 2001 From: Virgil Date: Thu, 2 Apr 2026 02:51:23 +0000 Subject: [PATCH] fix(api-docs): describe 410 gone responses Co-Authored-By: Virgil --- src/php/src/Api/Documentation/Attributes/ApiResponse.php | 1 + .../Tests/Feature/OpenApiDocumentationComprehensiveTest.php | 1 + src/php/src/Api/Tests/Feature/OpenApiDocumentationTest.php | 4 ++++ 3 files changed, 6 insertions(+) diff --git a/src/php/src/Api/Documentation/Attributes/ApiResponse.php b/src/php/src/Api/Documentation/Attributes/ApiResponse.php index b96ca76..6958c69 100644 --- a/src/php/src/Api/Documentation/Attributes/ApiResponse.php +++ b/src/php/src/Api/Documentation/Attributes/ApiResponse.php @@ -85,6 +85,7 @@ readonly class ApiResponse 403 => 'Forbidden', 404 => 'Not found', 405 => 'Method not allowed', + 410 => 'Gone', 409 => 'Conflict', 422 => 'Validation error', 429 => 'Too many requests', diff --git a/src/php/src/Api/Tests/Feature/OpenApiDocumentationComprehensiveTest.php b/src/php/src/Api/Tests/Feature/OpenApiDocumentationComprehensiveTest.php index 6ad6188..06e7cac 100644 --- a/src/php/src/Api/Tests/Feature/OpenApiDocumentationComprehensiveTest.php +++ b/src/php/src/Api/Tests/Feature/OpenApiDocumentationComprehensiveTest.php @@ -457,6 +457,7 @@ describe('ApiResponse Attribute Rendering', function () { 401 => 'Unauthorised', 403 => 'Forbidden', 404 => 'Not found', + 410 => 'Gone', 422 => 'Validation error', 429 => 'Too many requests', 500 => 'Internal server error', diff --git a/src/php/src/Api/Tests/Feature/OpenApiDocumentationTest.php b/src/php/src/Api/Tests/Feature/OpenApiDocumentationTest.php index 69fc496..843e00f 100644 --- a/src/php/src/Api/Tests/Feature/OpenApiDocumentationTest.php +++ b/src/php/src/Api/Tests/Feature/OpenApiDocumentationTest.php @@ -57,6 +57,10 @@ class OpenApiDocumentationTest extends TestCase $response = new ApiResponse(404); $this->assertEquals('Not found', $response->getDescription()); + + $goneResponse = new ApiResponse(410); + + $this->assertEquals('Gone', $goneResponse->getDescription()); } public function test_api_security_attribute(): void