From 1ba77218dfe61ca9e6cff1bbb3e9a4a6658d4538 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Sun, 7 Mar 2021 20:13:33 +0100 Subject: [PATCH 1/2] docs: update changelog for 2.6.3 (#4119) --- CHANGELOG.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cbdb5a0e951..cc5fb988845 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -113,10 +113,12 @@ * Identifiers: Do not denormalize the same identifier twice (#3762) * OpenAPI: Lazy load `SwaggerCommand` (#3802) * OpenAPI: Use Output class name instead of the Resource short name when available (#3741) +* OpenAPI: Allow unset PathItem method (#4107) * Router: Replace baseurl only once (#3776) * Mercure: Publisher bug fixes (#3790, #3739) * Serializer: Catch NotNormalizableValueException to UnexpectedValueEception with inputs (#3697) -* Doctrine: ODM escape search terms in RegexFilter +* Doctrine: Do not add JOINs for filters without a value (#3703) +* MongoDB: Escape search terms in `RegexFilter` (#3755) * Tests: Improve JSON Schema assertions (#3807, #3803, #3804, #3806, #3817, #3829, #3830) * Tests: Allow passing extra options in ApiTestClient (#3486) * Docs: Upgrade Swagger UI to version 3.37.2 (#3867) From 1fee3914b72dc0d21be34d5a59fe83c158bf304b Mon Sep 17 00:00:00 2001 From: Karol F Date: Thu, 11 Mar 2021 15:31:33 +0000 Subject: [PATCH 2/2] Ability to remove paths from OpenApi --- src/OpenApi/Model/Paths.php | 5 +++++ tests/OpenApi/Factory/OpenApiFactoryTest.php | 13 +++++++++++++ 2 files changed, 18 insertions(+) diff --git a/src/OpenApi/Model/Paths.php b/src/OpenApi/Model/Paths.php index 80829b3d876..8852f372feb 100644 --- a/src/OpenApi/Model/Paths.php +++ b/src/OpenApi/Model/Paths.php @@ -22,6 +22,11 @@ public function addPath(string $path, PathItem $pathItem) $this->paths[$path] = $pathItem; } + public function removePath(string $path): void + { + unset($this->paths[$path]); + } + public function getPath(string $path): ?PathItem { return $this->paths[$path] ?? null; diff --git a/tests/OpenApi/Factory/OpenApiFactoryTest.php b/tests/OpenApi/Factory/OpenApiFactoryTest.php index bd2ea6aed0c..3f2c4c42efc 100644 --- a/tests/OpenApi/Factory/OpenApiFactoryTest.php +++ b/tests/OpenApi/Factory/OpenApiFactoryTest.php @@ -762,4 +762,17 @@ public function testResetPathItem() $this->assertNull($pathItem->getPut()); $this->assertNull($pathItem->getPatch()); } + + public function testRemovePath() + { + $paths = new Model\Paths(); + + $paths->addPath('/', new PathItem()); + + $this->assertEquals(1, count($paths->getPaths())); + + $paths->removePath('/'); + + $this->assertEquals(0, count($paths->getPaths())); + } }