From 525f99f5ff0141bdbaf10112b58bb3e136517359 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 | 28 ++++++++++++++++++++++++++++ 3 files changed, 54 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 @@ +skipLegacy(); + + $config = [ + 'pathFilter' => ['paths' => ['#^/hello/#']], + 'cleanUnusedComponents' => ['enabled' => true], + ]; + $analysis = $this->analysisFromFixtures(['SurplusTag.php'], static::processors(), null, $config); + + $this->assertCount(1, $analysis->openapi->tags); + } +}