From 928a54df12d71ad4cd7708b7fa53aedd6f5b8d48 Mon Sep 17 00:00:00 2001 From: DerManoMann Date: Tue, 16 Jul 2024 11:32:34 +1200 Subject: [PATCH] Make `AugmentTags` the last processor --- src/Generator.php | 2 +- tests/Fixtures/SurplusTag.php | 25 +++++++++++++++++++++++++ tests/Processors/AugmentTagsTest.php | 23 +++++++++++++++++++++++ 3 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 tests/Fixtures/SurplusTag.php create mode 100644 tests/Processors/AugmentTagsTest.php diff --git a/src/Generator.php b/src/Generator.php index 16d61acd..ab804aaf 100644 --- a/src/Generator.php +++ b/src/Generator.php @@ -275,10 +275,10 @@ public function getProcessorPipeline(): Pipeline new Processors\MergeJsonContent(), new Processors\MergeXmlContent(), new Processors\OperationId(), - new Processors\AugmentTags(), new Processors\CleanUnmerged(), new Processors\PathFilter(), new Processors\CleanUnusedComponents(), + new Processors\AugmentTags(), ]); } diff --git a/tests/Fixtures/SurplusTag.php b/tests/Fixtures/SurplusTag.php new file mode 100644 index 00000000..0ac32cc6 --- /dev/null +++ b/tests/Fixtures/SurplusTag.php @@ -0,0 +1,25 @@ + ['paths' => ['#^/hello/#']], + 'cleanUnusedComponents' => ['enabled' => true], + ]; + $analysis = $this->analysisFromFixtures(['SurplusTag.php'], static::processors(), null, $config); + + $this->assertCount(1, $analysis->openapi->tags); + } +}