From f7de432cb84e8b3fee640afa2ba8a2e8df32b8db Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Thu, 19 Dec 2024 15:42:19 +0530 Subject: [PATCH 1/3] TODO: undo this commit at the end --- composer.json | 2 -- 1 file changed, 2 deletions(-) diff --git a/composer.json b/composer.json index a3054a52..edabaf1e 100644 --- a/composer.json +++ b/composer.json @@ -28,8 +28,6 @@ "phpunit/phpunit": "^6.5 || ^7.5 || ^8.5 || ^9.4", "oai/openapi-specification": "3.0.3", "mermade/openapi3-examples": "1.0.0", - "apis-guru/openapi-directory": "1.0.0", - "nexmo/api-specification": "1.0.0", "phpstan/phpstan": "^0.12.0" }, "conflict": { From 1c014811afa9655043a67e786842dd15d8f28d14 Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Thu, 19 Dec 2024 18:37:33 +0530 Subject: [PATCH 2/3] Add test --- tests/IssueTest.php | 13 +++++++++++++ tests/data/issue/175/401.json | 20 ++++++++++++++++++++ tests/data/issue/175/spec.json | 20 ++++++++++++++++++++ 3 files changed, 53 insertions(+) create mode 100644 tests/IssueTest.php create mode 100644 tests/data/issue/175/401.json create mode 100644 tests/data/issue/175/spec.json diff --git a/tests/IssueTest.php b/tests/IssueTest.php new file mode 100644 index 00000000..a350d5b7 --- /dev/null +++ b/tests/IssueTest.php @@ -0,0 +1,13 @@ +assertInstanceOf(\cebe\openapi\SpecObjectInterface::class, $openapi); + } +} diff --git a/tests/data/issue/175/401.json b/tests/data/issue/175/401.json new file mode 100644 index 00000000..eb4f5c9b --- /dev/null +++ b/tests/data/issue/175/401.json @@ -0,0 +1,20 @@ +{ + "description": "401 response", + "content": { + "application/json": { + "schema": { + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ] + }, + "example": { + "message": "Unauthenticated." + } + } + } +} diff --git a/tests/data/issue/175/spec.json b/tests/data/issue/175/spec.json new file mode 100644 index 00000000..5cea0466 --- /dev/null +++ b/tests/data/issue/175/spec.json @@ -0,0 +1,20 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "My API", + "version": "1, 2" + }, + "paths": { + "/v1/users/profile": { + "get": { + "operationId": "V1GetUserProfile", + "summary": "Returns the user profile", + "responses": { + "401": { + "$ref": "./401.json" + } + } + } + } + } +} From 993f1f0707d5036cfa0d70a21218086840b4d02a Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Fri, 7 Feb 2025 16:53:47 +0530 Subject: [PATCH 3/3] Add back removed packages --- composer.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/composer.json b/composer.json index edabaf1e..a3054a52 100644 --- a/composer.json +++ b/composer.json @@ -28,6 +28,8 @@ "phpunit/phpunit": "^6.5 || ^7.5 || ^8.5 || ^9.4", "oai/openapi-specification": "3.0.3", "mermade/openapi3-examples": "1.0.0", + "apis-guru/openapi-directory": "1.0.0", + "nexmo/api-specification": "1.0.0", "phpstan/phpstan": "^0.12.0" }, "conflict": {