diff --git a/src/Helpers.php b/src/Helpers.php index 373a2e2..2b81123 100644 --- a/src/Helpers.php +++ b/src/Helpers.php @@ -240,7 +240,12 @@ public static function getOpenAPIAttributeTagsByScope(ClassMethod|Class_|Node $n foreach ($arg->value->items as $item) { if ($item?->value instanceof String_) { - $foundTags[] = $item->value->value; + $tag = $item->value->value; + $pattern = "/^[0-9a-zA-Z_-]+$/"; + if (!preg_match($pattern, $tag)) { + Logger::error($routeName, 'Tag "' . $tag . '" has to match pattern "' . $pattern . '"'); + } + $foundTags[] = $tag; } } }