Skip to content

Commit

Permalink
minor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Omondi committed May 16, 2024
1 parent 5a70115 commit 8a51631
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Kiota.Builder/KiotaBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -358,12 +358,12 @@ private static Dictionary<Glob, HashSet<OperationType>> 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<string, KeyValuePair<OperationType, OpenApiOperation>>(path.Key, value))))
foreach (var (pathItem, operation) in document.Paths.SelectMany(static path => path.Value.Operations.Select(value => new Tuple<string, KeyValuePair<OperationType, OpenApiOperation>>(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");
Expand Down

0 comments on commit 8a51631

Please sign in to comment.