From 8a516318b9a0e3dba1ecf692c515506b88676493 Mon Sep 17 00:00:00 2001 From: Andrew Omondi Date: Thu, 16 May 2024 13:31:32 +0300 Subject: [PATCH] minor cleanup --- src/Kiota.Builder/KiotaBuilder.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Kiota.Builder/KiotaBuilder.cs b/src/Kiota.Builder/KiotaBuilder.cs index 3539f1674c..2a700ad9d8 100644 --- a/src/Kiota.Builder/KiotaBuilder.cs +++ b/src/Kiota.Builder/KiotaBuilder.cs @@ -358,12 +358,12 @@ private static Dictionary> GetFilterPatternsFromCon internal static void CleanupOperationIdForPlugins(OpenApiDocument document) { if (document.Paths is null) return; - foreach (var (pathItem, operation) in document.Paths.SelectMany(path => path.Value.Operations.Select(value => new Tuple>(path.Key, value)))) + foreach (var (pathItem, operation) in document.Paths.SelectMany(static path => path.Value.Operations.Select(value => new Tuple>(path.Key, value)))) { if (string.IsNullOrEmpty(operation.Value.OperationId)) { var stringBuilder = new StringBuilder(); - foreach (var segment in pathItem.Split('/')) + foreach (var segment in pathItem.TrimStart('/').Split('/',StringSplitOptions.RemoveEmptyEntries)) { if (segment.IsPathSegmentWithSingleSimpleParameter()) stringBuilder.Append("item");